Introduction

The LEADTOOLS API provides dynamic link library (DLL) functions to let you incorporate image compression, file format support, and image processing into your Windows applications.

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

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

LEADTOOLS support for Mixed Raster Content format, defined for use for color and grayscale fax as part of the T44 standard, is provided by the LEADTOOLS Mixed Raster Content (MRC) API. Documentation for this API can be found in the LEADTOOLS MRC API help file, Ltmrcdlln.chm in the LEADTOOLS\Help directory.

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

Introduction To Image Processing with LEADTOOLS

Compression Using LEAD and JPEG Formats

Summary of All Supported Image File Formats

Compression Quality Factors


Version History

Current version: | 14.5
Last update: | 10/17/2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Changes from Version 12 to Version 12.1

Changes from Version 11.5 to Version 12

Changes from Version 10 to Version 11 (11.5)

Changes from Version 9.0 to Version 10

Changes from Version 8.0 to Version 9.0

Changes from Version 7.0 to Version 8.0

Changes from Version 6.2 to Version 7.0

Changes from Version 5.2 to Version 6.2


Changes from Version 14 to Version 14.5

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

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 L_AnnSetOptions function. 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 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 other information useful for topographic applications.

LEADTOOLS has added new image processing functions to create a Perlin noise, and to apply an effect to the bitmap that makes it look like it has been drawn with colored pencils.

LEADTOOLS supports creating a Kaufmann region.

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

LEADTOOLS has added new functionality to change the image data type from signed to unsigned and vice versa.

LEADTOOLS supports functions 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 supports CMYK functions, which handle CMYK TIFF files as separate bitmaps.

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

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

LEADTOOLS has added new functionality to create a new region, or update an existing region, based on either an HSV range or an RGB range.

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

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

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

LEADTOOLS now supports the following new file formats:

File Formats: JBIG2 Format (JB2)

File Formats: ABIC Format (ABIC, ICA)

Changed Structures

The SAVEFILEOPTION structure has one new member.

The FILEINFO struture has one new member.

New Structures

Annotation Stuctures

ANNROTATEOPTIONS

ANNTEXTOPTIONS

File Formats Options Stuctures

FILEDJVOPTIONS

FILEJBIG2OPTIONS

FILETXTOPTIONS

Image List Stuctures

LILEXPORTBITMAPLIST

LILIMPORTBITMAPLIST

LILSORTOPTIONS

Image Optimization Stuctures

OPTIMIZEIMAGEDIRINFO

OPTIMIZEIMAGEOPTIONS

Image Processing Stuctures

MOSAICTILESINFO

JPEGCOLORSPACE

PLASMAINFO

SLICEBITMAPOPTIONS

VIGNETTEINFO

Zoom View Stucture

ZOOMVIEWPROPS

ICC Profile Stuctures

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICCTAG_UNKNOWN_TYPE

ICCTAG_XYZ_TYPE

ICC_XYZ_NUMBER

ICCTAG_VIEW_COND_TYPE

ICC_VIEW_COND

ICCTAG_UINT8_ARRAY_TYPE

ICCTAG_UINT64_ARRAY_TYPE

ICCTAG_UINT32_ARRAY_TYPE

ICCTAG_UINT16_ARRAY_TYPE

ICCTAG_U16_FIXED16_ARRAY_TYPE

ICCTAG_TEXT_TYPE

ICCTAG_SIGNATURE_TYPE

ICCTAG_S15_FIXED16_ARRAY_TYPE

ICCTAG_RESPONSE_CURVE_SET16_TYPE

ICC_RESPONSE_CURVE

ICC_CURVE_STRUCTURE

ICC_XYZ_ARRAY

ICC_RESPONSE_ARRAYS

ICC_RESPONSE_16_NUMBER

ICCTAG_PROFILE_SEQ_DESC_TYPE

ICC_PROFILE_SEQ_DESC

ICC_PROFILE_DESC

ICCTAG_PARAMETRIC_CURVE_TYPE

ICC_PARAMETRIC_CURVE

ICCTAG_NAMED_COLOR2_TYPE

ICC_NAMED_COLOR2

ICC_NAMED_COLOR2_DATA

ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

ICC_MULTI_LOCALIZED_UNICODE

ICC_NAME_RECORD

ICCTAG_MEASUREMENT_TYPE

ICC_MEASUREMENT

ICCTAG_LUT_A_TO_B_TYPE

ICC_MATRIX

ICCTAG_LUT8_TYPE

ICC_LUT8

ICCTAG_LUT16_TYPE

ICC_LUT16

ICCTAG_DATE_TIME_TYPE

ICC_DATE_TIME_NUMBER

ICCTAG_DATA_TYPE

ICC_DATA

ICCTAG_CURVE_TYPE

ICC_CURVE

ICCTAG_COLORANT_TABLE_TYPE

ICC_COLORANT_TABLE_DATA

ICCTAG_COLORANT_ORDER_TYPE

ICCTAG_CHROMATICITY_TYPE

ICC_CHROMATICITY

ICC_CHANNEL_COORD

ICCTAG_BASE

ICCDATATYPEFLAGS

ICCCOLORANTTYPE

ICCMEASUREMENTSIGNATURE

ICCFUNCTIONTYPE

ICCMEASUREMENTFLARE

ICCMEASUREMENTGEOMETRY

ICCSTANDARDOBSERVER

ICCTAGTYPESIGNATURE

ICCTECHNOLOGYSIGNATURE

ICCTAGSIGNATURE

ICCPROFILECLASS

ICCCOLORSPACE

ICCRENDERINGINTENT

ICCPLATFORMSIGNATURE

The rest of this topic lists the new functions in version 14.5:

Annotation

L_AnnCalibrateRuler

L_AnnGetAutoSnapCursor

L_AnnGetFillModeExt

L_AnnGetOptions

L_AnnGetRotateOptions

L_AnnGetTextOptions

L_AnnSetAutoSnapCursor

L_AnnSetFillModeExt

L_AnnSetOptions

L_AnnSetRotateOptions

L_AnnSetTextOptions

L_AnnTextEdit

GeoKeys

ENUMGEOKEYSCALLBACK

L_EnumFileGeoKeys

L_GetGeoKey

L_ReadFileGeoKey

L_SetGeoKey

L_WriteFileGeoKey

ICC Profile

L_2bFixed2bNumberToDouble

L_CreateICCTagData

L_DeleteICCTag

L_DoubleTo2bFixed2bNumber

L_FillICCProfileFromICCFile

L_FillICCProfileStructure

L_FreeICCProfileExt

L_FreeICCTagType

L_GenerateICCFile

L_GenerateICCPointer

L_GetICCTagData

L_GetICCTagTypeSig

L_InitICCHeader

L_InitICCProfileExt

L_LoadICCProfileExt

L_SaveICCProfile

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent

L_SetICCTagData

Change the Image Data Type (Signed / Unsigned)

L_ShiftMinimumToZero

L_ShiftZeroToNegative

Kaufmann Region

L_SetKaufmannRgnBitmap

Image Optimization

L_OptGetDefaultOptions

L_OptOptimizeBuffer

L_OptOptimizeDir

OPTIMIZEBUFFERCALLBACK

OPTIMIZEIMAGEDIRCALLBACK

CMYK TIFF Files

L_LoadFileCMYKArray

L_PaintDCCMYKArray

L_SaveFileCMYKArray

Handling TIFF and Exif Files

ENUMTAGSCALLBACK

L_CompactFile

L_DeleteTag

L_EnumFileTags

Reading a Comment From a File at a Specific Location

L_ReadFileCommentOffset

Zoom View

L_CreateZoomView

L_DestroyZoomView

L_GetZoomViewProps

L_GetZoomViewsCount

L_RenderZoomView

L_UpdateZoomView

L_WindowHasZoomView

Loading TXT File Options

L_GetTXTOptions

L_SetTXTOptions

Saving JBIG2 File Options

L_GetJBIG2Options

L_SetJBIG2Options

Encoding/Decoding ABIC Files

L_DecodeABIC

L_EncodeABIC

Image Processing Functions

BITMAPSLICECALLBACK

L_AdjustBitmapTint

L_BricksTextureBitmap

L_CanvasBitmap

L_CloudsBitmap

L_ColoredBallsBitmap

L_ColoredPencilBitmap

L_ColorHalfToneBitmap

L_CorrelationListBitmap

L_DeskewBitmapExt

L_DiffuseGlowBitmap

L_DisplaceMapBitmap

L_FragmentBitmap

L_GammaCorrectBitmapExt

L_HalfTonePatternBitmap

L_HighPassFilterBitmap

L_MaskConvolutionBitmap

L_MosaicTilesBitmap

L_OffsetBitmap

L_PerlinBitmap

L_PerspectiveBitmap

L_PlasmaFilterBitmap

L_PointillistBitmap

L_RomanMosaicBitmap

L_SliceBitmap

L_VignetteBitmap

L_ZigZagBitmap

Miscellaneous

L_GetLoadStatus

New Messages for the Image List Control

L_ILM_SORTEXT

L_ILM_IMPORTBITMAPLIST

L_ILM_EXPORTBITMAPLIST


Changes from Version 13 to Version 14

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

Support for LZW compression no longer has to be unlocked.

LEADTOOLS API now supports UNICODE.

The Common Dialog functionality has been removed from this help file and is presented in the new LEADTOOLS Common Dialog API help file .For information on the new version 14 of the LEADTOOLS Common Dialog API, refer to the LEADTOOLS Common Dialog API 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 being added with Version 14 now 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 has added four new handling messages for image list:

L_ILM_CANCELDB

L_ILN_LOADDBSTATUS

L_ILN_SAVEDBSTATUS

L_ILN_DROPFILES

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 or removed functions

The following functions have been changed from the previous version of LEADTOOLS or removed:

L_AnnFileInfo takes 1 new parameter.

L_AnnFileInfoMemory takes 1 new parameter.

L_AnnFileInfoOffset takes 1 new parameter.

L_AnnGetBitmap takes 1 new parameter.

L_AnnGetSecondaryBitmap takes 1 new parameter.

L_AnnGetToolBarInfo takes 1 new parameter.

L_AnnGetToolBarButtons takes 1 new parameter.

L_ChangeBitmapViewPerspective takes 1 new parameter.

L_ChangeFromDDB takes 1 new parameter.

L_ChangeFromDIB takes 1 new parameter.

L_ChangeFromEMF takes 1 new parameter.

L_ChangeFromWMF takes 1 new parameter.

L_ChangeToDIB takes 1 new parameter.

L_ColorMergeBitmap takes 1 new parameter.

L_ColorResBitmap takes 1 new parameter.

L_ColorSeparateBitmap takes 1 new parameter.

L_ConvertFromDDB takes 1 new parameter.

L_ConvertFromDIB takes 1 new parameter.

L_ConvertFromEMF takes 1 new parameter.

L_ConvertFromWMF takes 1 new parameter.

L_ConvertToDIB takes 1 new parameter.

L_CopyBitmap takes 1 new parameter.

L_CopyBitmapHandle takes 1 new parameter.

L_CopyBitmapRect takes 1 new parameter.

L_CopyFromClipboard takes 1 new parameter.

L_CreateFadedMask takes 1 new parameter.

L_CreateMaskFromBitmapRgn takes 1 new parameter.

L_CreateThumbnailFromFile takes 1 new parameter.

L_EfxEffectBlt takes 2 new parameters.

L_EfxPaintBitmap takes 2 new parameters.

L_EfxPaintTransition takes 2 new parameters.

L_FileInfo takes 1 new parameter.

L_FileInfoMemory takes 1 new parameter.

L_GetBitmapAlpha takes 1 new parameter.

L_GetBitmapListItem takes 1 new parameter.

L_GetDefaultJ2KOptions takes 1 new parameter.

L_GetDefaultLoadFileOption takes 1 new parameter.

L_GetDefaultSaveFileOption takes 1 new parameter.

L_GetJ2KOptions takes 1 new parameter.

L_GetPDFOptions takes 1 new parameter.

L_GetWMFResolution takes 1 new parameter.

L_HalfToneBitmap takes 1 new parameter.

L_ISISAcquire takes 1 new parameter.

L_LoadBitmap takes 1 new parameter.

L_LoadBitmapMemory takes 1 new parameter.

L_LoadBitmapResize takes 1 new parameter.

L_LoadExtensionStamp takes 1 new parameter.

L_LoadFile takes 1 new parameter.

L_LoadFileOffset takes 1 new parameter.

L_LoadFileTile takes 1 new parameter.

L_LoadLayer takes 1 new parameter.

L_LoadMemory takes 1 new parameter.

L_ReadFileStamp takes 1 new parameter.

L_ResizeBitmap takes 1 new parameter.

L_ScreenCaptureBitmap takes 1 new parameter.

L_SetBitmapRgnMagicWand takes 2 new parameters.

L_SetStatusCallBack takes 2 new parameters.

L_SetWMFResolution takes 1 new parameter.

L_StartFeedLoad takes 1 new parameter.

L_VersionInfo takes 1 new parameter.

L_WindowLevelFillLUT takes 1 new parameter.

The parameters nThumbWidth, nThumbHeight, nBits, uCRFlags, bMaintainAspect, bForceSize, crBackColor, bLoadStamp, and bResample of L_BrowseDir were removed and a pointer to THUMBOPTIONS being added.

The parameters nWidth, nHeight, nZoom, clrPen,hMagCursor, clrBack, bEllipse, nBorderSize, b3D, uPaintFlags, pMask, uMaskCount, nCrosshair, bIgnoreRgn, and bCenter, of L_StartMagGlass were removed and three new parameters were added.

The following functions have been removed:

L_AnnGetName | Use L_AnnGetNameOptions
L_AnnSetName | Use L_AnnSetNameOptions
L_ChangeToDIB2 | Use L_ChangeToDIB
L_ConvertToDIB2 | Use L_ConvertToDIB
L_CopyToClipboardExt | Use L_CopyToClipboard
L_CreateBitmapPalette |
L_DeskewBitmap2 | Use L_DeskewBitmap
L_FreeImage |
L_GetWMFResolutionEx | Use L_GetWMFResolution
L_HalftoneBitmapExt | Use L_HalftoneBitmap
L_PrintBitmapExt | Use L_PrintBitmap
L_ResizeBitmapExt | Use L_ResizeBitmap
L_SetBitmapRgnMagicWandExt | Use L_SetBitmapRgnMagicWand
L_SetPaletteType |
L_SetWMFResolutionEx | Use L_SetWMFResolution
L_StartMagGlassEx | Use L_StartMagGlass
L_UpdateMagGlassEx | Use L_UpdateMagGlass

Changed structures

The BITMAPHANDLE structure has 4 new members.

The LOADINFO structure now has 1 new member.

The LOADFILEOPTION structure now has 1 new member.

The FILEINFO structure has 1 new member.

The SAVEFILEOPTION structure has 1 new member.

The VERSIONINFO structure has 1 new member.

The LAYERINFO structure has 1 new member.

The FILEPDFOPTIONS structure has 1 new member.

The ADDBORDERINFO structure has 1 new member.

The ADDFRAMEINFO structure has 1 new member.

The FILEJ2KOPTIONS structure has 1 new member.

The STARTDECOMPRESSDATA structure has 2 new members.

The THUMBOPTIONS structure has 1 new member.

The DECOMPRESSDATA structure has 1 new member.

The SMOOTH structure has 2 new members.

The LINEREMOVE structure has 2 new members.

The MAGGLASSPAINTOPTIONS structure has 1 new member.

The MAGGLASSOPTIONS structure has 1 new member.

The BORDERREMOVE structure has 2 new members.

The INVERTEDTEXT structure has 2 new members.

The CURVE structure has 1 new member.

The DOTREMOVE structure has 2 new members.

The HOLEPUNCH structure has 2 new members.

The LILCLICK structure has 1 new member.

The LILITEM structure has 3 new members.

The LILITEMOPTIONS structure has 1 new member.

The LILITEMSEL structure has 1 new member.

The LILSELOPTION structure has 1 new member.

The ANNBUTTON structure has 2 new members.

The ANNCHANGEPARAM structure has 1 new member.

The ANNFILEINFO structure has 1 new member.

The ANNHYPERLINK structure has one new member.

The ANNPROTRACTOR structure has one new member.

The ANNTOOL structure has 1 new member.

The ANNTOOLBARINFO structure has 1 new member.

The LEADBITMAPCOLORRES structure has 1 new member.

The LEADBITMAPLOAD structure has 1 new member.

The LEADBITMAPSAVE structure has 1 new member.

The LEADBITMAPINFO structure has 1 new member.

The LEADBITMAPFOCUSEDZOOM structure has 1 new member.

The LEADBITMAPSHEAR structure has 1 new member.

The LEADBITMAPPRINT structure has 1 new member.

New structures

The following are new structures:

ADDMESGINFO

ANNCHANGEPARAM

ANNCHANGETYPE

ANNENCRYPTOPTIONS

ANNFONT

ANNHANDLE

ANNHANDLEINFO

ANNHILIGHT

ANNHITTESTINFO

ANNHYPERLINK

ANNMOVE

ANNMOVEPOINT

ANNNAMEOPTIONS

ANNPOINTOPTIONS

ANNPROTRACTOR

ANNRESIZEROTATE

ANNRULERUNIT

ANNSMARTDISTANCE

ANNTEXTTOKEN

ANNTEXTTOKENTYPE

ANNXFORM

BALANCEDATA

BUMPDATA

COLORDATA

COLORREPLACE

COMPDATA

FILEOVERLAYCALLBACKDATA

FILEPLTOPTIONS

FILEPTKOPTIONS

FILERTFOPTIONS

FTARRAY

GRAYCOLOR

HSIDATA

L_COMPLEX

LIGHTINFO

LIGHTPARAMS

LVLCLRINF

LVLCLR

MAGGLASSOPTIONS

MEMICCPROFILE

OVERLAYATTRIBUTES

SEARCHMARKS

SELCLRINF

SELCLR

STARINFO

STATISTICSINFO

USERFLT

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

ANNENUMHANDLECALLBACK

ANNENUMTEXTTOKENTABLECALLBACK

L_AdaptiveContrastBitmap

L_AddMessageToBitmap

L_AddWeightedBitmaps

L_AgingBitmap

L_AllocFTArray

L_AnnAddUserHandle

L_AnnAdjustPoint

L_AnnChangeUserHandle

L_AnnClearTextTokenTable

L_AnnConvert

L_AnnDefine2

L_AnnDeleteTextTokenTable

L_AnnDeleteUserHandle

L_AnnEncryptApply

L_AnnEnumerateHandles

L_AnnEnumerateTextTokenTable

L_AnnGetAutoCursor

L_AnnGetDistance2

L_AnnGetEncryptOptions

L_AnnGetFixed

L_AnnGetNameOptions

L_AnnGetNameOptions

L_AnnGetPointOptions

L_AnnGetPredefinedBitmap

L_AnnGetRestrictToContainer

L_AnnGetRotateAngle

L_AnnGetSecondaryMetafile

L_AnnGetTextAlign

L_AnnGetTextExpandTokens

L_AnnGetTextPointerFixed

L_AnnGetTextRotate

L_AnnGetTextRTF

L_AnnGetTicMarkLength

L_AnnGetUserData

L_AnnGetUserHandle

L_AnnGetUserHandles

L_AnnHitTestExt

L_AnnInsertTextTokenTable

L_AnnIsFixedInRect

L_AnnPopFixedState

L_AnnPushFixedState

L_AnnRestrictCursor

L_AnnSetAutoCursor

L_AnnSetAutoHilightPen

L_AnnSetEncryptOptions

L_AnnSetFixed

L_AnnSetNameOptions

L_AnnSetNameOptions

L_AnnSetPointOptions

L_AnnSetPredefinedBitmap

L_AnnSetRestrictToContainer

L_AnnSetTextAlign

L_AnnSetTextExpandTokens

L_AnnSetTextPointerFixed

L_AnnSetTextRotate

L_AnnSetTextRTF

L_AnnSetTicMarkLength

L_AnnSetUserData

L_ApplyLinearModalityLUT

L_ApplyLinearVOILUT

L_ApplyMathLogicBitmap

L_ApplyModalityLUT

L_ApplyTransformationParameters

L_ApplyVOILUT

L_AutoBinaryBitmap

L_AutoColorLevelBitmap

L_BendingBitmap

L_BumpMapBitmap

L_ChangeHueSatIntBitmap

L_ChannelMix

L_ColorIntensityBalance

L_ColorizeGrayBitmap

L_ColorLevelBitmap

L_ColorReplaceBitmap

L_ColorThresholdBitmap

L_CombineBitmapWarp

L_ContBrightIntBitmap

L_ConvertBitmapUnsignedToSigned

L_CorrelationBitmap

L_CubismBitmap

L_CylindricalBitmap

L_DeinterlaceBitmap

L_DesaturateBitmap

L_DFTBitmap

L_DiceEffectBitmap

L_DigitalSubtractBitmap

L_DirectionEdgeStatisticalBitmap

L_DoubleBufferBegin

L_DoubleBufferCreateHandle

L_DoubleBufferDestroyHandle

L_DoubleBufferEnable

L_DoubleBufferEnd

L_DrawStarBitmap

L_DryBitmap

L_DynamicBinaryBitmap

L_EdgeDetectEffectBitmap

L_EdgeDetectStatisticalBitmap

L_ExtractMessageFromBitmap

L_FFTBitmap

L_FreeFTArray

L_FreeHandShearBitmap

L_FreeHandWaveBitmap

L_FreeICCProfile

L_FreePlaneBendBitmap

L_FreeRadBendBitmap

L_FrqFilterBitmap

L_FrqFilterMaskBitmap

L_FTDisplayBitmap

L_FunctionalLightBitmap

L_GetAutoCADFilesColorScheme

L_GetBitmapMemoryInfo

L_GetBitmapStatisticsInfo

L_GetCurvePoints

L_GetDJVOptions

L_GetFeretsDiameter

L_GetMarksCenterMassBitmap

L_GetMemoryThresholds

L_GetObjectInfo

L_GetOverlayAttributes

L_GetOverlayBitmap

L_GetOverlayCallback

L_GetOverlayCount

L_GetPDFInitDir

L_GetPLTOptions

L_GetPTKOptions

L_GetRgnContourPoints

L_GetRgnPerimeterLength

L_GetRTFOptions

L_GetTempDirectory

L_GetTransformationParameters

L_GlassEffectBitmap

L_GlowFilterBitmap

L_GrayScaleToDuotone

L_GrayScaleToMultitone

L_HolesRemovalBitmapRgn

L_ImpressionistBitmap

L_InitICCProfile

L_IsRegMarkBitmap

L_LensFlareBitmap

L_LightBitmap

L_LightControlBitmap

L_LoadICCProfile

L_LocalHistoEqualizeBitmap

L_MathFunctionBitmap

L_MultiplyBitmap

L_MultiScaleEnhancementBitmap

L_OceanBitmap

L_PaintDCOverlay

L_PixelateBitmap

L_PlaneBendBitmap

L_PlaneBitmap

L_PolarBitmap

L_PunchBitmap

L_PuzzleEffectBitmap

L_RadialBlurBitmap

L_RadWaveBitmap

L_RevEffectBitmap

L_RingEffectBitmap

L_RippleBitmap

L_SampleTargetBitmap

L_ScrambleBitmap

L_SearchRegMarksBitmap

L_SegmentBitmap

L_SelectBitmapData

L_SelectiveColorBitmap

L_SetAutoCADFilesColorScheme

L_SetBitmapMemoryInfo

L_SetDJVOptions

L_SetMemoryThresholds

L_SetOverlayAttributes

L_SetOverlayBitmap

L_SetOverlayCallback

L_SetPDFInitDir

L_SetPLTOptions

L_SetPTKOptions

L_SetRTFOptions

L_SetTempDirectory

L_ShiftBitmapData

L_SkeletonBitmap

L_SmoothEdgesBitmap

L_SpherizeBitmap

L_SubtractBackgroundBitmap

L_SwirlBitmap

L_TextureAlphaBlendBitmap

L_TextureAlphaBlendBitmap

L_TunnelBitmap

L_UpdateBitmapOverlayBits

L_UserFilterBitmap

L_WaveBitmap

L_WindBitmap

L_ZoomBlurBitmap

L_ZoomWaveBitmap

OVERLAYCALLBACK


Changes from Version 12.1 to Version 13

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

LEADTOOLS now supports metadata markers.

LEADTOOLS now supports region of interest in J2K files.

For an important note concerning the BITMAPHANDLE structure, please refer to the Changed Structures section of this topic.

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.

Please note that version 13 is the last version that will support the TWAIN functions present in this help file. For information on the new version 1.9 TWAIN support, refer to the LEADTOOLS TWAIN API Help File .

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

LEADTOOLS now supports the following file formats:

PTOCA (Presentation Text Object Content Architecture)

SCT (Scitex Continuous Tone Format)

PCL (Printer Command Language)

AFP

IOCA (Image Object Content Architecture)

SHP (ESRI Shape Format)

SMP

CMW

The LEADTOOLS callback functions now use PASCAL calling convention instead of C calling convention. This allows the callbacks to be used in VB6, VB7, C#, etc.

LEADTOOLS now provides more extensive color conversion support. For more information on this new support, refer to the LEADTOOLS Color Conversion API Help File .

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

LEADTOOLS now supports super-compression of 1-bit and 24-bit bitmaps.

LEADTOOLS now provides the means to get information about annotation files and delete pages from annotation files.

LEADTOOLS can perform Lossless transformations (rotate, flip and reverse) on JPEG, CMP and JPEG TIFF files. This is superior to loading the image, performing the transformation and the saving the image.

LEADTOOLS provides support for removing red-eye from images.

LEADTOOLS supports an anti-aliasing filter.

LEADTOOLS can perform Gaussian blurring.

LEADTOOLS lets you swap color channel values across the R, G and B color channels.

New functions let you give images an "old-fashioned" look by converting to "colored gray".

LEADTOOLS can add or average bitmaps within a list.

LEADTOOLS lets you resize individual regions within a bitmap.

LEADTOOLS can add motion blur to images.

New functions 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 more support for grouping and ungrouping annotation objects.

The LEADTOOLS Image List now lets you redraw individual items within the Image List.

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

Support for ISIS ASCI tags is now provided.

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 alter the shape of certain annotations by holding down the Shift key while drawing. (An Ellipse object will automatically be drawn as a circle; other annotations like notes, buttons, audio clips, etc. will automatically be drawn as squares.)

LEADTOOLS now lets you associate metafiles with hotspot annotations and freehand hotspot annotations.

LEADTOOLS now provides the ability move the name of annotation objects.

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

LEADTOOLS now lets you convert standard curves to Bezier curves.

LEADTOOLS can now resize bitmaps during the load process.

LEADTOOLS can now both compress and decompress buffers.

LEADTOOLS now lets you save bitmaps to files in memory.

LEADTOOLS supports Exif extensions, so you can now retrieve embedded audio data and stamps contained in Exif files as extension data.

Changed or removed functions

The following functions have been changed from the previous version of LEADTOOLS or removed:

L_AllocateBitmap supports a new memory type flag.

L_AnnGetBoundingRect takes 1 new parameter.

L_AnnGetName takes 2 new parameters.

L_AnnGetRect takes 1 new parameter.

L_AnnSave takes 1 new parameter.

L_AnnSaveMemory takes 1 new parameter.

L_AnnSaveOffset takes 1 new parameter.

L_AnnSetName takes 2 new parameters.

L_GetBitmapHistogram takes 1 new parameter and supports 12 and 16-bit grayscale images.

L_GetDefaultLoadFileOption takes 1 new parameter.

L_GetDefaultSaveFileOption takes 1 new parameter.

L_HalftoneBitmap takes 2 new parameters and supports 12 and 16-bit grayscale images.

L_HistoEqualizeBitmap takes 1 new parameter.

L_LoadFile supports a new flag.

L_LoadFileOffset supports a new flag.

L_LoadFileTile supports a new flag.

L_MedianFilterBitmap supports 12 and 16-bit grayscale images.

L_MaxFilterBitmap supports 12 and 16-bit grayscale images.

L_MinFilterBitmap supports 12 and 16-bit grayscale images.

L_RemapBitmapIntensity takes 1 new parameter.

The following functions have been removed:

L_GetBitmapHistogramGray | To get the same functionality, use the L_GetBitmapHistogram function.
L_HalftoneBitmapExt | To get the same functionality, use the L_HalftoneBitmap function.
L_ToggleBitmapCompression | To get the same functionality, use the L_ChangeBitmapCompression function.

Changed structures

The BITMAPHANDLE structure has changed and new functions have been added to allow the user to limit amount of GDI resources LEAD bitmap’s require. This change could cause existing source code to no longer compile. However, this change WILL NOT affect existing applications/binaries. The purpose of this change is to allow users to load many images, without each using up GDI resources by creating an HPALETTE. The former (and default) behavior is that for each image that is loaded from file, an HPALETTE GDI object is created. There is a limited number of GDI objects available and loading a large number of small images can exhaust the GDI memory. In this case, you will get "out of memory" errors, although you have plenty physical or virtual memory available. With these new functions/features, you can avoid this. For information on updating your source code, see the topic Updating Old Code to Use the New Palette Mechanism .

The LOADINFO structure now has 4 new members.

The FILEINFO structure has 1 new member.

The SAVEFILEOPTION structure has 1 new member.

New structures

The following are new structures:

ADDBORDERINFO

ADDFRAMEINFO

ANNFILEINFO

BALANCING

COMPRESSIONOPTIONS (MRC module)

CURVE

DECOMPRESSDATA

EXTENSION

EXTENSIONLIST

LAYERINFO

LILDRAWITEM

MINSEGMENT (MRC module)

SEGMENTDATA (MRC module)

STARTDECOMPRESSDATA

New control messages

The following are new control messages:

L_ILM_DRAWITEM

L_ILM_GETFIRSTVISIBLE

L_ILM_GETVIEWSIZE

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

Markers

ENUMMARKERSCALLBACK

L_CopyMarkers

L_CreateMarkers

L_DeleteMarker

L_EnumMarkers

L_FreeMarkers

L_GetMarker

L_GetMarkerCount

L_GetMarkers

L_InsertMarker

L_LoadMarkers

L_SetMarkers

L_WriteFileMetaData

Bitmap Palette

L_DupBitmapPalette

L_CopyBitmapPalette

L_SetBitmapPalette

Annotations (Document/Medical only)

L_AnnDeletePage

L_AnnDeletePageMemory

L_AnnDeletePageOffset

L_AnnFileInfo

L_AnnFileInfoMemory

L_AnnFileInfoOffset

Decompressing Buffers

L_DecompressBuffer

L_StartDecompressBuffer

L_StopDecompressBuffer

EXIF Extensions

L_FreeExtensions

L_GetExtensionAudio

L_LoadExtensionStamp

L_ReadFileExtensions

Image Processing

L_AddBitmaps

L_AddBorder

L_AddFrame

L_AlphaBlendBitmap

L_AntiAliasBitmap

L_BalanceColors

L_CombineBitmapExt

L_ConvertBitmapSignedToUnsigned

L_ConvertToColoredGray

L_CreateFadedMask

L_EdgeDetectorBitmap

L_FeatherAlphaBlendBitmap

L_GaussianFilterBitmap

L_GetFunctionalLookupTable

L_GetUserLookupTable

L_GrayScaleBitmapExt

L_LineProfile

L_MotionBlurBitmap

L_PicturizeBitmapList

L_PicturizeBitmapSingle

L_RemoveRedeyeBitmap

L_SwapColors

L_UnsharpMaskBitmap

ISIS

L_ISISGetTagASCII

L_ISISGetTagASCIIChoice

L_ISISGetTagLongChoice

L_ISISGetTagShortChoice

L_ISISSetTagASCII

Magnifying Glass

L_WindowHasMagGlass

L_SetMagGlassPaintOptions

L_SetMagGlassPos

L_ShowMagGlass

L_UpdateMagGlassBitmap

Mixed Raster Content Module

L_MrcDeleteSegment

L_MrcEndBitmapSegmentation

L_MrcEnumSegments

L_MrcGetPagesCount

L_MrcLoadBitmap

L_MrcSaveBitmap

L_MrcSaveBitmapT44

L_MrcSegmentBitmap

L_MrcSetNewStripe

L_MrcSetStripeMaxHeight

L_MrcSetStripeSegment

L_MrcStartBitmapSegmentation

L_MrcUpdateSegmentData

MRCENUMSEGMENTSPROC

SEGMENTATIONCALLBACK

PSD Layers

L_LoadLayer

L_SaveBitmapWithLayers

Saving Buffers

L_SaveBitmapBuffer

L_SaveFileBuffer

SAVEBUFFERCALLBACK

Super Compression

L_ChangeBitmapCompression

Transforming Files

L_TransformFile

LEADMARKERCALLBACK

TRANSFORMFILECALLBACK

Miscellaneous

L_CurveToBezier

L_GetBitmapClipSegments

L_GetBitmapClipSegmentsMax

L_GetPixelData

L_LoadBitmapResize

L_PutPixelData

L_ResizeBitmapRgn

L_SetBitmapRgnCurve


Changes from Version 12 to Version 12.1

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

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

Please note that the vector file format support previously provided by the LEADTOOLS File Format Plug ins is now provided through the LEADTOOLS Vector View Plug in. Therefore, the L_SUPPORT_VECTOR_DWG, L_SUPPORT_VECTOR_DWF, L_SUPPORT_VECTOR_DXF, L_SUPPORT_VECTOR_MISC and L_SUPPORT_VECTOR_ALL constants are now obsolete. If these constants are currently in your code, they will continue to work in LEADTOOLS 12.1. However, you should consider adding the LEADTOOLS Vector View Plug in or upgrading to the LEADTOOLS Vector Imaging Pro toolkit.

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

LEADTOOLS now supports ImageList messages for unselecting an item.

LEADTOOLS now supports loading and saving multi-page TIFF files using the ImageList control.

The Thumbnail Browser can now be used to create thumbnails for a single image file.

LEADTOOLS provides a new Deskew function that lets you specify the background color.

LEADTOOLS now supports Magnifying Glass features that let you update the bitmap from another source during the procedure.

LEADTOOLS also provides support for customizing the shape of the Magnifying Glass.

LEADTOOLS now supports File Transfer mode for acquiring images from TWAIN devices.

LEADTOOLS provides new support for changing the hue, saturation and value of images, allowing you to color replace a range of colors.

New functions let you create a region based on an RGB color range or an HSV color range.

LEADTOOLS can now convert between V4 and V5 DIBs.

DICOM now supports Structured IODs.

LEADTOOLS now supports the loading and saving of RAW uncompressed image data.

LEADTOOLS can now convert from JPEG compressed DIBs.

LEADTOOLS can now convert from RLE4 and RLE8 compressed DIBs.

LEADTOOLS provides more support for grouping and ungrouping annotation objects.

LEADTOOLS now provides support for changing the background color of Redact, Push pin, Note and Hilite objects created by an automation object.

LEADTOOLS provides more support for undoing automation operations in automated annotations.

LEADTOOLS can now allocate memory in tiles for supporting very large images.

LEADTOOLS now supports 12 and 16-bit grayscale histograms.

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

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

Changed or removed functions

The following functions have been changed from the previous version of LEADTOOLS or removed:

The L_SetLoadInfoCallback now works for RAW uncompressed data.

The LEADTOOLS Multimedia toolkits currently include many of the functions documented in the Ltnetdlln.chm help file and this manual. This is the final version of the LEADTOOLS Multimedia toolkit that will contain those functions. In future releases, the functions documented in the Ltnetdlln.chm help file will only be available in the LEADTOOLS Internet Imaging toolkits.

Changed structures

The LOADINFO structure now contains an RGBQUAD member and takes new flags. These additions allow this structure to be used with RAW uncompressed data.

The SAVEFILEOPTION structure has a new flag for use with RAW uncompressed data.

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

Annotations (Document/Medical only)

L_AnnAddUndoNode

L_AnnGetAutoBackColor

L_AnnGetAutoUndoEnable

L_AnnGetGrouping

L_AnnSetAutoBackColor

L_AnnSetAutoUndoEnable

L_AnnSetGrouping

DIB

L_ChangeToDIB2

L_ConvertToDIB2

Image Processing

L_DeskewBitmap2

L_GetBitmapHistogramGray

L_HSVtoRGB

L_RemapBitmapHue

L_RGBtoHSV

JPEG 2000 Support

L_GetDefaultJ2KOptions

L_GetJ2KOptions

L_SetJ2KOptions

Magnifying Glass

L_StartMagGlass

L_UpdateMagGlass

L_UpdateMagGlassShape

MAGGLASSCALLBACK

Region Processing

L_SetBitmapRgnColorHSVRange

L_SetBitmapRgnColorRGBRange

Thumbnail Browser

L_CreateThumbnailFromFile

TWAIN

L_TwainAcquireFile

TWAINFILEFORMATCALLBACK

TWAINFILETRANSFERCALLBACK


Changes from Version 11.5 to Version 12

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

The product line in Version 12 has been redesigned. If you are an existing LEADTOOLS customer, please take a moment to familiarize yourself with the new line of products and the new features.

Essentially the changes are as follows:

LEADTOOLS no longer supports 16-bit development environments.

LEADTOOLS Imaging is now LEADTOOLS Raster Imaging.

LEADTOOLS Imaging Pro is now LEADTOOLS Raster Imaging Pro.

LEADTOOLS Vector Imaging Suite is no longer available.

LEADTOOLS Vector Imaging Pro Suite is now LEADTOOLS Vector Imaging Pro. It no longer includes LEADTOOLS Imaging Pro, but provides many more vector features, including automation, container and toolbar capabilities.

LEADTOOLS Document Express is now LEADTOOLS Document Imaging. It no longer includes support for Multimedia and Vector features.

LEADTOOLS Document Express Suite is now LEADTOOLS Document Imaging Suite. It no longer includes support for Multimedia and Vector features. It now includes a "Clean-up" module for improving 1-bit images.

LEADTOOLS Medical Express is now LEADTOOLS Medical Imaging. It no longer includes Multimedia and Vector support.

LEADTOOLS Medical Express Suite is now LEADTOOLS Medical Imaging Suite. It no longer includes Multimedia and Vector support.

Optional Raster plug-ins for vector file format support (DXF, DWG, DRW, PLT, TIFF with DXF, and INTERGRAPH_VECTOR) are now available.

Optional PDF plug-in for PDF file format support (PDF, PS, and EPS) is now available.

New document "Clean-up" features including hole-punch removal, line removal, border removal, invert text, smooth filter, and dot removal. Additionally, region of interest has been enhanced to allow preview of changes and composite viewing of the modified regions.

Optimized memory management, which increases the speed of all LEADTOOLS functions.

Reduced the number of TLS slots (thread local storage) used by LEADTOOLS DLLs. Previous versions of LEADTOOLS used up to 23 TLS slots. LEADTOOLS v12 now uses up to 2 TLS slots.

Added more flavors to most LEADTOOLS 12 file filters.

Redesigned the CCITT G3/G4 compression/decompression engine, resulting in an additional 80% speed increase over version 11.5.

Loading (decompressing) and saving (compressing) JPEG files have been hand-optimized for (MMX, PII and PIII). Most files now compress 100% faster and decompress 50% faster.

TIFF comments have been enhanced.

Loading and saving TIFF files with CMP and JBIG compression are now supported.

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

Loading and saving SGI files has been added.

A New feature that allows you to specify the preferred load format when loading files has been added.

A new Selection Style for the ImageList that lets you mark selected items with a bitmap has been added.

The Picturize algorithm now supports more options.

A new magnifying glass tool for zooming in on an image has been added.

A new magic wand which creates a region from an X, Y location and a color tolerance has been added.

A new region frame with color feature has been added.

Regions can now be displayed with a color "highlight" in addition to an animated frame.

Writing TIFF tags to any page in an existing file is now supported.

Changed functions:

The following functions have changed since version 11.5

L_FileConvert (takes another parameter)

L_LoadBitmap (takes another parameter)

L_LoadBitmapList (takes another parameter)

L_LoadBitmapMemory (takes another parameter)

L_LoadFile (takes another parameter)

L_LoadFileTile (takes another parameter)

L_LoadFileOffset (takes another parameter)

L_LoadMemory (takes another parameter)

L_StartFeedLoad (takes another parameter)

Changed structures:

The following structures have changed since version 11.5

FILEINFO (New members added)

LOADFILEOPTION (New members added)

SAVEFILEOPTION (New members added)

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

L_BorderRemoveBitmap

L_ColorBitmapRgn

L_DotRemoveBitmap

L_GetPDFOptions

L_HolePunchRemoveBitmap

L_InvertedTextBitmap

L_LineRemoveBitmap

L_SetBitmapRgnMagicWand

L_SetPDFOptions

L_SmoothBitmap

L_StartMagGlass

L_StopMagGlass

L_UpdateMagGlassRect

L_WriteFileComment

L_WriteFileTag


Changes from Version 10 to Version 11

Changes from Version 10 to Version 11 (11.5)

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

LEADTOOLS now supports 48-bit and 64-bit bitmaps. 48-bit bitmaps are color bitmaps with 16-bits per each component (R, G and B). 64-bit bitmaps are 48-bit bitmaps with alpha channel information (16-bit alpha value). (11.5) (Medical Express only)

The Netscape Plug-in now installs by clicking on a self-extracting file and provides more image processing. (11.5)

New flags for the L_RotateBitmap function support interpolation while rotating certain images. (11.5)

New flags for the L_SetDisplayMode function support interpolation while painting. (11.5)

DICOM Network Communication for Message Exchange is now supported. (Medical Express Suite only) (11.5)

LEADTOOLS now supports all possible View Perspective values. (11.5)

LEADTOOLS now provides add-on modules for reading and writing bar codes. (11.5) (Add-on to Express toolkits only)

New functions provide fast flip and fast reverse operations by changing the View Perspective. (11.5)

New functions provide a means for resizing images in portions, allowing the resizing of extremely large images. (11.5)

Duplex scanning (scanning both sides of a page) is now supported for those TWAIN scanners that support duplex scanning.

(Express only) Now supports the following new objects:

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_POINT

ANNOBJECT_PROTRACTOR

ANNOBJECT_VIDEO

ANNOBJECT_PUSHPIN

ANNOBJECT_FREEHANDHOTSPOT

(Express only) Annotation Automation menu items are fully customizable.

(Express only) Annotation Automation toolbar is fully customizable.

(Express only) New Annotation file format, ANNFMT_ENCODED provides an encoded native format for better security and smaller file sizes.

The following new formats are supported:

FILE_CLP (11.5)

FILE_XWD10 (11.5)

FILE_XWD11 (11.5)

FILE_ANI (11.5)

FILE_FLC (11.5)

FILE_DRW (11.5)

FILE_CGM (11.5)

FILE_PCT (Vector) (11.5)

FILE_PLT (11.5)

FILE_INTERGRAPH_VECTOR (11.5)

FILE_PBM_ASCII

FILE_PBM_BINARY

FILE_PGM_ASCII

FILE_PGM_BINARY

FILE_PPM_ASCII

FILE_PPM_BINARY

FILE_CUT

FILE_XPM

FILE_XBM

FILE_IFF_ILBM

FILE_IFF_CAT

FILE_INTERGRAPH_RLE

FILE_DICOM_RLE_GRAY

FILE_DICOM_RLE_COLOR

FILE_DICOM_JPEG_GRAY

FILE_DICOM_JPEG_COLOR

FILE_CALS4

FILE_CALS2

FILE_CALS3

FILE_MPEG2

FILE_DXF – can be read as vector or raster, can be saved as vector.

In WIN32, the dialogs now allow the WIN95 standard context sensitive help icon "?" to be added to the title bar.

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 supported images and generate thumbnails.

LEADTOOLS now supports MPEG-2.

LEADTOOLS now supports Pentium 3 optimizations.

Changed or removed functions

The following functions have been changed from the previous version of LEADTOOLS or removed:

(Express only) L_AnnCopyToClipboard (takes an extra parameter)

(Express only) L_AnnCutToClipboard (takes an extra parameter)

(Express only) L_AnnCreateToolbar (takes two new parameters)

(Express only) L_AnnEnumerate (takes one new parameter)

(Express only) L_AnnSetVisible (takes one new parameter)

(Express only) L_AnnGetDistance (takes one new parameter)

The following functions no longer set a global value, but instead work on a per-bitmap basis:

L_GetPaintContrast

L_GetPaintGamma

L_GetPaintIntensity

L_SetPaintContrast

L_SetPaintGamma

L_SetPaintIntensity

{bmc sqrblit.bmp The LTCOMMDLGHELPCB callback function now takes two new parameters, the control ID for context sensitive help, and a pointer to user-defined data.

The following functions now take one extra parameter, a pointer to user data for the help callback:

L_DlgFileOpen

L_DlgGetAngle

L_DlgGetSize

L_DlgGetFilter

L_DlgGetChange

L_DlgGetGamma

L_DlgGetNoise

L_DlgGetEmboss

L_DlgGetRange

L_DlgColorRes

L_DlgFileSave

L_DlgWindowLevel

L_DlgGetEffect

L_DlgGetShape

L_DlgGetText

L_DlgGetGradient

L_DlgGetTransition

L_DlgGetDirectory

L_DlgFileSave uFormatFlags has been replaced by two new parameters.

The EXTFILEOPTION structure has been removed, along with L_GetExtFileOption and L_SetExtFileOption, which set global settings for the toolkit. Now, the following functions take an optional LOADFILEOPTION structure:

L_AnnLoad

L_AnnLoadOffset

L_AnnLoadMemory

L_DecompressBitmapMemory

L_DecompressMemory

L_ReadLoadResolutions

L_ReadFileTransforms

L_FileInfo

L_FileInfoMemory

L_GetCompressFileStamp

L_GetLoadResolution

L_GetFileCommentSize

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileTile

L_LoadFileOffset

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentExt

L_ReadFileCommentMemory

L_ReadFileTag

L_ReadFileTagMemory

L_ReadFileStamp

L_StartFeedLoad

L_FileConvert

And the following functions take an optional SAVEFILEOPTION structure:

L_FileConvert

L_CompressBitmapWithStamp

L_DeletePage

L_WriteFileTransforms

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveFile

L_SaveFileMemory

L_SaveFileTile

L_SaveFileOffset

L_StartCompressBuffer

L_WriteFileCommentExt

L_WriteFileStamp

The LOADINFOCALLBACK function now takes an extra pointer to user-defined data parameter, as does L_SetLoadInfoCallback.

L_CompressBitmapWithStamp has been removed, you can use L_SaveFile instead.

L_DecompressBitmapMemory and L_DecompressMemory have been removed, you can use L_LoadBitmapMemory instead.

L_SetDimension has been renamed to L_SetLoadResolution. (The parameters are all the same).

L_GetDimension has been renamed to L_GetLoadResolution. (The parameters are all the same).

L_EnumDimensions has been renamed to L_ReadLoadResolutions. (The parameters are the same).

The STATUSCALLBACK function now takes an extra pointer to user-defined data parameter, as does L_SetStatusCallback.

L_RedirectIO now takes an extra pointer to user-defined data parameter, as do the following callbacks:

REDIRECTOPEN

REDIRECTREAD

REDIRECTWRITE

REDIRECTSEEK

REDIRECTCLOSE

L_ColorResBitmap and L_ColorResBitmapList now take an optional hPalette parameter for using a Windows Logical palette.

L_CreateBitmap now allows the user to allocate the memory for the bitmap by taking two new parameters.

L_ResampleBitmap was removed. Now, L_SizeBitmap takes the following flags:

SIZE_NORMAL

SIZE_FAVORBLACK

SIZE_RESAMPLE

SIZE_BICUBIC

L_RotateBitmapFine has been removed, now L_RotateBitmap takes one extra parameter.

Changed structures

The size of the TWAINPROPERTIES member dwReserved is now based on whether WIN32 is defined. (11.5)

The RGNXFORM structure uViewPerspective member now includes flags for all the View Perspective values. (11.5)

The LOADINFO Flags member now includes flags for all the supported View Perspective values. (11.5)

The nFormat and uSubFormats members of the FILESAVEFORMAT structure include flags to support 48- and 64-bit TIFF files. (11.5)

The EXTFILEOPTION structure has been removed, and has been replaced by the LOADFILEOPTION structure and the SAVEFILEOPTION structure.

The FILESAVEPARM structure has one new member, nSubTypeIndex, used for getting/setting the index of the sub-type listbox.

The following members have been added to the BITMAPHANDLE structure:

L_UINT PaintGamma; /* Paint gamma value to be used during painting */

L_INT PaintContrast; /* Paint contrast value to be used during painting */

L_INT PaintIntensity; /* Paint intensity value to be used during painting */

L_UCHAR L_FAR*pPaintLUT; /* Paint LUT generated from PaintIntensity, PaintGamma, PaintIntensity */

L_UINT32 Reserved; /* reserved field, do not use */

The TWAINPROPERTIES structure now has four new members:

lSize

nDuplex

nEnableDuplex

dwReserved

The LEADBITMAPLOAD structure now has one new member:

pLOADFILEOPTION pOptions;

The LEADBITMAPSAVE structure now has one new member:

pSAVEFILEOPTION pOptions;

The COMPRESSIONOPTS structure has added the following members (refer to Ltviddlln.chm):

L_BOOL Constrained;

L_BOOL FieldPic;

L_INT FrameRate;

L_INT FramesGOP;

L_INT PelAspectRatio;

L_INT ProfileID;

L_INT LevelID;

L_INT ChromaFormat;

L_INT VideoFormat;

L_INT IntraDcPrec;

L_INT32 BitRate;

Removed structures

The EXTFILEOPTION structure has been removed, and has been replaced by the LOADFILEOPTION structure and the SAVEFILEOPTION structure.

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

Annotations (Express only)

L_AnnSetNodes

L_AnnGetNodes

L_AnnSetProtractorOptions

L_AnnGetProtractorOptions

L_AnnSetName

L_AnnGetName

L_AnnSetShowFlags

L_AnnGetShowFlags

L_AnnGetAngle

L_AnnSetMetafile

L_AnnGetMetafile

L_AnnSetPredefinedMetafile

L_AnnGetPredefinedMetafile

L_AnnSetSecondaryBitmap

L_AnnGetSecondaryBitmap

L_AnnSetAutoMenuItemEnable

L_AnnGetAutoMenuItemEnable

L_AnnSetAutoMenuState

L_AnnGetAutoMenuState

L_AnnSetUser

L_AnnSetToolBarButtons

L_AnnGetToolBarButtons

L_AnnFreeToolBarButtons

L_AnnGetToolBarInfo

L_AnnSetToolBarColumns

L_AnnSetToolBarRows

L_AnnSetAutoDefaults

L_AnnSetTransparentColor

L_AnnGetTransparentColor

L_AnnGetUndoDepth

L_AnnGroup

L_AnnUngroup

L_AnnSetAutoOptions

L_AnnGetAutoOptions

L_AnnGetObjectFromTag

L_AnnGetRgnHandle

L_AnnGetArea

BarCode (11.5) (Add-on to Express toolkits only)

L_BarCodeFree (Refer to Ltbardlln.chm)

L_BarCodeGetDuplicated (Refer to Ltbardlln.chm)

L_BarCodeGetNextDuplicated (Refer to Ltbardlln.chm)

L_BarCodeIsDuplicated (Refer to Ltbardlln.chm)

L_BarCodeRead (Refer to Ltbardlln.chm)

L_BarCodeWrite (Refer to Ltbardlln.chm)

L_BarCodeVersionInfo (Refer to Ltbardlln.chm)

DICOM File Format Control

L_DicomDeleteKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomFindFirstKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomFindLastKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomFindNextKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomFindPrevKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetChildKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetFirstKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetLastKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetNextKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetParentKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetPrevKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetRootKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomGetValueKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomInsertKey (Refer to Ltdicdlln.chm) (11.5)

L_DicomIsVolatileElement (Refer to Ltdicdlln.chm)

DICOM Communication Control (11.5)

L_DicomAccept (Refer to Ltdicdlln.chm)

L_DicomAddPresentation (Refer to Ltdicdlln.chm)

L_DicomAddTransfer (Refer to Ltdicdlln.chm)

L_DicomAddUserInfo (Refer to Ltdicdlln.chm)

L_DicomClose (Refer to Ltdicdlln.chm)

L_DicomConnect (Refer to Ltdicdlln.chm)

L_DicomCopyDS (Refer to Ltdicdlln.chm)

L_DicomCreateAssociate (Refer to Ltdicdlln.chm)

L_DicomCreateNet (Refer to Ltdicdlln.chm)

L_DicomDefaultAssociate (Refer to Ltdicdlln.chm)

L_DicomDelPresentation (Refer to Ltdicdlln.chm)

L_DicomDelTransfer (Refer to Ltdicdlln.chm)

L_DicomDelUserInfo (Refer to Ltdicdlln.chm)

L_DicomFindAbstract (Refer to Ltdicdlln.chm)

L_DicomFreeAssociate (Refer to Ltdicdlln.chm)

L_DicomFreeNet (Refer to Ltdicdlln.chm)

L_DicomGetAbstract (Refer to Ltdicdlln.chm)

L_DicomGetApplication (Refer to Ltdicdlln.chm)

L_DicomGetAssociate (Refer to Ltdicdlln.chm)

L_DicomGetCalled (Refer to Ltdicdlln.chm)

L_DicomGetCalling (Refer to Ltdicdlln.chm)

L_DicomGetClient (Refer to Ltdicdlln.chm)

L_DicomGetClientCount (Refer to Ltdicdlln.chm)

L_DicomGetDataUserInfo (Refer to Ltdicdlln.chm)

L_DicomGetExtended (Refer to Ltdicdlln.chm)

L_DicomGetHostInfo (Refer to Ltdicdlln.chm)

L_DicomGetImplementClass (Refer to Ltdicdlln.chm)

L_DicomGetImplementVersion (Refer to Ltdicdlln.chm)

L_DicomGetInfoCS (Refer to Ltdicdlln.chm)

L_DicomGetInvokedOperations (Refer to Ltdicdlln.chm)

L_DicomGetLengthExtended (Refer to Ltdicdlln.chm)

L_DicomGetLengthUserInfo (Refer to Ltdicdlln.chm)

L_DicomGetMaxLength (Refer to Ltdicdlln.chm)

L_DicomGetPeerInfo (Refer to Ltdicdlln.chm)

L_DicomGetPerformedOperations (Refer to Ltdicdlln.chm)

L_DicomGetPresentation (Refer to Ltdicdlln.chm)

L_DicomGetPresentationCount (Refer to Ltdicdlln.chm)

L_DicomGetProviderRole (Refer to Ltdicdlln.chm)

L_DicomGetQueueSend (Refer to Ltdicdlln.chm)

L_DicomGetResult (Refer to Ltdicdlln.chm)

L_DicomGetServer (Refer to Ltdicdlln.chm)

L_DicomGetTransfer (Refer to Ltdicdlln.chm)

L_DicomGetTransferCount (Refer to Ltdicdlln.chm)

L_DicomGetTypeUserInfo (Refer to Ltdicdlln.chm)

L_DicomGetUserInfoCount (Refer to Ltdicdlln.chm)

L_DicomGetUserRole (Refer to Ltdicdlln.chm)

L_DicomGetVersion (Refer to Ltdicdlln.chm)

L_DicomInitCS (Refer to Ltdicdlln.chm)

L_DicomIsActivated (Refer to Ltdicdlln.chm)

L_DicomIsAssociated (Refer to Ltdicdlln.chm)

L_DicomIsAsyncOperations (Refer to Ltdicdlln.chm)

L_DicomIsConnected (Refer to Ltdicdlln.chm)

L_DicomIsImplementClass (Refer to Ltdicdlln.chm)

L_DicomIsImplementVersion (Refer to Ltdicdlln.chm)

L_DicomIsMaxLength (Refer to Ltdicdlln.chm)

L_DicomIsRequest (Refer to Ltdicdlln.chm)

L_DicomIsRoleSelect (Refer to Ltdicdlln.chm)

L_DicomListen (Refer to Ltdicdlln.chm)

L_DicomResetAssociate (Refer to Ltdicdlln.chm)

L_DicomSendAbort (Refer to Ltdicdlln.chm)

L_DicomSendAssociateAccept (Refer to Ltdicdlln.chm)

L_DicomSendAssociateReject (Refer to Ltdicdlln.chm)

L_DicomSendAssociateRequest (Refer to Ltdicdlln.chm)

L_DicomSendData (Refer to Ltdicdlln.chm)

L_DicomSendReleaseRequest (Refer to Ltdicdlln.chm)

L_DicomSendReleaseResponse (Refer to Ltdicdlln.chm)

L_DicomSetAbstract (Refer to Ltdicdlln.chm)

L_DicomSetApplication (Refer to Ltdicdlln.chm)

L_DicomSetAsyncOperations (Refer to Ltdicdlln.chm)

L_DicomSetCallback (Refer to Ltdicdlln.chm)

L_DicomSetCalled (Refer to Ltdicdlln.chm)

L_DicomSetCalling (Refer to Ltdicdlln.chm)

L_DicomSetDebugDS (Refer to Ltdicdlln.chm)

L_DicomSetExtended (Refer to Ltdicdlln.chm)

L_DicomSetImplementClass (Refer to Ltdicdlln.chm)

L_DicomSetImplementVersion (Refer to Ltdicdlln.chm)

L_DicomSetMaxLength (Refer to Ltdicdlln.chm)

L_DicomSetPresentation (Refer to Ltdicdlln.chm)

L_DicomSetRequest (Refer to Ltdicdlln.chm)

L_DicomSetResult (Refer to Ltdicdlln.chm)

L_DicomSetRoleSelect (Refer to Ltdicdlln.chm)

L_DicomSetTransfer (Refer to Ltdicdlln.chm)

L_DicomSetUserInfo (Refer to Ltdicdlln.chm)

L_DicomSetVersion (Refer to Ltdicdlln.chm)

L_DicomShutDown (Refer to Ltdicdlln.chm)

L_DicomStartUp (Refer to Ltdicdlln.chm)

ACCEPTCALLBACK (Refer to Ltdicdlln.chm)

CLOSECALLBACK (Refer to Ltdicdlln.chm)

CONNECTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVEABORTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVEASSOCIATEACCEPTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVEASSOCIATEREJECTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVEASSOCIATEREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECALLBACK (Refer to Ltdicdlln.chm)

RECEIVECCANCELREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECECHOREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECECHORESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVECFINDREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECFINDRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVECGETREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECGETRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVECMOVEREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECMOVERESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVECSTOREREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVECSTORERESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVEDATACALLBACK (Refer to Ltdicdlln.chm)

RECEIVENACTIONREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENACTIONRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVENCREATEREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENCREATERESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVENDELETEREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENDELETERESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVENGETREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENGETRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVENREPORTREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENREPORTRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVENSETREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVENSETRESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVERELEASEREQUESTCALLBACK (Refer to Ltdicdlln.chm)

RECEIVERELEASERESPONSECALLBACK (Refer to Ltdicdlln.chm)

RECEIVEUNKNOWNCALLBACK (Refer to Ltdicdlln.chm)

SENDCALLBACK (Refer to Ltdicdlln.chm)

Display

( Express only) L_WindowLevelFillLUT

Conversion

L_ConvertFromWMF

L_ChangeFromWMF

L_ConvertToWMF

L_ChangeToWMF

L_ConvertFromEMF

L_ChangeFromEMF

L_ConvertToEMF

L_ChangeToEMF

Dialogs

L_DlgContourFilter

L_DlgGetStringLen

L_DlgGetString

L_DlgSetString

L_DlgSetFont

ImageList

L_CreateImageListControl

L_UseImageListControl

Load and Save Options

L_GetDefaultLoadFileOption

L_GetDefaultSaveFileOption

Thumbnail Browser

L_BrowseDir

BROWSEDIRCALLBACK function

Vector File Format Support

L_2DSetViewport

L_2DGetViewport

L_2DSetViewMode

L_2DGetViewMode

L_VecApplyTransformation (refer to Ltvecdlln.chm)

L_VecAttachToWindow (refer to Ltvecdlln.chm)

L_VecConvertFromEMF (refer to Ltvecdlln.chm)

L_VecConvertFromWMF (refer to Ltvecdlln.chm)

L_VecConvertToEMF (refer to Ltvecdlln.chm)

L_VecConvertToWMF (refer to Ltvecdlln.chm)

L_VecCopy (refer to Ltvecdlln.chm)

L_VecDeleteObjects (refer to Ltvecdlln.chm)

L_VecDlg3DOptions (refer to Ltvecdlln.chm)

L_VecDlgCamera (refer to Ltvecdlln.chm)

L_VecDlgRotate (refer to Ltvecdlln.chm)

L_VecDlgScale (refer to Ltvecdlln.chm)

L_VecDlgTranslate (refer to Ltvecdlln.chm)

L_VecEnumObjects (refer to Ltvecdlln.chm)

L_VecEnumVertices (refer to Ltvecdlln.chm)

L_VecFree (refer to Ltvecdlln.chm)

L_VecGetAmbientLight (refer to Ltvecdlln.chm)

L_VecGetBackgroundColor (refer to Ltvecdlln.chm)

L_VecGetBindVerticesMode (refer to Ltvecdlln.chm)

L_VecGetCamera (refer to Ltvecdlln.chm)

L_VecGetEngine (refer to Ltvecdlln.chm)

L_VecGetObjectParallelogram (refer to Ltvecdlln.chm)

L_VecGetObjectRect (refer to Ltvecdlln.chm)

L_VecGetPalette (refer to Ltvecdlln.chm)

L_VecGetPan (refer to Ltvecdlln.chm)

L_VecGetPolygonMode (refer to Ltvecdlln.chm)

L_VecGetRotation (refer to Ltvecdlln.chm)

L_VecGetScale (refer to Ltvecdlln.chm)

L_VecGetTranslation (refer to Ltvecdlln.chm)

L_VecGetUseLights (refer to Ltvecdlln.chm)

L_VecGetViewMode (refer to Ltvecdlln.chm)

L_VecGetViewport (refer to Ltvecdlln.chm)

L_VecHitTest (refer to Ltvecdlln.chm)

L_VecInit (refer to Ltvecdlln.chm)

L_VecIs3D (refer to Ltvecdlln.chm)

L_VecIsObjectInsideParallelogram (refer to Ltvecdlln.chm)

L_VecIsObjectInsideRect (refer to Ltvecdlln.chm)

L_VecIsObjectSelected (refer to Ltvecdlln.chm)

L_VecLoadFile (refer to Ltvecdlln.chm)

L_VecLoadMemory (refer to Ltvecdlln.chm)

L_VecLogicalToPhysical (refer to Ltvecdlln.chm)

L_VecPaint (refer to Ltvecdlln.chm)

L_VecRealize (refer to Ltvecdlln.chm)

L_VecSaveFile (refer to Ltvecdlln.chm)

L_VecSaveMemory (refer to Ltvecdlln.chm)

L_VecSelectObject (refer to Ltvecdlln.chm)

L_VecSetAmbientLight (refer to Ltvecdlln.chm)

L_VecSetBackgroundColor (refer to Ltvecdlln.chm)

L_VecSetBindVerticesMode (refer to Ltvecdlln.chm)

L_VecSetCamera (refer to Ltvecdlln.chm)

L_VecSetEngine (refer to Ltvecdlln.chm)

L_VecSetPalette (refer to Ltvecdlln.chm)

L_VecSetPan (refer to Ltvecdlln.chm)

L_VecSetPolygonMode (refer to Ltvecdlln.chm)

L_VecSetRotation (refer to Ltvecdlln.chm)

L_VecSetScale (refer to Ltvecdlln.chm)

L_VecSetTranslation (refer to Ltvecdlln.chm)

L_VecSetUseLights (refer to Ltvecdlln.chm)

L_VecSetViewMode (refer to Ltvecdlln.chm)

L_VecSetViewport (refer to Ltvecdlln.chm)

Miscellaneous

L_StartResizeBitmap (11.5)

L_GetResizedRowCol (11.5)

L_StopResizeBitmap (11.5)

RESIZECALLBACK (11.5)

L_MoveBitmapListItems (11.5)

L_FlipBitmapViewPerspective (11.5)

L_ReverseBitmapViewPerspective (11.5)

( Express only) L_ContourFilterBitmap

L_GetStatusCallback

L_SetBitmapDataPointer

L_ToggleBitmapCompression

L_BrowseDir


Changes from Version 9.0 to Version 10

The product line in Version 10 has been redesigned. If you are an existing LEADTOOLS customer, please take a moment to familiarize yourself with the new line of products and the new features.

Essentially the changes are as follows:

VBX Pro, ActiveX32 Pro, ActiveX16 Pro, WIN16 Pro, and WIN32 Pro are gone.

ActiveX16/32 Pro is now LEADTOOLS Imaging and includes C, C++, and MFC documentation.

WIN16/32 Pro is now LEADTOOLS Imaging Pro.

The Video module is no longer available as an add-on. LEAD's Multimedia support is included in the following new products: LEADTOOLS Multimedia, LEADTOOLS Multimedia Pro, LEADTOOLS Document Express, LEADTOOLS Document Express Suite and LEADTOOLS Medical Express.

The Pro-Express document imaging features, annotations, bitonal display filters, fast rotation, ISIS® support and faster compression and decompression are included in all Express editions.

The OCR Module is no longer available. LEAD's OCR support is only in the LEADTOOLS Document Express Suite toolkit.

LEADTOOLS Medical Express contains all of the features present in the Express editions, plus DICOM, 12 and 16 bit grayscale, and window leveling support.

Version 10 of the LEADTOOLS API has changed from version 9.0 as follows:

Loading WMF files at the resolution present in the file is now supported.

Saving WMF files at the current resolution is now supported.

Loading and saving JBIG is now supported. (Saving is only available in the JBIG Module.)

Updated the manner in which L_AnnHitTest will test for the following objects:

Line Annotation Object

Polyline Annotation Object

Freehand Line Annotation Object

Rectangle Annotation Object

Ellipse Annotation Object

Polygon Annotation Object

Pointer Annotation Object

Ruler Annotation Object

For objects that have an interior (ex. Rectangle, Ellipse), if the fill mode is transparent and the fill style is solid, the object will only be selected if the user clicks on the border of the object. If the fill mode is anything other than transparent, the object can be selected by clicking on its interior or on its borders.

This will allow the user to select an annotation object that is beneath another object, without having to change the enumeration order.

Added Grouping and Ungrouping of annotation objects. This allows the user to treat several annotation objects as a single object. Objects must then be ungrouped to be treated as individual objects.

Added the ability to remove menu items from the Annotation Automation menu by setting the menu item text to an empty string using L_AnnSetAutoText.

Minimized flicker effect for annotation object display.

Users can no longer create objects outside the root container.

Users can no longer move objects outside the root container

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled. For a list of available effects, refer to Effect Text Style Flags and Effect Text Alignment Flags.

Loading and saving Lossless JPEG is now supported.

Loading and saving Lossless JTIF is now supported.

Loading and saving 12-bit Lossy JPEG is now supported.

Loading and saving 12-bit Lossy JTIF is now supported.

Saving 12-bit uncompressed TIFF is now supported.

Loading and saving EMF files is now supported.

Optimized code takes advantage of the MMX processors to load CMP, JPEG, and JTIF files 40% faster.

LEADTOOLS will now only load fax files if you provide a LOADINFOCALLBACK function by calling L_SetLoadInfoCallback. To have LEADTOOLS automatically recognize the width and height of the fax file, set LOADINFO.Width and LOADINFO.Height to -1.

Special Effects have expanded to include a choice of over 2000 paint effects, 36 gradients, 80 shapes, 12 3-D text styles, 64 dissolves, and 43 transition effects, with delays, grain sizes, pattern brushes and a colored wand.

2018 Effects are now supported. For the full list, refer to Effects.

80 Shapes are now supported. For a full list, refer to Shapes.

36 Gradients are now supported. For a full list, refer to Gradients.

43 Transitions are now supported. For a full list, refer to Transition Filling Styles.

12 Text Styles are now supported. For a full list, refer to Effect Text Style Flags and Effect Text Alignment Flags.

Imaging Common Dialogs have been expanded to include imaging dialogs for Paint Effect, Transition, Gradient, 3D Text and 3D Shape.

Added File Format Support includes the new Fuji Exif version 2.0, multi-page TIFF enhancements (delete, insert, replace, and add with enhanced speed). LEAD continues to deliver the most comprehensive file format support by expanding the number of flavors and variants supported in the following file formats: PICT, JPEG, GIF, WINFAX, PCX, CALS, AWD, FlashPix, DICOM, EPS, PSD, and PNG.

New PanWindow functions gives you the ability to view a small rectangular section of a large image in magnified detail. By clicking inside the pan window you can move the mouse and pan the image in the main window. While scrolling the image in the main window, the pan rectangle will move to indicate the current displayed area.

You can now delete individual pages from a multi-page file and insert or replace a page in a multi-page file.

You can replace an image with a new image generated using a picturized algorithm – an image processing feature that allows you to create one picture from thousands of separate images. Automatically chooses (based on closest color values) and resizes the images and shows the processing progress. Allows for customization of cell sizes. This feature lets user’s create a wide array of exciting new eye-catching images. The more pictures you have to choose from, the better the resulting image.

Screen Capture capabilities becomes the 15th imaging technology category found in LEADTOOLS. New capture functions allow you to capture all or part of the screen into a bitmap. Capture the entire screen, active window, menu under cursor, window under cursor (button, tool bar, icon, or client area), selected object, mouse cursor or wallpaper. Allows for capture of a selected area of the screen in a wide array of shapes such as rectangle, rounded rectangle, ellipse, polygon or freehand. Icon, bitmap and cursor resources can be captured from 32-bit Windows EXE and DLL files. Options include Multi-capture with callback, Hot Keys, and time interval. Great for presentation and application documentation.

Improved ISIS® support. A new function allows you to display an ISIS settings dialog without scanning.

[Medical Express only] Improved TWAIN scanning to support 16-bit grayscale images is now provided.

Automatic recognition of some Group 3 - 1D and Group 3 - 2D raw fax files is now provided.

Many of the 60+ Image Processing functions have been fine tuned to deliver increased speed and accuracy.

The OCR has been enhanced to include the ability to return the recognized character and its location in the document during the recognition process.

Changed functions

The following functions have changed from the previous version of LEADTOOLS:

L_EnumDimensions (supports JBIG files)

L_GetDimension (supports JBIG files)

L_SetDimension (supports JBIG files)

L_FileInfo (takes an extra parameter)

L_FileInfoMemory (takes an extra parameter)

L_FillBitmap (supports 16-bit grayscale COLORREF values in Medical Express editions only)

L_GetPixelColor (supports 16-bit grayscale COLORREF values in Medical Express editions only)

L_PutPixelColor (supports 16-bit grayscale COLORREF values in Medical Express editions only)

L_ISISAcquireMulti (takes a new flag)

ISISCALLBACK (takes an extra parameter, the bitmap)

Changed structures

The following structures have been changed to support new features:

FILEINFO has a new field for total pages.

EXTFILEOPTION has the following new flags:

EFO_REPLACEPAGE

EFO_INSERTPAGE

EFO_JPEGSTAMP

FILESAVEPARM has had a parameter changed:

L_BOOL bSaveMulti has been changed to L_UINT uSaveMulti.

New error messages

The following constants for error messages have been added:

New constant

ERROR_JBIG_NOT_ENABLED | /* JBIG capability required to use this function */
ERROR_PAGE_NOT_FOUND | /* Page not found. */
ERROR_DELETE_LAST_PAGE | /* You cannot delete a page from a file having only one page. */
ERROR_PANWINDOW_NOT_CREATED | /* PanWindow was not created. */
ERROR_NO_HOTKEY | /* There is no hotkey */
ERROR_CANNOT_CREATE_HOTKEY_WINDOW | /* Error creating the hotkey window */
ERROR_MEDICAL_NOT_ENABLED | /* Medical Express capability is required to use this function */
ERROR_CAPTURE_STILL_IN_PROCESS | /* capture is still in progress */
ERROR_INVALID_DELAY | /* the user passed an invalid delay value */
ERROR_INVALID_COUNT | /* the user passed an invalid capture count */
ERROR_INVALID_INTERVAL | /* the user passed an invalid interval value */
ERROR_HOTKEY_CONFILCTS_WITH_CANCELKEY | /* the user specified the hotkey to be the same as the cancel key */
ERROR_CAPTURE_INVALID_AREA_TYPE | /* wrong area type passed to L_CaptureArea() */
ERROR_CAPTURE_NO_OPTION_STRUCTURE | /* invalid options structure pointer */
ERROR_CAPTURE_INVALID_FILL_PATTERN | /* invalid fill pattern */
ERROR_CAPTURE_INVALID_LINE_STYLE | /* invalid line style */
ERROR_CAPTURE_INVALID_INFOWND_POS | /* invalid position for the info window */
ERROR_CAPTURE_INVALID_INFOWND_SIZE | /* invalid size for the info window */
ERROR_CAPTURE_ZERO_AREA_SIZE | /* capture area is equal to zero */
ERROR_CAPTURE_FILE_ACCESS_FAILED | /* The specified filename couldn't be read */
ERROR_CAPTURE_INVALID_32BIT_EXE_OR_DLL | /* The specified filename is not a valid 32bit EXE/DLL */
ERROR_CAPTURE_INVALID_RESOURCE_TYPE | /* The specified resource type is not supported */
ERROR_CAPTURE_INVALID_RESOURCE_INDEX | /* The index resource is out of range */
ERROR_CAPTURE_NO_ACTIVE_WINDOW | /* no active window */
ERROR_CAPTURE_CANNOT_CAPTURE_WINDOW | /* cannot capture window */
ERROR_CAPTURE_STRING_ID_NOT_DEFINED | /* undefined string ID */
ERROR_CAPTURE_DELAY_LESS_THAN_ZERO | /* delay must be at least zero */
ERROR_CAPTURE_NO_MENU | /* no menu to capture */

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

JBIG Support

L_GetSaveResolution

L_SetSaveResolution

Imaging Common Dialogs:

L_DlgGetEffect

L_DlgGetGradient

L_DlgGetShape

L_DlgGetText

L_DlgGetTransition

L_DlgGetDirectory

PanWindow:

L_CreatePanWindow

L_DestroyPanWindow

L_UpdatePanWindow

PANWNDCALLBACK

Screen Capture:

L_CaptureActiveClient (refer to Ltscrdlln.chm)

L_CaptureActiveWindow (refer to Ltscrdlln.chm)

L_CaptureArea (refer to Ltscrdlln.chm)

L_CaptureAreaOptionDlg (refer to Ltscrdlln.chm)

L_CaptureFromEXE (refer to Ltscrdlln.chm)

L_CaptureFromEXEDlg (refer to Ltscrdlln.chm)

L_CaptureFullScreen (refer to Ltscrdlln.chm)

L_CaptureGetResCount (refer to Ltscrdlln.chm)

L_CaptureMenuUnderCursor (refer to Ltscrdlln.chm)

L_CaptureMouseCursor (refer to Ltscrdlln.chm)

L_CaptureSelectedObject (refer to Ltscrdlln.chm)

L_CaptureSetHotKeyCallback (refer to Ltscrdlln.chm)

L_CaptureWallPaper (refer to Ltscrdlln.chm)

L_CaptureWindowUnderCursor (refer to Ltscrdlln.chm)

L_GetCaptureOption (refer to Ltscrdlln.chm)

L_GetDefaultAreaOption (refer to Ltscrdlln.chm)

L_GetDefaultObjectOption (refer to Ltscrdlln.chm)

L_IsCaptureActive (refer to Ltscrdlln.chm)

L_SetCaptureOption (refer to Ltscrdlln.chm)

L_SetCaptureOptionDlg (refer to Ltscrdlln.chm)

L_StopCapture (refer to Ltscrdlln.chm)

LEADCAPTUREOPTION (refer to Ltscrdlln.chm)

LEADCAPTUREINFO (refer to Ltscrdlln.chm)

LEADCAPTUREAREAOPTION (refer to Ltscrdlln.chm)

LEADCAPTUREOBJECTOPTION (refer to Ltscrdlln.chm)

CAPTURECALLBACK Function (refer to Ltscrdlln.chm)

CAPTUREHOTKEYCALLBACK Function (refer to Ltscrdlln.chm)

Miscellaneous:

L_DeletePage

L_PicturizeBitmap

L_ISISSetScanOptions

L_SaveFileMemory


Changes from Version 8.0 to Version 9.0

Version 9.0 of the LEADTOOLS API has changed from version 8.0 as follows:

LTKRN90N.DLL and LTKRN90W.DLL have each been split in two. The new DLLs are LTKRN90N.DLL and LTDIS90N.DLL, and LTKRN90W.DLL and LTDIS90W.DLL. All programs that display images will have to use the appropriate LTDIS90 .DLL file in their projects.

Reusable dialogs for the most common LEADTOOLS imaging functions are now provided.

- FileOpen and FileSave dialogs have been extended to contain LEADTOOLS specific options.

- A Thumbnail Preview option for FileOpen dialog allows the end user to preview images before loading them.

- A Thumbnail Preview option for the image processing dialogs allows the end user to preview the proposed change to the image, before actually affecting the original image.

- An optional Help Button callback function lets you provide custom help information for each dialog.

- A user interface control for the dialogs is provided through flags passed to each dialog function.

- An option to have the Imaging Common Dialog process the image automatically is provided.

Now you have more control over the loading and caching of the file filter DLLs.

Now you save more than one custom TIFF tag.

Now you can load only a specified portion of an image file.

[Express editions] Support for ISIS scanning has been added.

[Express editions only] New functions allow you to hyperlink annotations. Annotations may be hyperlinked to run a program, access a Web page, or send a user defined message.

[Express editions only] New annotation functions allow you to add security to annotation objects.

[Express editions only] New annotation functions allow you to create hilite objects.

[Express editions only] New annotation functions allow you to set bitmap stamps to be transparent.

[Express editions only] Support for 12 and 16-bit grayscale images is included.

[Express editions only] New window leveling functions for 12 and 16-bit grayscale allow you to map grayscale intensities by specifying the bit range and/or a user defined color map. It is valid only for 12 and 16-bit grayscale images.

[Express editions only] Support for annotations in a TIFF tag is included.

[Express editions only] The automated mode for annotation lets you move individual points in a polygon or a polyline.

Changed functions

The following functions have changed from the previous version of LEADTOOLS:

L_AnnLoad (will load annotations from LEAD files or TIF files)

L_AnnRealize ( redact object background is now saved in the object)

L_AnnSaveMemory (new format options)

L_SetTag (added tag option)

L_ColorResBitmap (new flag option)

L_LoadBitmap (now supports 12 and 16-bit grayscale images Express editions only)

L_LoadBitmapList (now supports 12 and 16-bit grayscale images Express editions only)

L_LoadBitmapMemory (now supports 12 and 16-bit grayscale images Express editions only)

L_LoadFile (now supports 12 and 16-bit grayscale images Express editions only)

L_LoadFileOffset (now supports 12 and 16-bit grayscale images Express editions only)

L_LoadFileTile (FlashPix Module) (supports all formats, not just FlashPix; now supports 12 and 16-bit grayscale images Express editions only)

L_LoadMemory (now supports 12 and 16-bit grayscale images Express editions only)

L_InitBitmap (now supports 12 and 16-bit grayscale images Express editions only)

L_ConvertBuffer (now supports 12 and 16-bit grayscale images Express editions only)

L_CreateBitmap (now supports 12 and 16-bit grayscale images Express editions only)

L_GetBitmapRow (now supports 12 and 16-bit grayscale images Express editions only)

L_GetBitmapRowCol (now supports 12 and 16-bit grayscale images Express editions only)

L_SaveBitmap (now supports 12 and 16-bit grayscale images Express editions only)

L_SaveBitmapMemory (now supports 12 and 16-bit grayscale images Express editions only)

L_SaveFile (now supports 12 and 16-bit grayscale images Express editions only)

L_StartFeedLoad (now supports 12 and 16-bit grayscale images Express editions only)

Relocated functions:

The following functions have been moved to ltdis.h:

L_AppendPlayback

L_BitmapHasRgn

L_CancelPlaybackWait

L_ChangeFromDDB

L_ChangeToDDB

L_ClearPlaybackUpdateRect

L_ClipboardReady

L_ConvertColorSpace

L_ConvertFromDDB

L_ConvertToDDB

L_CopyFromClipboard

L_CopyToClipboard

L_CopyToClipboardExt

L_CreatePaintPalette

L_CreateMaskFromBitmapRgn

L_CreatePlayback

L_DestroyPlayback

L_FrameBitmapRgn

L_FreeBitmapRgn

L_GetBitmapRgnArea

L_GetBitmapRgnBounds

L_GetBitmapRgnHandle

L_GetDisplayMode

L_GetPaintContrast

L_GetPaintGamma

L_GetPaintIntensity

L_GetPlaybackDelay

L_GetPlaybackIndex

L_GetPlaybackState

L_GetPlaybackUpdateRect

L_HalfToneBitmap

L_HalfToneBitmapExt

L_IsPtInBitmapRgn

L_OffsetBitmapRgn

L_PaintDC

L_PaintDCBuffer

L_PaintRgnDC

L_PaintRgnDCBuffer

L_PrintBitmap

L_PrintBitmapExt

L_PrintBitmapFast

L_ProcessPlayback

L_ScreenCaptureBitmap

L_SetBitmapRgnColor

L_SetBitmapRgnEllipse

L_SetBitmapRgnFromMask

L_SetBitmapRgnHandle

L_SetBitmapRgnPolygon

L_SetBitmapRgnRect

L_SetBitmapRgnRoundRect

L_SetDisplayMode

L_SetPaintContrast

L_SetPaintGamma

L_SetPaintIntensity

L_SetPlaybackIndex

L_UnderlayBitmap

L_ValidatePlaybackLines

Changed structures

The following structures have been changed to support new features:

BITMAPHANDLE has new fields for window leveling.

New error messages

The following constants for error messages have been added:

New constant

ERROR_FPX_FILE_CREATE_ERROR | FlashPix error
ERROR_FPX_FILE_NOT_OPEN_ERROR | FlashPix error
ERROR_FPX_USER_ABORT | FlashPix error
ERROR_FPX_OLE_FILE_ERROR | FlashPix error
ERROR_FPXEXTENSIONS_LOCKED | ‘FlashPix extension module’ is needed to use this function
ERROR_ANN_LOCKED | Annotation object is locked
ERROR_ISIS_NOCURSCANNER | No ISIS Scanner selected
ERROR_ISIS_SCANDRIVER_NOT_LOADED | ISIS Scanner driver failed to load
ERROR_ISIS_CANCEL | ISIS operation canceled by user
ERROR_ISIS_BAD_TAG_OR_VALUE | Bad ISIS Tag or Bad Tag Value
ERROR_ISIS_NOT_READY | ISIS Scanner not ready
ERROR_ISIS_NO_PAGE | No page in the ISIS Scanner
ERROR_ISIS_JAM | ISIS Scanner Jam error
ERROR_ISIS_SCANNER_ERROR | ISIS Scanner driver error
ERROR_ISIS_BUSY | ISIS Scanner is busy
ERROR_ISIS_FILE_ERROR | ISIS File driver error
ERROR_ISIS_NETWORK_ERROR | ISIS Network error
ERROR_ISIS_NOT_INSTALLED | ISIS is not installed
ERROR_DLG_CANCELED | Imaging Common Dialog canceled by user
ERROR_DLG_FAILED | Imaging Common Dialog Error - error during creation of dialog

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

Imaging Common Dialog:

L_DlgColorRes

L_DlgFileOpen

L_DlgFileSave

L_DlgGetAngle

L_DlgGetChange

L_DlgGetEmboss

L_DlgGetFilter

L_DlgGetGamma

L_DlgGetNoise

L_DlgGetRange

L_DlgGetSize

L_DlgWindowLevel

ISIS support (Express editions):

L_ISISAcquire

L_ISISAcquireMulti

L_ISISGetTagLong

L_ISISGetTagShort

L_IsISISAvailable

L_ISISLoadDriver

L_ISISSelect

L_ISISSetTagLong

L_ISISSetTagShort

L_ISISUnloadDriver

Annotation hyperlinks (Express editions only):

L_AnnGetHyperlink

L_AnnGetHyperlinkLen

L_AnnGetHyperlinkMenuEnable

L_AnnSetHyperlink

L_AnnSetHyperlinkMenuEnable

Annotation security (Express editions only):

L_AnnGetLocked

L_AnnLock

L_AnnShowLockedIcon

L_AnnUnlock

Annotation display (Express editions only):

L_AnnGetROP2

L_AnnGetTransparent

L_AnnSetROP2

L_AnnSetTransparent

Saving annotations (Express editions only):

L_AnnSaveTag

Restoring redact objects (Express editions only):

L_AnnUnrealize

Window leveling (Medical Express only):

L_GetMinMaxBits

L_GetMinMaxVal

L_WindowLevel

L_WindowLevelBitmap

Loading input/output file filters:

L_IgnoreFilters

L_PreLoadFilters

Miscellaneous:

L_ClearNegativePixels

L_ConvertBufferExt


Changes from Version 7.0 to Version 8.0

Version 8.0 of the LEADTOOLS API has changed from version 7.0 as follows:

The paint effects capabilities have been enhanced, with control over the speed and granularity of each effect, and with hundreds of new variations, including overlays of text and graphic shapes.

Region processing is now available in the LEADTOOLS Pro toolkits. New functions to get and set regions also make it easier to save a region as a mask in the alpha channel.

[Express editions only] You can now achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

You can now control the brightness and contrast of displayed images, without modifying the bitmap data.

New image processing functions give you more control over erosion or dilation of dark objects.

Other new image processing functions let you apply artistic effects to give an image the appearance of an oil painting or to simulate the accidental exposure of photographic film to light.

LEADTOOLS functions now preserve alpha-channel information. You can also get and set the alpha channel in 16- and 32-bit bitmaps.

TIFF file support now includes reading and writing of 32-bit images, images with PackBit compression, and images with CMYK or YCbCr color space.

BMP file support now includes reading and writing of RLE-compressed images.

You can now read and write Windows Icon (ICO) and Cursor (CUR) files.

You can now read and write Exif files.

[Express editions only] You can now read and write DICOM files.

You can now read and write Microsoft FAX (AWD) files.

You can now read and write comments in all of the file formats that support comments, including TIFF, GIF, DICOM, and Exif files.

Extended support for FlashPix files is available in the LEADTOOLS FlashPix Module.

Changed functions

The following functions have changed from the previous version of LEADTOOLS:

L_GetBitmapRowColCompressed

L_PutBitmapRowColCompressed

L_SizeBitmap

L_TwainSetProps

L_PaintDCBuffer (changed usage with 1-bit compressed data)

L_CombineBitmap (now uses Windows-style coordinates, with a top-left origin)

L_PaintDCEffect (moved from the kernel to the effects library)

L_PaintRgnDCEffect (moved from the kernel to the effects library)

Changed structures

The following structures have been changed to support new features:

EXTFILEOPTION has new fields for loading and saving stamp (thumbnail) images.

TWAINPROPERTIES has new fields for brightness, contrast, and autofeed capabilities.

FILEINFO has new constants for the Format field. The new constants are the same as you specify when saving an image.

EXTFILEOPTION has new constants for the Flags field. The new constants are used for loading FlashPix files with or without utilizing transforms stored with the image.

Changed error messages

The following constants for error messages have been changed to avoid conflicts with other Microsoft constants:

Old constant | New constant
ERROR_NOT_SUPPORTED | ERROR_FEATURE_NOT_SUPPORTED.
ERROR_FILE_NOT_FOUND | ERROR_FILENOTFOUND
ERROR_INVALID_DATA | ERROR_INVALIDDATA

Other changes to upgrade your application code

The LEADTOOLS Express editions toolkit now supports rotated view perspectives, which let you achieve faster rotation in 90-degree increments. If you implement the new view perspectives, you should make the following changes in your code. (You can follow the examples in the LEADTOOLS sample code.)

If a bitmap has a view perspective that is rotated 90 or 270 degrees, the Width and Height fields in the BITMAPHANDLE and the FILEINFO structures do not match the displayed width and height. Therefore, you should reverse the values in places where you use these fields to determine an image's aspect ratio (for example, when you size a window). LEADTOOLS provides macros for this, which are described in Accounting for View Perspective.

Some function, such as L_GetPixelColor, reference bitmap coordinates. The previous code for translating to and from bitmap coordinates is inadequate. Instead, you should use the support functions, which are described in Accounting for View Perspective. You can find places in your code that need attention by searching for any reference to the ViewPerspective field in the BITMAPHANDLE or FILEINFO structure.

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

Fast rotation by changing the view perspective (Express editions only):

L_RotateBitmapViewPerspective

View perspective support functions:

L_PointFromBitmap

L_PointToBitmap

L_RectFromBitmap

L_RectToBitmap

L_ChangeBitmapViewPerspective

Special paint effects:

L_EfxDraw3dShape

L_EfxDraw3dText

L_EfxDrawFrame

L_EfxDrawRotated3dText

L_EfxEffectBlt

L_EfxGradientFillRect

L_EfxPaintBitmap

L_EfxPaintTransition

L_EfxPatternFillRect

Setting contrast and brightness of all displayed images:

L_GetPaintContrast

L_SetPaintContrast

L_GetPaintGamma

L_SetPaintGamma

L_GetPaintIntensity

L_SetPaintIntensity

Enhanced polygon support for annotations (Express editions only):

L_AnnGetPointCount

L_AnnGetPoints

Automatic trimming of margins:

L_AutoTrimBitmap

L_GetAutoTrimRect

L_TrimBitmap

New filters for dilation and erosion (Express editions only):

L_MaxFilterBitmap

L_MinFilterBitmap

New filters for artistic effects:

L_OilifyBitmap

L_SolarizeBitmap

Region processing, transparency, and alpha channel support:

L_CreateMaskFromBitmapRgn

L_SetBitmapRgnFromMask

TIFF tag support:

L_SetTag

L_GetTag

L_ReadFileTag

L_ReadFileTagMemory

New functions for 1-bit compressed data (Express editions only):

L_GetBitmapRowCompressed

L_PutBitmapRowCompressed

L_CompressRows

L_ExpandRows

FlashPix Extended support (FlashPix Module only):

L_GetFileCommentSize

L_ReadFileCommentExt

L_WriteFileCommentExt

L_ReadFileStamp

L_WriteFileStamp

L_LoadFileTile

L_SaveFileTile

L_ReadFileTransforms

L_WriteFileTransforms


Changes from Version 6.2 to Version 7.0

Version 7.0 of the LEADTOOLS API has changed from version 6.2 as follows:

You can now read and write progressive JPEG and LEAD CMP files.

You can now read, write, and play back animated GIF files.

You can now read and play back AVI files, and use them to create animated GIF files.

Other features of GIF files are now supported, including interlaced files, the full range of color resolutions, and the use of transparent colors.

When reading and writing TIFF files, you can now use the full range of palette indexes (1-8 bits per pixel).

To support the new formats, you can now use the full range of palette indexes for bitmaps (1-8 bits per pixel).

You can now read and write Kodak FlashPix files.

You can now get and update information in a 16- or 32-bit file's alpha channel. This enables you to save a bitmap region in a file.

The BITMAPHANDLE, FILEINFO, and EXTFILEOPTION structures have been modified to support the new load, save, and animation capabilities.

Callback functions now provide more information to support progressive and interlaced formats.

Compression and decompression of CCITT Group 3 and Group 4, and LEAD 1-bit files is faster in Express editions.

[Express editions only] Display using the scale-to-gray and favor-black options is faster.

The online help now includes more detailed information and provides short, clear code examples for all functions.

The following is a summary of new functions:

For Annotations

L_AnnGetAutoText

L_AnnGetAutoTextLen

L_AnnSetAutoText

L_AnnGetItem

L_AnnGetToolBarButtonVisible

L_AnnSetToolBarButtonVisible

L_AnnGetAutoMenuEnable

L_AnnSetAutoMenuEnable

L_AnnGetAutoDrawEnable

L_AnnSetAutoDrawEnable

For Bitmap Lists

L_LoadBitmapList

L_SaveBitmapList

L_CreateBitmapList

L_DestroyBitmapList

L_CopyBitmapListItems

L_DeleteBitmapListItems

L_GetBitmapListCount

L_GetBitmapListItem

L_InsertBitmapListItem

L_RemoveBitmapListItem

L_SetBitmapListItem

L_ColorResBitmapList

L_TranslateBitmapColor

For Animation Playback

L_CreatePlayback

L_ProcessPlayback

L_DestroyPlayback

L_CancelPlaybackWait

L_ClearPlaybackUpdateRect

L_GetPlaybackIndex

L_GetPlaybackState

L_GetPlaybackUpdateRect

L_SetPlaybackIndex

L_AppendPlayback

L_ValidatePlaybackLines

L_GetPlaybackDelay

For FlashPix Support

L_EnumDimensions

L_GetDimension

L_SetDimension

For Alpha Channel Support

L_GetBitmapAlpha

L_SetBitmapAlpha

Miscellaneous

L_GetExtFileOption

L_GetBitmapColorCount


Changes from Version 5.2 to Version 6.2

Version 6.2 of the LEADTOOLS API has changed from version 5.2 as follows:

New functions let you select and manipulate a region within a bitmap.

New functions let you create and manipulate annotations that you can overlay on an image. This feature is available only in Express editions.

The toolkit has been subdivided into a several need-specific DLLs that let you limit the size of your application by including only the applicable DLLs.

The toolkit now fully supports the development of multi-threaded applications for Windows NT and Windows 95.

The toolkit can now read Progressive JPEG, and it can read and write Windows BMP files in all possible color resolutions.

The LEAD 1-bit format has been improved.

New functions let you load a bitmap from your own buffer so that it is easier to handle transmitted images, such as those received through the Internet.

New functions let you specify the DPI (dots per inch) resolution when loading a WMF file.

The following is a list of new functions:

Programming Environment | L_UseBitmapClass
Getting and Setting Information | L_IsSupportLocked
 | L_UnlockSupport
 | L_GetWMFResolution
 | L_SetWMFResolution
Loading and Displaying a bitmap | L_StartFeedLoad
 | L_FeedLoad
 | L_StopFeedLoad
Modifying Bitmap Image Data | L_IsGrayscaleBitmap
Creating a Bitmap Region | L_SetBitmapRgnColor
 | L_SetBitmapRgnEllipse
 | L_SetBitmapRgnPolygon
 | L_SetBitmapRgnRect
 | L_SetBitmapRgnRoundRect
 | L_SetBitmapRgnHandle
Working with the Bitmap Region | L_BitmapHasRgn
 | L_FreeBitmapRgn
 | L_GetBitmapRgnHandle
 | L_GetBitmapRgnBounds
 | L_OffsetBitmapRgn
 | L_GetBitmapRgnArea
 | L_IsPtInBitmapRgn
Displaying the Bitmap Region | L_FrameBitmapRgn
 | L_PaintRgnDC
 | L_PaintRgnDCBuffer
 | L_PaintRgnDCEffect
Implementing Annotations | L_AnnCreateContainer
 | L_AnnCreate
 | L_AnnSetAutoContainer
 | L_AnnGetAutoContainer
 | L_AnnSetTool
 | L_AnnGetTool
 | L_AnnSetDpiX
 | L_AnnSetDpiY
 | L_AnnGetDpiX
 | L_AnnGetDpiY
Mid-Level Functions | L_AnnSave
 | L_AnnLoad
 | L_AnnLoadMemory
 | L_AnnLoadOffset
 | L_AnnSaveMemory
 | L_AnnSaveOffset
 | L_AnnPrint
 | L_AnnCopy
 | L_AnnCopyFromClipboard
 | L_AnnCopyToClipboard
 | L_AnnCutToClipboard
 | L_AnnClipboardReady
 | L_AnnCopyFromClipboard
 | L_AnnRealize
 | L_AnnGetUserMode
 | L_AnnSetUserMode
 | L_AnnSetUndoDepth
 | L_AnnUndo
 | L_AnnCreateToolBar
 | L_AnnGetToolBarChecked
 | L_AnnSetToolBarChecked
 | L_AnnSelectRect
 | L_AnnGetSelectCount
 | L_AnnSelectPoint
 | L_AnnHitTest
 | L_AnnDefine
 | L_AnnDraw
 | L_AnnGetBoundingRect
 | L_AnnGetSelectRect
Low-Level Coordinates | L_AnnSetScalarX
 | L_AnnSetScalarY
 | L_AnnGetScalarX
 | L_AnnGetScalarY
 | L_AnnSetOffsetX
 | L_AnnSetOffsetY
 | L_AnnGetOffsetX
 | L_AnnGetOffsetY
Low-Level Functions | L_AnnCreate
 | L_AnnDestroy
 | L_AnnCreateContainer
 | L_AnnCreateItem
 | L_AnnInsert
 | L_AnnRemove
 | L_AnnGetContainer
 | L_AnnGetTopContainer
 | L_AnnEnumerate
 | L_AnnBringToFront
 | L_AnnSendToBack
 | L_AnnFlip
 | L_AnnReverse
 | L_AnnRotate
 | L_AnnMove
 | L_AnnSetRect
 | L_AnnGetRect
 | L_AnnSetPoints
 | L_AnnResize
 | L_AnnSetVisible
 | L_AnnGetVisible
 | L_AnnSetSelected
 | L_AnnGetSelected
 | L_AnnSetWnd
 | L_AnnGetWnd
 | L_AnnGetType
 | L_AnnGetActiveState
 | L_AnnSetActiveState
 | L_AnnSetText
 | L_AnnGetText
 | L_AnnGetTextLen
 | L_AnnSetFontName
 | L_AnnGetFontName
 | L_AnnGetFontNameLen
 | L_AnnSetFontSize
 | L_AnnGetFontSize
 | L_AnnSetFontUnderline
 | L_AnnGetFontUnderline
 | L_AnnSetFontStrikeThrough
 | L_AnnGetFontStrikeThrough
 | L_AnnSetFontItalic
 | L_AnnGetFontItalic
 | L_AnnSetFontBold
 | L_AnnGetFontBold
 | L_AnnSetForeColor
 | L_AnnGetForeColor
 | L_AnnSetBackColor
 | L_AnnGetBackColor
 | L_AnnSetLineWidth
 | L_AnnGetLineWidth
 | L_AnnSetLineStyle
 | L_AnnGetLineStyle
 | L_AnnSetFillPattern
 | L_AnnGetFillPattern
 | L_AnnSetFillMode
 | L_AnnGetFillMode
 | L_AnnGetPolyFillMode
 | L_AnnSetPolyFillMode
 | L_AnnSetBitmap
 | L_AnnGetBitmap
 | L_AnnSetTag
 | L_AnnGetTag


Copyright notice

Copyright Notices

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Trademarks

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

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

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

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

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

Address and Contact Information

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

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
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

Database Interaction

Data Transfer

Animation


Introduction: Animation

GIF files are commonly used for small animated images in applications. These are multi-page 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 multi-page 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 multi-page 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.

The simplest database support is with Visual Basic, where you can bind a LEAD control (ActiveX) to a data control. You can associate the LEAD control with a long binary field in the database, and let the data control handle all of the database maintenance and navigation.

For other systems with ActiveX support, 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 ActiveX 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 ActiveX 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 ActiveX's view, so that it is always accessing the same record. (The ActiveX 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. (The ACCESS 7.0 and FoxPro 2.x drivers have been tested successfully and are described in the ActiveX tutorials.)

Also, for systems with ActiveX support, you can use OLE DB and ADO to access data. You can bind the LEADTOOLS OLE DB Control to an OLE DB data source, such as the Microsoft ADO Data Control. You can associate the LEADTOOLS OLE 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, C++, and Delphi, 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 Document/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_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 multi-page 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

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

To run the example programs, LEADTOOLS must be installed on your system. The EXEs for these example programs can be found in the LEAD\BIN directory, where LEAD represents the directory in which LEADTOOLS was installed. The source code for these demos can be found in sub-directories of the LEAD\EXAMPLES directory.

ANNOTATE | Annotations demonstrates the annotation capabilities of the Document/Medical toolkit.
CLRSPACE | Color Space loads and displays the image file specified on the command line, then uses the L_ConvertColorSpace function to convert from RGB to YUV, CMYK, and other formats, redisplaying the image after all conversions are complete.
COLOR | Color Resolution loads the 24-bit image file specified on the command line and calls L_ColorResBitmap to optimize and dither the image to 8 bits per pixel.
COMPCB | Compress Callback loads the image file specified on the command line, then displays the image, compresses the bitmap to file using a callback function, clears the bitmap, loads the compressed image, and displays the newly loaded image.
DELPHI | Delphi Demo demonstrates the use of LEADTOOLS with the Borland Delphi development system.
DEMO | Main Demo is the main example program. It uses pull-down menus to demonstrate most of the LEADTOOLS features in one application.
DIBDDB | DIBDDB Demo demonstrates the functions that translate to and from Windows device independent bitmaps (DIBs) and device dependent bitmaps (DDBs).
DRAW | Draw Demo uses pull-down menus to show some of the drawing capabilities available with LEADTOOLS.
EZFUNC | Simple Load uses simple LEADTOOLS functions to load an image file specified on the command line and display the bitmap in a window.
EZREGC | Reg. Class Load uses the L_BITMAPCLASS registered class to load an image file specified on the command line and display the bitmap in a window.
FEATURE1 | Some Basic Features loads and displays the 24-bit image file specified on the command line, then makes the following changes, redisplaying the image after each change: optimize to 8 bits per pixel, flip, lighten, resize, and rotate.
FEATURE2 | More Basic Features loads and displays the 24-bit image file specified on the command line, then makes the following changes, redisplaying the image after each change: dither to 8 bits per pixel, reverse, grayscale, resize, and fill with one color.
FEATURE3 | A Few More Features loads and displays the image file specified on the command line, copies the image data to a different bitmap, halftones the original image, restores the image by copying the handle of the new bitmap, then redisplays the image.
FEEDLOAD | Feed Load demonstrates how to use L_FeedLoad and related functions by simulating the receipt of a transmitted image.
FPXDEMO | FlashPix Demo is the main example program for the FlashPix support. It uses pull-down menus to demonstrate most of the LEADTOOLS FlashPix features in one application.
GETROW | Get Row loads the 24-bit image file specified on the command line, then rotates the image 90 degrees using L_GetBitmapRow and L_PutBitmapRowCol, and redisplays the image.
INFO | Info displays image information from the file specified on the command line.
ISAPI | LEADTOOLS ISAPI Extension example demonstrates using LEADTOOLS API in an ISAPI Server Extension. For more information on how to use this sample, refer to ISAPI Example.
LOADCB | Load Callback loads the image file specified on the command line, using a callback function to display the image as it is loaded.
LOADSAVE | Load and Save uses pull-down menus to let the user load an image file, display the image in a window, and save the image to a specified file name, format, and bits per pixel. The options are implemented using a Windows common dialog box.
MEMORY | Load Memory demonstrates the ability to load a file from memory. It allocates memory, loads the image file specified on the command line into the allocated memory, then loads the image from memory to a bitmap using L_LoadBitmapMemory and displays the image.
MEMORYCB | Load Memory Callback demonstrates the ability use a callback function when loading a file from memory. It allocates memory, loads the image file specified on the command line into the allocated memory, then loads the image from memory to a bitmap using L_LoadMemory and a callback function, and displays the image.
MFCDEMO | MFC Demo demonstrates the use of LEADTOOLS with the Microsoft Foundation Class (MFC). This example includes a C++ wrapper for the LEADTOOLS API.
MFCFPX | MFC FlashPix Demo demonstrates the LEADTOOLS FlashPix support, with the Microsoft Foundation Class (MFC).
MFCFX | Special Effects MFC Demo demonstrates the LEADTOOLS special effects, including paint effects, transitions, three-dimensional text, and three-dimensional shapes.
OFFSET | Load Save Offset demonstrates the ability to load an image file that is embedded in a larger file. It does so by using the L_LoadFileOffset function, which lets you specify the offset and the size of the embedded file. This example first loads the normal image file specified on the command line. It embeds the image in a second file, which is specified in the second command line argument. It then loads and displays the embedded file.
PAINTDC | Paint DC loads the image file specified on the command line, and displays the image. The user can then choose a menu option to modify the source and display rectangles, and redisplay the image to see the changes.
PAINTEFF | Paint Effect Demo uses pull-down menus to demonstrate the various transitional painting effects that are available with LEADTOOLS.
REDIRECT | Redirect I/O demonstrates how to use the L_RedirectIO function. It redirects the standard I/O functions so that they read and seek into the allocated memory rather than a file.
REGCLASS | Registered Class Demo demonstrates most of the capabilities of L_BITMAPCLASS registered class.
RESIZE | Resize loads the image file specified on the command line, resizing the image while loading it. It then places the resized image over the original and displays the combined image.
SAVECB | Save Callback loads the image file specified on the command line, then displays the image and saves it to the current directory using a callback and status window.
SAVEMEM | Save to Memory demonstrates the ability to save a file in memory. It lets the user load an image file, display the image in a window, and save the image to a file in memory.
SCRLZOOM | Scroll & Zoom Demo uses pull-down menus to let the user load an image file, display the image in a window, and use zooming and scrolling features. In doing so, it also demonstrates the ability of the L_PaintDC function to automatically dither a 16-, 24-, or 32-bit image when displaying on a 4- or 8-bit device.
STAMPGET | Get Stamp reads a thumbnail (stamp) image stored in a compressed file that the user selects; then displays the image in a window. The only valid input file is a LEAD or JPEG file that is compressed with a stamp image. (Use the STAMPPUT example first to create an image file that contains a thumbnail.)
STAMPPUT | Put Stamp loads the image file specified on the command line, calls L_ColorResBitmap (if necessary) to obtain a 24 bit image, calls L_CompressBitmapWithStamp to compress the image to STAMP.CMP (a LEAD CMP compressed file format), then loads the stamp to a bitmap and displays the stamp.
THREAD | Multi-thread reads and displays all files from the directory specified on the command line. It creates a new thread to load images while the main thread paints the last image that was loaded. When the last image is loaded, the example uses the last image to cycle through the paint effects. The multi-thread feature works only on WIN32 systems.
UNDERLAY | Underlay demonstrates the L_UnderlayBitmap function. It loads two images specified on the command line and displays the first one. It then combines the images using the second one as an underlying image, and displays the combined image.
WARPING | Warping demonstrates the L_CombineBitmapWarp function. It lets you load a master image and a slave image and, through the use of a polygon annotation, select the area of the master image to which to warp the slave image. For more information on using this demo, refer to Using the Image Warping Demo.


ISAPI Example

Your web server must support ISAPI to use this example. Some web servers that support ISAPI are:

Microsoft Personal Web Server

Microsoft Internet Information Server (IIS)

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

To use this example, you must create a directory of 31 images (any format supported by LEADTOOLS). The images must be named 1, 2, 3, etc. with no extension up to 31.

Compile this DLL, and place it in your IIS Server's scripts directory.

See the bottom of the source file for a sample HTML page that calls this ISAPI DLL. Or, use the sample page "ISAPI.HTM".

This ISAPI DLL can be called in two ways:

1) use the dll to return an IMG:

<IMG SRC="/scripts/ltisapi.dll">
will return a jpeg image corresponding to the day of the month

2) use the dll in an input form:

<form action="/scripts/ltisapi.dll?" method="POST">
<input type="hidden" name="MfcISAPICommand"
value="MyText"><p>Enter
the text you want placed on the image: <input type="text"
size="20" name="MyText" value="XXXXX">
 <input type="submit"
value="Submit"> </p>
</form>
will return a jpeg image corresponding to the day of the month with
the string "xxx" written on it.


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 LEADTOOLS

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

Getting Started

Considering Development Systems

Using LEADTOOLS with Your C/C++ Compiler

Unlocking Special LEAD Features

Unlocking Vector File Format Support

Loading File Filters

Working with Raster Images

Loading and Saving Images

Displaying an Image

Using the ImageList Control

ThumbnailBrowser

Using a PanWindow

Accounting for View Perspective

Implementing Animation

Processing an Image

Compressing and Decompressing Buffers

Implementing Transparency

Scanning Images Using TWAIN or ISIS Devices

Using Callback Functions

Using DIBs, DDBs, and the Clipboard

Using the Magnifying Glass

Converting and Changing EMFs and WMFs

Defining and Using a Bitmap Region

Speeding Up 1-Bit Documents ( Document/Medical only)

Cleaning Up 1-Bit Images

Minimizing Flicker with Double Buffering

Memory Storage Types for Bitmaps

Detecting Registration Marks

Using Color Values in LEADTOOLS

Image Optimization

Handling CMYK Files as Separate Bitmaps

Working with Vector Images

Vector Images

Working with Annotations (Document/Medical only)

Implementing Annotations

Automated User Interface for Annotations

Types of Annotations

Low-Level Coordinate System for Annotations

Implementing Annotation Security

Implementing Annotation Hyperlinks

Converting Automation Dialogs to Other Languages

Annotation Tutorials

Implementing Custom Annotations

The Annotation Text Token Table

Fixed Annotations

Changing the Annotation Automation Pen Highlight Color

Using Annotation Bitmap Objects

Using Rulers in Annotation Objects


Considering Development Systems

The LEADTOOLS DLLs are designed as standard Windows Dynamic Link Libraries. You should be able to use the LEADTOOLS API with any program that supports Windows DLL calls. This topic explains some of the options.

Calling API functions from a C program:

Most of the LEADTOOLS example programs and all of the documented code examples are for Windows programs written in C. You can implement the API as explained in Using LEADTOOLS with Your C/C++ Compiler.

Message-based programming using the registered class:

LEADTOOLS provides limited easy-to-use features in the predefined L_BITMAPCLASS registered class. This registered class lets you do common programming tasks simply by passing messages.

The registered class can be used to create an overlapped, pop-up, or child window by calling CreateWindow and specifying L_BITMAPCLASS as the window class. Windows created from L_BITMAPCLASS will automatically handle painting an image that was loaded. To dynamically load the DLL that supports the registered class, you must call the L_UseBitmapClass function.

For a summary of the capabilities, refer to Window Messages and Styles. A simple programming example is in the L_UseBitmapClass function description. A more complete example is in the REGCLASS subdirectory.

Using C++ and the Microsoft Foundation Class (MFC):

LEADTOOLS provides a C++ wrapper that lets you use the API with the Microsoft Foundation Class. The wrapper is not documented, but an example is provided in the MFCDEMO subdirectory.

Calling API functions from Delphi:

You can call LEADTOOLS API functions from a Borland Delphi program. An example is provided in the DELPHI subdirectory.

Using API functions with the LEADTOOLS ActiveX or VBX:

You can use the LEADTOOLS API functions to work with images in the ActiveX controls. To access the image in a control, you can use the L_GetControlBitmap and L_SetControlBitmap functions, which are documented in the LEADTOOLS ActiveX help file.


Using LEADTOOLS with Your C/C++ Compiler

For Microsoft C, you need to include the library (.LIB) files that LEADTOOLS supplies in order to call LEADTOOLS API functions. For a summary of the library files, refer to Files To Be Included With Your Application. For the library files required by a particular function, refer to the function description.

For other compilers, you may need to generate a .LIB file from a DLL. For example, use the IMPLIB.EXE program with Borland C, versions 3.x and 4.x. For other compilers, on WIN32 systems, you should also specify alignment on a 1-byte boundary.

The make files for the example programs are different for different compilers, as follows:

For WIN32 editions, all of the example programs have separate make files for Microsoft C and for Borland C. Before using a Borland make file, you must update its variable assignments to reflect the correct path name on your system for the library and include files.


Unlocking Special LEAD Features

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

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

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

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

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

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

when you have received the instructions and the key(s) call the L_UnlockSupport function with the appropriate key.

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

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

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

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

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

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

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

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


Unlocking Vector File Format Support

Vector Toolkits

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


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) 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 compression is lossy, which means there is some small amount of degradation each the 24-bit super-compressed bitmap changes. (The 1-bit super-compressed bitmap uses lossless 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.

You can specify the type of bitmap you want when you call L_CreateBitmap or L_AllocateBitmap. You can also instruct LEADTOOLS to react dynamically depending on the bitmap size or the amount of available memory using L_SetMemoryThresholds.

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 L_SetMemoryThresholds when uTileSize 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 L_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 also set through L_SetMemoryThresholds). 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 L_SetMemoryThresholds, call L_GetMemoryThresholds.

By default, the Windows temporary directory is used to store the disk files used for the disk tiles and disk images. You can change the location where these files are stored using L_SetTempDirectory. You can get the current location using L_GetTempDirectory.

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 L_GetBitmapMemoryInfo. You can change the memory allocation parameters using L_SetBitmapMemoryInfo. The memory parameters are:

The memory type (conv, tiled, disk, etc)

These are for tiled bitmaps only:

The number of tiles

The tile size

The number of tiles in conventional memory

The maximum number of tile views in the conventional memory (for disk tiles only)

The number of tile views in the conventional memory (for disk tiles only)


Callback Functions

Using Callback Functions

A callback function is a function that you write and that LEADTOOLS calls. With a callback function you can add processing, and in some cases, you can direct the input or output of a LEADTOOLS engine such as the decompression engine. Generally, the engine is in a loop. In cases where you can direct the output, with each time through the loop, it fills a buffer with data and calls your function to process the data.

Callback functions are also commonly used to update status bars or to see if the user wants to interrupt the process. The L_SetStatusCallBack function enables you to do that with many functions that do not declare a callback in the parameter list.

To retrieve the current status callback function, and any associated user-defined data, call L_GetStatusCallBack.

In addition, many of the LEADTOOLS functions let you pass a parameter that specifies a callback function. These callback functions are more flexible than the one specified with L_SetStatusCallBack. There are some variations in how the idea is implemented, and you must refer to the individual function descriptions to see how they are used.

LEADTOOLS API callback functions let you perform the following:

File-to-buffer compression and decompression

File-to-buffer image loading

Redirected I/O functions for memory-to-memory compression and decompression

On-the-fly resizing

Painting while loading

Seeing if the user wants to interrupt the process

Updating a status bar

Providing help for dialogs

For a list of the possible callback functions, refer to Callbacks.


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

A DIB consists of one of the following:

a BITMAPFILEHEADER,

a BITMAPV4HEADER (introduced in Windows 95 and Windows NT 4.0),

or a 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 uType flag.

For a list of the functions for DIBs and DDBs, refer to Using DIBs and DDBs.

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.

For a list of clipboard functions, refer to Using the Clipboard.


Loading and Saving Images

LEADTOOLS provides many options when loading and saving image files. Nevertheless, the code can be as simple as the following, which loads a LEAD compressed file and saves it as a Windows BMP file:

BITMAPHANDLE TmpBitmap; /* Bitmap handle for the temporary bitmap */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL);

/* Save the image as a 24-bit Windows BMP file */
L_SaveBitmap(TEXT("TEST.BMP"), &TmpBitmap, FILE_BMP, 24, 0, NULL);

/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);

LEADTOOLS also supports super compressed images. Only 1-bit and 24-bit bitmaps can be kept super compressed in memory. For more information, refer to Super Compressed Bitmaps.

You can load an image at its own color resolution, manipulate it, and display it, regardless of current video mode. You can also convert the image to a specific color resolution (bits per pixel) as you load or save it. If you want to convert while loading or saving, refer to Conversion Considerations.

Whether an image file is on disk or in memory, you can get information about the image before loading it. You can also handle file-format-specific information, such as the page number or physical resolution. The following topics provide more information about specific file formats:

Controlling Progressive Loads and Saves

Implementing GIF Features

Implementing PhotoCD and FlashPix Features

Implementing FlashPix Extension

Implementing JBIG Features

Implementing Exif Features

Implementing TIFF Comments and Tags

Working with Markers

Multi-page File Formats

Working with the RAW File Filter

You can supply the input for a load operation or the output of a save operation, and you can add processing, such as a paint-while-load feature. Using Callback Functions describes these features. Callbacks lists the functions that you can supply.

You can control the execution of a load procedure as you supply transmitted image data. Refer to the L_StartFeedLoad, L_FeedLoad, and L_StopFeedLoad functions.

When working with multi-page files, you can delete individual pages within the file using L_DeletePage.

To load an image from a file, into a bitmap, and resize the bitmap as it loads, call L_LoadBitmapResize.

To save a bitmap to a file in a memory buffer, use L_SaveBitmapBuffer or L_SaveFileBuffer. The L_SaveFileBuffer uses an optional callback function to allow additional processing of the saved material.

PSD file formats support layers. LEADTOOLS provides the L_LoadLayer function to allow the loading of an individual layer. PSD files can also be saved with layer information by calling L_SaveBitmapWithLayers.

When loading DJVU files, you can use the L_GetDJVOptions to get the current values for the control options used by LEADTOOLS when loading a DJVU file. You can then use L_SetDJVOptions to change the values for the control options.

When loading HPGL files, you can use the L_GetPLTOptions to get the current values for the control options used by LEADTOOLS when loading an HPGL file. You can then use L_SetPLTOptions to change the values for the control options.

When loading RTF files, you can use the L_GetRTFOptions to get the current values for the control options used by LEADTOOLS when loading an RTF file. You can then use L_SetRTFOptions to change the values for the control options.

LEADTOOLS can load overlay files, which are usually PTOCA files, by either loading directly from the disk, or by calling an overlay callback function to get the overlay bitmap from the user. To set the callback function to use, as well as the methods and the order of those methods LEADTOOLS should use to load an overlay file, call L_SetOverlayCallback. To determine the current overlay callback function, which is the one last set using L_SetOverlayCallback, use L_GetOverlayCallback. This overlay callback must adhere to the function syntax specified in OVERLAYCALLBACK.

LEADTOOLS also lets you load embedded ICC profiles. These profiles can be loaded from JPEG, TIFF or EPS files. Before loading an ICC profile, an MEMICCPROFILE structure must be initialized by calling L_InitICCProfile. Then, the profile itself can be loaded by calling L_LoadICCProfile. When the structure that contains the loaded profile is no longer needed, the memory must be freed by calling L_FreeICCProfile.

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

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

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

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. For more information, refer to the LEADTOOLS Mixed Raster Content (MRC) API Help File .

When saving a JBIG2 file, you can use the L_GetJBIG2Options to get the current values for the control options used by LEADTOOLS. You can also use L_SetJBIG2Options to change the values for the control options before saving the JBIG2 file.

When loading TXT files, you can use the L_GetTXTOptions to get the current values for the control options used by LEADTOOLS. You can also use L_SetTXTOptions to change the values for the control options before loading the TXT files.

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 L_GetLoadStatus will return an error code.

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 L_LoadFileCMYKArray. To save the bitmap as TIFF CMYK, call L_SaveFileCMYKArray.


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. Using an IFD (Image File Directory) speeds up loading, saving and getting information from very large TIFF files. The IFD is essentially an offset within the TIFF file where a page starts.

Several structures contain an IFD member that contains the offset of the desired page within the TIFF file. These structures include FILEINFO, SAVEFILEOPTION and LOADFILEOPTION.

L_FileInfo will report the IFD of a TIFF page by filling FILEINFO.IFD.

To get L_FileInfo to use an IFD, set LOADFILEOPTION.IFD to the IFD and set ELO_USEIFD in LOADFILEOPTION.uFlags to signal that the IFD field is valid. Caution should be taken in using the IFD, since incorrect values could have unexpected consequences. Also note that the page numbering is different if the IFD is used: page 1 is the page whose IFD is indicated in LOADFILEOPTION, page 2 is the page after the page whose IFD is indicated, etc.

Example:

/* We will assume that "test.tif" has over 1002 pages. The error checks
are not performed to simplify the example */
// get info for page 1000

LOADFILEOPTION LoadFileOption;
FILEINFO FileInfo;

// get the info and IFD for page 1000
memset(&LoadFileOption, 0, sizeof(LOADFILEOPTION));
LoadFileOption.PageNumber = 1000;
FileInfo.uStructSize = sizeof(FileInfo);
L_FileInfo(TEXT("test.tif"), &FileInfo, sizeof(FILEINFO), 0, &LoadFileOption);

// get the info and IFD for page 1001.
LoadFileOption.PageNumber = 2;
LoadFileOption.IFD = FileInfo.IFD;
LoadFileOption.Flags = ELO_USEIFD;
L_FileInfo(TEXT("test.tif"), &FileInfo, sizeof(FILEINFO), 0, &LoadFileOption);

The example above gets the info for page 1001 on the second call. The second call is lightning-quick because we don’t have to skip over the first 1000 pages to get the information about page 1001. Instead, we only have to skip page 1000, because the IFD provided in LOADFILEOPTION allowed us to jump directly to page 1000.

FILEINFO.IFD will be filled whenever retrieving information about a TIF file. The IFD field is valid if Fileinfo.uFlags has the FILEINFO_IFDVALID flag set. Also, the IFD value cannot be less that 8 (values of 7 and below are invalid).

FILEINFO.IFD can be used for faster load by setting it in LOADFILEOPTION.IFD as explained above.

When loading a page from a TIFF file, setting the LOADFILEOPTION.IFD parameter of L_LoadFile function tells LEADTOOLS to treat the page beginning at the specified offset as page 1. Therefore, LEADTOOLS 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 SAVEFILEOPTION parameter of the L_SaveFile function tells the control to treat the page beginning at the specified offset as page 1. Pages after this offset can be appended more quickly, since the control does not have to go through all pages from the beginning of the file.

The L_CompactFile function 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 File Filters

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 other third party libraries loading DLLs, 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.

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

L_PreLoadFilters

Use the following function to specify the file format filters LEADTOOLS should never load:

L_IgnoreFilters

It is important to note that L_PreLoadFilters must be called prior to loading, saving or getting information on a file. In addition, L_PreLoadFilters must be called before calling L_IgnoreFilters for L_IgnoreFilters to work properly.


Controlling Progressive Loads and Saves

The LEAD and JPEG (JFIF) file formats can be extended to support progressive loading and saving of images. Progressive loading 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.

Since the progressive formats are newer, some existing applications do not support them. Therefore, especially when saving a file that may be read by another application, you must pay attention to the Passes field in the SAVEFILEOPTION structure.

To avoid saving a progressive file (to save an ordinary LEAD or JPEG file) use the SAVEFILEOPTION structure to set the number of passes to 0 before calling the function that saves the file.

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.

If you want to save a progressive file or take advantage of this feature when loading a progressive file, you can control the number of passes that are required to complete the image. For more information, refer to the Passes field in the SAVEFILEOPTION structure.

JBIG also supports progressive loading of an image. For more information on this, refer to Implementing JBIG Features.

JPEG 2000 also supports progressive loading of images. For more information on this, refer to Implementing JPEG 2000 Plug in Features.

The following example shows how to save a progressive LEAD then implement a progressive paint-while-load:

/*******************************************************************************************
This example uses L_LoadFile with a callback function to implement a progressive
paint-while-load feature. Refer to the FILEREADCALLBACK
function to see how the callback function paints the image data.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
RECT rClientSize; /* RECT for the client area */
RECT rLeadDest; /* Destination rectangle for painting */
RECT rLeadSource; /* Source rectangle for painting */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
FILEINFO FileInfo; /* LEAD File Information structure. */

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
} IMAGECBPARM;

/* Prototype for the FILEREADCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK LoadImageCB(pFILEINFO pFileInfo, pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData );
/*********************************************************************************************/

void TestLoad(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
static IMAGECBPARM UserData; /* Structure used for the callback function's user data */
LOADFILEOPTION LoadFileOption; /* Structure for progressive options */
SAVEFILEOPTION SaveFileOption; /* Structure for progressive options */
FILEREADCALLBACK lpfnCallBack;

/* Load a bitmap */
L_LoadBitmap(pszFilename, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL);

/* Get the current EXTFILEOPTION values and save the current Passes value */
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));

/* Set the number of passes for a progressive LEAD file */
SaveFileOption.Passes = 8;

/* Save the file */
L_SaveBitmap(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TEST.CMP"), &LeadBitmap, FILE_CMP, 24, PQ2, &SaveFileOption);

/* Set the number of callback passes for loading a progressive LEAD file */
LoadFileOption.Passes = CALLBACK_WHEN_MEANINGFUL;

/* Get the client area of the window. We assume that elsewhere in the program, the
L_FileInfo function has been used to update the FileInfo structure and that the
window dimensions have been adjusted to the bitmap's aspect ratio. */
GetClientRect(hWnd,&rClientSize);

/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;

/* Initialize the bitmap handle */
L_InitBitmap( &LeadBitmap, sizeof(BITMAPHANDLE), FileInfo.Width, FileInfo.Height, FileInfo.BitsPerPixel );
LeadBitmap.ViewPerspective = FileInfo.ViewPerspective;

/* Set the user data used for the callback in the L_LoadFile function */
UserData.hwnd = hWnd; /* Current window */
UserData.hdc = GetDC( hWnd ); /* Device context for the current window */

/* Set the callback function for the L_LoadFile function.*/
lpfnCallBack = (FILEREADCALLBACK) MakeProcInstance(
(FARPROC) LoadImageCB, hInst );

/* Load the file, calling lpfnCallBack to paint the bitmap. */
L_LoadFile(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\TEST.CMP"),
&LeadBitmap, sizeof(BITMAPHANDLE),
0,
ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
lpfnCallBack,
&UserData,
&LoadFileOption);
FreeProcInstance ((FARPROC) lpfnCallBack);
/* Avoid an unnecessary repaint */
ValidateRect(hWnd, &rLeadDest);

return;
}


Conversion Considerations

Conversion from one file format to another can take place when you load or save a file, or when you do file-to-file conversion.

The conversion process can include simultaneous resizing of an image. The process can also change the image's bits per pixel. The conversion process takes longer if either of these additional changes are included.

When reducing a file to a 4- or 8-bit format, LEADTOOLS must reduce the number of colors. Therefore, the image cannot be converted back to the original image format and retain its original colors.

When converting from 24 bits or less to a 32-bit file, the alpha channel will be filled with zeroes.

If you load a LEAD or JPEG file, converting it to 8 bits per pixel while loading, LEADTOOLS dithers the image using the fixed palette. If you would rather have an optimized palette, you should first load it as a 24-bit bitmap; then use L_ColorResBitmap to reduce the image using an optimized palette.


Thumbnail Browser

LEADTOOLS API provides a thumbnail browser that browses a specified directory for images supported by LEADTOOLS. For each supported image, a thumbnail image is generated. To browse a directory, call L_BrowseDir. The parameters passed to this function affect both the browse process and thumbnail characteristics. Thumbnails generated by this function are handled by the BROWSEDIRCALLBACK function, which is required.

The L_BrowseDir function uses the L_CreateThumbnailFromFile function internally for every file in the directory being browsed. The L_CreateThumbnailFromFile function can be used to manually create the thumbnail for a single specified image file.


Speeding Up 1-Bit Documents

Note:

This topic is for Document/Medical only.

With the LEADTOOLS Document/Medical toolkit, you can improve the load and display performance of 1-bit images that are commonly used for document storage and FAX transmission.

LEADTOOLS achieves this speed improvement by letting you load an image in its RLE-compressed format, where you can work with it as if it were a fully-expanded bitmap. This not only speeds the throughput and storage, but also speeds up the display of large images that are scaled to fit a window. The display improvement is achieved because, internally, it is no longer necessary to decompress all lines of data to display the scaled-down image.

You can take advantage this feature when loading files that are stored in the LEAD 1-Bit, TIFF Group 3 or Group 4, IOCA, WinFax, or raw FAX formats. To see whether a file can be loaded this way, you can call the L_FileInfo function, then check the Flags field in the FILEINFO structure to see if it has a value of FILEINFO_COMPRESSED.

To load a 1-bit image in its compressed format, you can specify a LOADFILE_COMPRESSED flag when calling any of the following functions:

L_LoadFile

L_LoadFileOffset

L_LoadMemory

L_StartFeedLoad

After an image is loaded, you can check the Flags.Compressed field of its BITMAPHANDLE structure to see if the bitmap is compressed. (LEADTOOLS functions maintain this flag, and you should not set it yourself.)

Once a compressed bitmap is loaded, you can use LEADTOOLS functions to access it just as you would any other 1-bit bitmap.

To toggle a 1-bit image between compressed and uncompressed form, call L_ToggleBitmapCompression.

The L_ChangeBitmapCompression function can be used to uncompress bitmaps, compress 1-bit bitmaps using RLE compression, or super compress 1-bit or 24-bit bitmaps.

However, if you create a bitmap yourself using L_CreateBitmap or L_AllocateBitmap, you must specify the storage type as TYPE_COMPRESSED. Also, if necessary, you can use the following low-level functions to access and manipulate the compressed bitmap data:

L_GetBitmapRowColCompressed

L_PutBitmapRowColCompressed

L_GetBitmapRowCompressed

L_PutBitmapRowCompressed

L_ExpandRow

L_CompressRow

If you use a FILEREADCALLBACK function when loading a file, the FILEREAD_COMPRESSED flag will be set in the function's uFlags parameter to indicate that the image data is compressed. In that case, if necessary, you can use the L_ExpandRow function to decompress data in the callback function. To implement the paint-while-load feature, you do not have to expand the data. Instead you can pass the number of lines as a negative value (-nLines) in the L_PaintDCBuffer function's nCount parameter.


FILEINFO Flags

The following are possible values for the Flags field in the FILEINFO structure:

Constant | Meaning
FILEINFO_INTERLACED | [0x00000001] Interlaced file
FILEINFO_PROGRESSIVE | [0x00000002] Progressive file
FILEINFO_HAS_STAMP | [0x00000004] The file includes a stamp image.
FILEINFO_HAS_GLOBALBACKGROUND | [0x00000008] The file has a global background color, specified in the GlobalBackground field of the FILEINFO structure.
FILEINFO_HAS_GLOBALPALETTE | [0x00000010] The file has a global palette, specified in the GlobalPalette field of the FILEINFO structure.
FILEINFO_HAS_GLOBALLOOP | [0x00000020] The GlobalLoop field that determines how many times an animation loops, is valid. If this flag is not set, GlobalLoop field in the FILEINFO structure does not contain valid data.
FILEINFO_COMPRESSED | [0x00000040] The file can be loaded as a 1-bit compressed image. For more information, refer to Speeding Up 1-Bit Documents.
FILEINFO_NOPALETTE | [0x00000080] The file is a grayscale TIF file, without a palette.
FILEINFO_ROTATED | [0x00000100] Image with an extended ViewPerspective
FILEINFO_SIGNED | [0x00000200] Image with signed values for pixels
FILEINFO_LOSSLESSJPEG | [0x00000400] Internal flag, indicating that the JPEG file uses the lossless compression.
FILEINFO_HAS_ALPHA | [0x00000800] The file has alpha channel information.
FILEINFO_FORMATVALID | [0x00001000] Only the format type is valid.
FILEINFO_INFOVALID | [0x00002000] The entire FILEINFO structure is valid.
FILEINFO_LINK | [0x00004000] The file is a Windows 95/NT link.
FILEINFO_IFDVALID | [0x00008000] The IFD field is valid.


Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION Structure

L_FileInfo

L_FileInfoMemory

L_GetComment

L_GetExtFileOption

L_GetPCDResolution

L_GetWMFResolution

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileOffset

L_LoadFileTile

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentMemory

L_ReadFileStamp

L_ReadFileTransforms

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveFile

L_SaveFileOffset

L_SaveFileTile

L_SetComment

L_SetExtFileOption

L_SetLoadInfoCallback

L_SetPCDResolution

L_SetWMFResolution

L_WriteFileStamp

L_WriteFileTransforms


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


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 6 standard tags. The following 3 tags contain scaling information:

ModelTiepointTag = 33922 (0x8482)

ModelPixelScaleTag = 33550 (0x830E)

ModelTransformationTag = 33920 (0x8480)

The following 3 tags contain many extra values. We will refer to these values stored in these 3 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 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 comments and tags. For more information on standard TIFF tags and comments, refer to Implementing TIFF Comments and Tags.

The GeoKeys can be set in preparation for writing or saving files with L_SetGeoKey. These GeoKeys are maintained as a per-thread array of GeoKeys. You can obtain the list of GeoKeys that have been set using L_GetGeoKey.

The user can write the GeoKeys in two ways:

1. | When saving a new image as FILE_GEOTIFF with one of the save functions: L_SaveFile, L_SaveBitmap, etc.
2. | You can update an existing file, using L_WriteFileGeoKey or L_WriteFileMetaData.

You can enumerate the GeoKeys from an existing file using L_EnumFileGeoKeys. For each GeoKeys enumerated by L_EnumFileGeoKeys, an ENUMGEOKEYSCALLBACK function is called.

You can read a particular GeoKey from a file using L_ReadFileGeoKey.


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 L_WindowLevel(pBitmap, WINDOW_LEVEL_PAINT_PROCESS) function 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.


Exif File Extensions

Exif files may, but do not have to, contain extensions. These extensions may contain many types of data. To access this extension data, LEADTOOLS provides the L_ReadFileExtensions. The extensions are kept in an EXTENSIONLIST structure. When the L_ReadFileExtensions function is called, LEADTOOLS will look for the extensions. If they are present, LEADTOOLS will allocate a structure large enough to contain all the extensions.

Two common uses for these extensions are storing an extra stamp and embedding audio data. LEADTOOLS provides functions for getting these two specific types of information. To get extra stamp data stored in the extensions, use the L_LoadExtensionStamp function. To get embedded audio data, use the L_GetExtensionAudio function. To access other types of data from the Exif extensions, the user will have to handle that directly.

When the extension data is no longer needed, it should be freed by calling the L_FreeExtensions function.


Implementing Exif Features

The Exif file format supports more complex comments than other formats. For a list of the comments, refer to Exif File Comments.

This example demonstrates how to handle Exif comments that are not stored as strings. (For a simpler example for saving strings, refer to the L_SetComment function.)

This example does the following:

1. | Loads a bitmap.
2. | Updates the comment array by loading comments from the existing file.
3. | Reverses the image and creates an ASCII CMNT_USERCOMMENT comment that says that the image has been reversed.
4. | Saves the file. (All of the comments are saved, including the one that we updated.)
5. | Reads and displays two of the comments from the saved file. One of them is the comment that we created. The other is comment that uses the Exif RATIONAL data type.
6. | Cleans up the comment array.

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

void TestFunction(HWND hWnd, L_TCHAR *szFilename )
{
L_CHAR L_FAR * pCommentToGet; /* Comment string that we will get */
HGLOBAL hCommentToGet; /* Handle for memory management */
L_INT CommentLength; /* Length of the string */
L_UCHAR CommentToSet[80]; /* Comment string that we will set */
L_CHAR L_FAR * pCommentToSet = CommentToSet;
L_UCHAR szUserComment[80]; /* User comment that we will add */
L_CHAR L_FAR * pUserComment = szUserComment;
L_UINT32 L_FAR * pDistance; /* Pointer for the Exif RATIONAL */
L_UINT32 Numerator, Denominator; /* Components of the Exif RATIONAL */
float fDistance; /* Result of the distance calculation */
L_TCHAR szMessage[256]; /* MessageBox string */

L_TCHAR szBuf[80];
L_INT i; /* Loop counter */
/* Load the bitmap */
L_LoadBitmap (szFilename, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Load the current comments from the file */
for(i = 0 ; i < CMNT_LAST ; i++ )
{
/* Clear the comment */
L_SetComment(i, NULL, 0);
/* Use the return value to get the length of a comment in the file */
CommentLength = L_ReadFileComment(szFilename, i, NULL, 0, NULL);
if (CommentLength > 0)
{
/* Allocate and lock a zero-filled buffer for the comment */
hCommentToGet = GlobalAlloc(GHND, CommentLength);
pCommentToGet = (L_UCHAR L_FAR *)GlobalLock( hCommentToGet );
/* Get the comment from the file */
L_ReadFileComment(szFilename, i, pCommentToGet, CommentLength, NULL);
/* Set the comment to be saved */
L_SetComment(i, pCommentToGet, CommentLength);
/* Unlock and free memory */
GlobalUnlock( hCommentToGet );
GlobalFree(hCommentToGet);
}
}
/* Reverse the image */
L_ReverseBitmap(&LeadBitmap);
/* Create the CMNT_USERCOMMENT comment as a byte array */
L_SetComment(CMNT_USERCOMMENT, NULL, 0);
pUserComment = "The image has been reversed.";
pCommentToSet[0] = 'A';
pCommentToSet[1] = 'S';
pCommentToSet[2] = 'C';
pCommentToSet[3] = 'I';
pCommentToSet[4] = 'I';
pCommentToSet[5] = '\0';
pCommentToSet[6] = '\0';
pCommentToSet[7] = '\0';
for( i = 0; pUserComment[i] != '\0'; i++)
{
pCommentToSet[i+8] = pUserComment[i];
}
pCommentToSet[i+8] = '\0';
/* Set the CMNT_USERCOMMENT comment */
L_SetComment(CMNT_USERCOMMENT, pCommentToSet, strlen(pUserComment) + 9);
/* Save the image as an Exif file */
L_SaveBitmap(szFilename, &LeadBitmap, FILE_EXIF, 24, 0, NULL);
/* Initialize the message string */
szMessage[0] = '\0';
/* Use the return value to get the length of the CMNT_SUBJECTDISTANCE comment */
/* This shows how to translate the Exif RATIONAL data type */
CommentLength = L_ReadFileComment(szFilename, CMNT_SUBJECTDISTANCE, NULL, 0, NULL);
if (CommentLength > 0)
{
/* Allocate and lock a zero-filled buffer for the comment */
hCommentToGet = GlobalAlloc(GPTR, CommentLength);
pCommentToGet = (L_UCHAR L_FAR *)GlobalLock( hCommentToGet );
/* Get the actual comment from the file */
L_ReadFileComment(szFilename, CMNT_SUBJECTDISTANCE, pCommentToGet, CommentLength, NULL);
pDistance = (L_UINT32 L_FAR *)pCommentToGet;
Numerator = pDistance[0];
Denominator = pDistance[1];
fDistance = (float)Numerator / (float)Denominator;
wsprintf (szMessage, TEXT("Subject distance: %.6f\n"),fDistance );
/* Unlock and free memory */
GlobalUnlock( hCommentToGet );
GlobalFree(hCommentToGet);
}
/* Use the return value to get the length of the CMNT_USERCOMMENT comment */
CommentLength = L_ReadFileComment(szFilename, CMNT_USERCOMMENT, NULL, 0, NULL);
if (CommentLength > 0)
{
/* Allocate and lock a zero-filled buffer for the comment */
hCommentToGet = GlobalAlloc(GPTR, CommentLength);
pCommentToGet = (L_UCHAR L_FAR *)GlobalLock( hCommentToGet );
/* Get the actual comment from the file */
L_ReadFileComment(szFilename, CMNT_USERCOMMENT, pCommentToGet, CommentLength, NULL);
/* If the prefix is ASCII, move the pointer and update the message string */
if (strcmp(pCommentToGet,"ASCII")== 0)
{
pCommentToGet = pCommentToGet + 8;
}

wsprintf (szBuf, TEXT("%hs"), pCommentToGet);
lstrcat(szMessage, szBuf);
/* Unlock and free memory */
GlobalUnlock( hCommentToGet );
GlobalFree(hCommentToGet);
}
/* Show the two comments */
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
/* Clear the comments */
for(i = 0 ; i < CMNT_LAST ; i++ )
L_SetComment(i, NULL, 0);
/* Force a repaint */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


Implementing Extended FlashPix Support

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 image formats with the benefits associated with object orientation to make using 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. LEADTOOLS treats the non-image data stored in FlashPix files as comments. 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, such as rotation, shearing, and color manipulation, among others. This data indicates transformations which may be performed on the source image. By storing the transforms, the source image stays in its original state and is transformed, using the stored transforms, at your discretion, only when the file is loaded. A stamp, or thumbnail, provides a small bitmap representation of a FlashPix image. By default, LEADTOOLS saves a stamp of size 96 x 96. This is the largest stamp allowed, even if the user sets larger dimensions.

The FlashPix extended support extends the input/output functionality in LEADTOOLS by providing increased versatility in the handling of color and grayscale images by taking advantage of the complete FlashPix file structure. FlashPix is a newly emerging file format sponsored by Kodak, Microsoft, Hewlett-Packard, and many other industry leaders. LEAD has been asked by this industry group to add the format to LEADTOOLS, and to join the group in supporting this new image format technology. Features of the extended support include "Working with non-image data", "Loading and saving a portion of an image", "Working with thumbnail images in a FlashPix file", and "Working with transformation parameters in an existing FlashPix file" and are discussed in more detail below.

For more information about required files, refer to Files To Be Included With Your Application.

Further details of the new extended FlashPix features are given below:

Working with non-image data

LEADTOOLS treats non-image data as comments. These comments store a variety of information concerning an image. You set comments in a FlashPix file one at a time, using L_SetComment. Once all comments are set, the comments are saved using any function which saves files, such as L_SaveFile or L_SaveBitmap when creating a new file, or L_WriteFileCommentExt when changing a comment in an existing file. L_SetComment, by itself, does not write a comment to a file, it prepares the values for the next save.

Comments are read directly from the file, without having to load the image. With the LEADTOOLS FlashPix extended support you have the ability to read a group of comments such as the "Summary Information Group" (CMNT_FPXSUMMARYINFORMATION), multiple groups of comments such as the "File Source Group" and the "Film Description Group" (CMNT_FPXFILESOURCEGROUP | CMNT_FPXFILMDESCRIPTIONGROUP), or all comments (CMNT_ALL). More information concerning comments and groups of comments may be found in FlashPix File Comments.

Retrieving one or more groups of comments is acheived through the use of L_GetFileCommentSize and L_ReadFileCommentExt, which retrieve the size, in bytes, of the desired comments, and read the comments, respectively. An example of this can be seen under "Example" in the L_ReadFileCommentExt entry. This allows you to retrieve a large number of comments with one function call instead of having to make a separate function call for each comment.

It is also possible to retrieve individual comments such as the image title (CMNT_FPXTITLE), but this must be done using the L_ReadFileComment function. An example of retrieving a single FlashPix comment may be seen in "Example" under the L_GetFileCommentSize entry. It is important to note that 1) comments must be set individually and saved when creating a new file, but can be changed in an existing file using L_WriteFileCommentExt in this package, as outlined above and 2) the L_GetFileCommentSize and L_ReadFileCommentExt only work for FlashPix files in this version.

Loading and saving a portion of a FlashPix file

Loading and processing large images can be very time consuming. Occasionally you may only need to work with a portion of an image. Using L_LoadFileTile you may load only a portion of a FlashPix image by designating the starting position, width and height of the desired region. This allows you to load only part of an image, without having to load the entire image. Once you are finished with the image tile, you may save that tile using L_SaveFileTile.

Working with thumbnail images in a FlashPix file

A thumbnail, or stamp, is a small bitmap representation of a FlashPix image. Reading a thumbnail image stored in a FlashPix file and loading it into a bitmap may be performed using L_ReadFileStamp. To save a stamp into an already existing FlashPix file, use L_WriteFileStamp. The stamp will be written to the page designated in the SAVEFILEOPTION structure. If that page already has a stamp, it will be overwritten; if the page does not exist, the stamp will be written to the last page present in the file. If the file to which the stamp is being written does not exist, an error will be returned.

Working with transformation parameters in an existing FlashPix file

Images may be transformed by rotation, linear translation, shearing, contrast stretching, sharpening, and blurring, among others. In FlashPix files these transforms may be stored with the image itself. This allows the source image to be unchanged, and the transforms to describe the proposed change. By storing both the transforms and the original image, you can elect to load the image either in its original state or in its transformed state. To help you decide how to load the image, L_ReadFileTransforms reads the transforms stored in the image so that you may find out what transform(s) are present. There are four options for loading the image: unchanged, color transforms only, view transforms only and all transforms. If you elect to load the image unchanged, you must make sure both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags have been set in the Flags data member of LOADFILEOPTION structure before loading the file. (Note: By setting these flags you are telling the system to ignore the transforms.) To load the image with only the effects of the color transforms incorporated, you must set the ELO_IGNOREVIEWTRANSFORMS flag, and clear the ELO_IGNORECOLORTRANSFORMS flag. To load the image with only the effects of the viewing transforms incorporated, you must set the ELO_IGNORECOLORTRANSFORMS flag and clear the ELO_IGNOREVIEWTRANSFORMS flag. Finally, to load the image with both the color transforms and the view transforms incorporated, clear both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags. An example of loading an image using each of these four options may be seen in "Example" under L_LoadFile.

To store transforms in a FlashPix file, set the appropriate variables in an instance of FILETRANSFORMS to the desired values and use L_WriteFileTransforms to write them to the FlashPix file. For an example using both L_ReadFileTransforms and L_WriteFileTransforms, see "Example" under the L_ReadFileTransforms entry. Further information concerning transforms may be found in FILETRANSFORMS.


FlashPix Transforms Options

There are four options for loading the image, unchanged, color transforms only, view transforms only and all transforms. If you elect to load the image unchanged, you must make sure both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags have been set in the Flags data member of LOADFILEOPTION structure before loading the file.(Note: By setting these flags you are telling the system to ignore the transforms.) To load the image with only the effects of the color transforms incorporated, you must set the ELO_IGNOREVIEWTRANSFORMS flag, and clear the ELO_IGNORECOLORTRANSFORMS flag. To load the image with only the effects of the viewing transforms incorporated, you must set the ELO_IGNORECOLORTRANSFORMS flag and clear the ELO_IGNOREVIEWTRANSFORMS flag. Finally, to load the image with both the color transforms and the view transforms incorporated, clear both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags. Examples of all four of these options are available in "Example" under L_LoadFile. For more information on transforms in general, refer to FILETRANSFORMS.


Implementing GIF Features

The following features are implemented when loading and saving GIF files:

File Comments

You can get and set comments in GIF files using the L_GetComment, L_SetComment, L_ReadFileComment, and L_ReadFileCommentMemory functions. In these functions, only the CMNT_SZDESC type of comment is supported.

In a multi-page file, these functions reference the last comment encountered before the page specified by the LOADFILEOPTION structure.

Interlaced Files

With an interlaced file, a paint-while-load operation displays the full size of the image as quickly as possible, then fills in the missing rows. For an example of the paint-while-load code, refer to the FILEREADCALLBACK function.

To save a GIF file as an interlaced file, use the SAVEFILEOPTION function to set the ESO_INTERLACED flag before saving the file.

Embedded Text

If plain text is embedded in a GIF file, LEADTOOLS rasterizes the text when loading the file, making the text part of the bitmap.

Animation

To load and play an animated GIF file, you can load a list of bitmaps from the file, then play the list to a target bitmap in a loop that displays each change in the target bitmap. You can also create an animation sequence from scratch and save the bitmaps to create an animated GIF file. For more information, refer to Implementing Animation.


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 L_ReadLoadResolutions function to examine which sizes are available in a file. You can then use the L_SetLoadResolution function to specify which size to load. (The L_GetLoadResolution function only gets the last width and height values that were set with the L_SetLoadResolution function.). When saving a file, you can use L_SetSaveResolution to set resolutions for the next save operation . If you want to get the information saved by the last call to L_SetSaveResolution, you can use L_GetSaveResolution.

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 LOADFILEOPTION to set the number of passes/resolutions to load. Progressive loading will be implemented as follows:

1. | If only one resolution exists in the JBIG File, then the FILEREADCALLBACK function will be called with the image data for that resolution as it is decompressed.
2. | If the image contains more than one resolution and (Passes >= nResolutions, where nResolutions represents the number of resolutions present in the file,) then the FILEREADCALLBACK function will be called with the image data from the lowest resolution available in the file. The data that gets passed to the callback and/or inserted into the bitmap handle 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 nPasses to CALLBACK_WHEN_MEANINGFUL or CALLBACK_ALWAYS has the same effect.
3. | If the image contains more than one resolution and (Passes 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.

JBIG support is available only with the JBIG Module. To unlock JBIG support, L_UnlockSupport must be called with the key found on the JBIG Module Certificate, which will be e-mailed to you. L_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.

JBIG support is available only with the Document/Medical toolkits.


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 FILEJ2KOPTIONS structure for controlling the JPEG 2000 features listed above. To determine the current settings for the JPEG 2000 features, use the L_GetJ2KOptions function. To change the JPEG 2000 features, use the L_SetJ2KOptions function.

To load JPEG 2000 images progressively, set the nPasses member of the LOADFILEOPTIONS structure, just as you would for regular JPEG files.

To get the default settings for the JPEG 2000 features, use the L_GetDefaultJ2KOptions function.

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.


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 PDF initialization directories using the L_SetPDFInitDir function to some location other than the default. To get the current path of the PDF initialization directories, call L_GetPDFInitDir.

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.
2. | Horizontal resolution in dots per inch with a default value of 96.
3. | Vertical resolution in dots per inch with a default value of 96.
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.
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.
6. | Graphics anti-aliasing. Valid values are 1bit(no anti-aliasing) , 2 and 4-bit anti-aliasing. The default value is 1.

You can use the function L_GetPDFOptions to get the default values for control options that are used when loading a file. You can then use the function L_SetPDFOptions to change the values for the control options.

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 created by LEADTOOLS.

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.

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

The plug-in also gives you control over the type of encoding to be used in order to change compressed image data into a text format .The text encoding techniques include:

1. | No text encoding at all.
2. | Use ASCII 85 text encoding algorithm.
3. | Use ASCII HEX text encoding technique.

A number of new flags have been added to the SAVEFILEOPTION structure, in order to specify which type of text encoding to use when saving. For more information, please refer to that structure for more details. In addition, LEAD provides the FILEPDFSAVEOPTIONS structure to let you control the security of and access to the PDF file that is saved. These include user and owner passwords, encryption options, and the capabilities the user of the resulting PDF document will have. To determine the current options used when saving a PDF file, call L_GetPDFSaveOptions. To set the options used when saving a PDF file, call L_SetPDFSaveOptions.

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 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 L_GetPCDResolution function to examine which of the fixed sizes are available in a file. You can then use the L_SetPCDResolution function to specify which of the fixed sizes to load.

LEADTOOLS can read and write FlashPix files.

When loading FlashPix files, there are some newer functions, which can also be used with the PhotoCD files. You can use the L_ReadLoadResolutions function to examine which sizes are available in a file. You can then use the L_SetLoadResolution function to specify which size to load. (The L_GetLoadResolution function only gets the last width and height values that were set with the L_SetLoadResolution function.)

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 | [80] FlashPix, with no compression
FILE_FPX_SINGLE_COLOR | [81] FlashPix, compressed with the single color method, which is a FlashPix-specific compression method
FILE_FPX_JPEG | [82] FlashPix, compressed with JPEG, using the FlashPix default Q factor
FILE_FPX_JPEG_QFACTOR | [83] 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 L_FileInfo function 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 functions for loading files from memory and saving files to memory are not applicable. Also, you cannot use L_RedirectIO or L_FeedLoad to load one of these files.

When working with FlashPix files, the first page may be replaced, but do not delete the first page. LEADTOOLS can read multiple pages in FlashPix files, but other products cannot. Deleting the first page of a FlashPix file may cause other products to return an error.

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.


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 LOADINFOCALLBACK. To do this you must call L_SetLoadInfoCallback() with your defined LOADINFOCALLBACK function. To get the user data previously set using L_SetLoadInfoCallback, use L_GetLoadInfoCallbackData. When calling the file load functions (L_LoadFile, L_LoadBitmap, etc) , it is also necessary to pass a FILEINFO structure with the Format field set to FILE_RAW and the Flags field set to FILEINFO_FORMATVALID. This triggers your LOADINFOCALLBACK function.

Inside the LOADINFOCALLBACK, set the Format field to FILE_RAW. Valid values must be set for the following LOADINFO fields: Width, Height, BitsPerPixel, Offset (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 Flags field. Include an orientation flag in the Flags field to load 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 (2BitsPerPixel) entries of the rgbQuad field.

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 BITMAPHANDLE. When saving raw uncompressed data, the raw data will be correspond to the width, height, bits per pixel, and color order, and view perspective of the image when it was loaded. For example, suppose a Window BMP file that is 300x400 24-bit color is loaded. If this file is 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 parameters in the SAVEFILEOPTION structure. A pointer to a SAVEFILEOPTION structure is an argument to all the file save API functions (L_SaveFile, L_SaveBitmap, etc).

The bits in each byte can be reversed by including the ESO_REVERSEBITS flag in SAVEFILEOPTION.Flags. Each line of raw data can be padded so that the length is a multiple of four bytes by including the ESO_PAD4 flag in SAVEFILEOPTION.Flags. The raw data can be saved at any offset in the file by using the L_SaveFileOffset.

LEAD also supports saving Raw LZW data using the FILE_RAW_LZW file format constant when saving the data. Please note that when this option is used, the view perspective is ignored. The main purpose of this option is to provide support for saving LZW images that are embedded in other file formats such as PDF.

When using L_SaveFile to save RAW data that is 8 bits per pixel or less, it is necessary to pass the OPTIMIZED_PALETTE flag to disable any dithering prior to the save. Note that no palette information is saved in the RAW file. Consequently, after loading RAW data, it is necessary to supply a palette.(see Loading a file with the RAW filter above)

The following examples demonstrate how to load and save raw uncompressed data.

//This example saves a LEAD BITMAPHANDLE as RAW data starting at offset uOffset.
//The data is padded so that each line of bytes is evenly divided by 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.
//The OPTIMIZED_PALETTE flag is used to disable dithering on images with 8 bits or pixel or less.
//Note that when saving a file as RAW data, the view perspective is ignored.
L_INT SaveRawData(L_TCHAR *pszFileName, pBITMAPHANDLE pBitmap, L_UINT32 uOffset)
{
SAVEFILEOPTION SaveFileOption;
L_INT nRet;

memset(&SaveFileOption, 0, sizeof(SAVEFILEOPTION));
SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_PAD4 | ESO_REVERSEBITS;

if (uOffset == 0)
{
nRet = L_SaveFile(pszFileName, pBitmap, FILE_RAW, 0, 0, SAVEFILE_OPTIMIZEDPALETTE, NULL, NULL, &SaveFileOption);
}
else
{
HFILE hFile;
L_UINT32 SizeWritten;

#ifdef UNICODE

hFile = _wcreat(pszFileName, 0);

#else

hFile = _lcreat(pszFileName, 0);

#endif

nRet = L_SaveFileOffset(hFile, uOffset, &SizeWritten, pBitmap, FILE_RAW, 0, 0, SAVEFILE_OPTIMIZEDPALETTE, NULL, NULL, &SaveFileOption);
_lclose(hFile);
}
return nRet;
}

//This example loads RAW data into a LEAD BITMAPHANDLE.
//Raw data parameters are set in the MyLoadInfoCallBack, which gets called
//when the file format is FILE_RAW, or any unrecognized file format.
//The MyLoadInfoCallBack obtains information through a user-defined structure.
//In this example it is RAWLOADDATA
//
//typedef struct tagRAWLOADDATA
//{
// L_INT nWidth; //width of image
// L_INT nHeight; //height of image
// L_INT nBitsPerPixel; //bits per pixel of image--if palettized, a gray palette is generated
// L_INT nViewPerspective; //view perspective of raw data (TOP_LEFT, BOTTOM_LEFT, etc)
// L_INT nOrder; //ORDER_RGB or ORDER_BGR
// L_INT nOffset; //offset into file where raw data begins
// L_INT bPadding; //TRUE if each line of data is padded to four bytes
// L_INT bReverseBits //TRUE if the bits of each byte are reversed
//} RAWLOADDATA, L_FAR *LPRAWLOADDATA;

L_INT L_EXPORT EXT_CALLBACK MyLoadInfoCallBack( L_INT fd, pLOADINFO pInfo, L_VOID L_FAR *pUserData )
{
LPRAWLOADDATA pRawData = (LPRAWLOADDATA)pUserData;

UNREFERENCED_PARAMETER(fd);

pInfo->Format = FILE_RAW;
pInfo->Width = pRawData->nWidth;
pInfo->Height = pRawData->nHeight;
pInfo->BitsPerPixel = pRawData->nBitsPerPixel;
pInfo->XResolution = 150;
pInfo->YResolution = 150;
pInfo->Offset = pRawData->nOffset;

pInfo->Flags = 0;

if (pRawData->bPadding)
pInfo->Flags |= LOADINFO_PAD4;

if (pRawData->nOrder == ORDER_RGB)
pInfo->Flags |= LOADINFO_ORDERRGB;

if (pRawData->bReverseBits)
pInfo->Flags |= LOADINFO_LSB;

switch(pRawData->nViewPerspective)
{
case TOP_LEFT:
pInfo->Flags |= LOADINFO_TOPLEFT;
break;

case BOTTOM_LEFT:
pInfo->Flags |= LOADINFO_REVERSE;
break;

case TOP_RIGHT://BOTTOM_LEFT180
pInfo->Flags |= LOADINFO_BOTTOMLEFT180;
break;

case BOTTOM_RIGHT: //TOP_LEFT180
pInfo->Flags |= LOADINFO_TOPLEFT180;
break;

case RIGHT_TOP: //TOP_LEFT90
pInfo->Flags |= LOADINFO_TOPLEFT90;
break;

case LEFT_BOTTOM: //TOP_LEFT270
pInfo->Flags |= LOADINFO_TOPLEFT270;
break;

case LEFT_TOP: //BOTTOM_LEFT90
pInfo->Flags |= LOADINFO_BOTTOMLEFT90;
break;

case RIGHT_BOTTOM: //BOTTOM_LEFT270
pInfo->Flags |= LOADINFO_BOTTOMLEFT270;
break;
}

//if image is palettized create a grayscale palette
if ( pInfo->BitsPerPixel <= 8)
{
L_INT nColors, i;
nColors = 1 << pInfo->BitsPerPixel;
pInfo->Flags |= LOADINFO_PALETTE;

for (i=0; i<nColors; i++)
{
pInfo->rgbQuad[i].rgbBlue = (i * 256) / nColors;
pInfo->rgbQuad[i].rgbGreen = (i * 256) / nColors;
pInfo->rgbQuad[i].rgbRed = (i * 256) / nColors;
pInfo->rgbQuad[i].rgbReserved = 0;
}
}

return SUCCESS;
}

L_INT LoadRawData(L_TCHAR *pszFile, pBITMAPHANDLE pBitmap, LPRAWLOADDATA pRawLoadData)
{
LOADINFOCALLBACK OldCallback;
L_INT nRet;
FILEINFO FileInfo;

memset(&FileInfo, 0, sizeof(FILEINFO));
FileInfo.Format = FILE_RAW;
FileInfo.Flags = FILEINFO_FORMATVALID;

OldCallback = L_SetLoadInfoCallback(MyLoadInfoCallBack, (L_VOID L_FAR*)pRawLoadData);

nRet = L_LoadFile(
pszFile,
pBitmap, sizeof(BITMAPHANDLE),
0,
ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
NULL,
NULL,
NULL,
&FileInfo);

L_SetLoadInfoCallback(OldCallback, NULL);
return nRet;
}


Working with Markers

General Information

"Metadata" refers to extra information that is stored with an image, but is not necessary for decoding the image. It 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:

Implementing TIFF Comments and 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 Comments and 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 L_LoadMarkers. Although TIFF files do not support markers, LEADTOOLS provides limited support through the use of APP1 Exif markers. When you call L_LoadMarkers 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 L_CreateMarkers function lets you create a collection of markers from scratch. You can then insert markers with L_InsertMarker. After you call L_InsertMarker once, you can call L_EnumMarkers and insert markers using the LEADMARKERCALLBACK callback.

Markers, like tags and comments can be set so that when a file is saved using the L_SaveXXX functions, the markers, tags and/or comments that have been set will be saved too. Set the markers to save using the L_SetMarkers function. Once markers have been set using L_SetMarkers, all the save operations from the current thread will use these markers. If you do not want to save any markers, call L_SetMarkers with the hMarkers parameter set to NULL. To get the markers that were set by the last call to L_SetMarkers, call L_GetMarkers.

Please note that both the L_SetMarkers and L_GetMarkers functions use copies of the list of markers. Therefore, the resources associated with these lists of markers should be freed by calling L_FreeMarkers when the markers are no longer needed.

Markers set using L_SetMarkers can also be written to files using the L_WriteFileComment and L_WriteFileTag functions. The comments or tags being written by these two functions will overwrite any similar comments or tags contained in the markers. The L_WriteFileMetaData function can also be used to write markers, tags and comments to a file. To summarize:

This function: | will write this type of data
L_WriteFileComment | Comments and Markers
L_WriteFileCommentExt | Comments and Markers
L_WriteFileTag | Tags and Markers
L_WriteFileMetaData | 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 L_DeleteMarker function. Currently there is no function for deleting a marker with a certain index because markers are not to be manipulated like an array. When you have more than one marker of the same type, it is because the markers are storing more than 64K of data. For example, if you have multiple APP2 markers in a collection, deleting just one of those APP2 markers will invalidate all the APP2 markers in that collection. If a marker MUST be deleted using it index, call L_EnumMarkers and delete the specific marker or create a new marker collection using L_CreateMarkers and insert all markers except the marker to be deleted.

The L_EnumMarkers function can be used to enumerate and modify a marker collection. It is a powerful function, used internally by most marker manipulation functions. For each marker enumerated by L_EnumMarkers, an ENUMMARKERSCALLBACK function is called. This callback function lets you delete markers from or insert markers to the marker collection being enumerated. This allows you to modify the marker collection passed to the L_EnumMarkers function. To insert a new marker in a marker collection, use L_InsertMarker. You can get a marker by index using the L_GetMarker function.

To determine how many markers are in a collection, call L_GetMarkerCount.

Finally, to create a copy of a marker collection and obtain a handle to the new marker collection, use L_CopyMarkers.


Implementing TIFF Comments and Tags

The TIFF file formats support a number of comments that are saved and loaded using predefined tags. To specify a comment to be saved, you can use the L_SetComment and L_GetComment functions. To read a comment from an existing file, you can use L_ReadFileComment or L_ReadFileCommentMemory. To read a comment from a file at a specified location, use the L_ReadFileCommentOffset function. To write comments to an existing file, use L_WriteFileComment or L_WriteFileCommentExt. For a list of possible comments, refer to TIFF File Comments.

If the comments do not meet your needs, you can define your own tag for saving additional non-raster data in a TIFF file. For example, you may want to define a tag to save annotations.

The TIFF 6.0 Specification sets aside a range of private tags that developers can define. 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 a tag and to specify the data to save in the tag, you can use the L_SetTag and L_GetTag functions. To load the tagged data from a file, you can use L_ReadFileTag or L_ReadFileTagMemory. To write tags to an existing file, or to change existing tags in a file, use L_WriteFileTag.

L_EnumFileTags enumerates all tags in a TIFF or Exif file. For each tag enumerated, the ENUMTAGSCALLBACK function is called. Through this callback function, you can obtain information about, or otherwise process, each tag that is enumerated. You can delete a specified tag from the file using L_DeleteTag.

The LEADTOOLS functions let you save one additional tag in a TIFF file. They are designed for future expansion to more than one tag.


ISIS ASCII tags

These ISIS Scanner Driver Tags are used to retrieve and set information concerning the scanner and scanning properties. They are retrieved and set using L_ISISGetTagASCII and L_ISISSetTagASCII. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For general information on using ISIS, refer to Using Isis to Scan Images.

Value | Meaning
TAG_PAGESIZE | [0x050e] Gets or sets the page size to scan.


ISIS long tags

These ISIS Scanner Driver Tags are used to retrieve and set information concerning the scanner and scanning properties. They are retrieved and set using L_ISISGetTagLong and L_ISISSetTagLong. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For general 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.


ISIS short tags

These ISIS Scanner Driver Tags are used to retrieve and set information concerning the scanner. They are retrieved and set using L_ISISGetTagShort and L_ISISSetTagShort. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For general information on using ISIS, refer to Using Isis to Scan Images.

Value | Meaning
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 these tags 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, not supported by LEAD.
 | 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


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:

Working with 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 L_AddMessageToBitmap function. A message that has been added using the L_AddMessageToBitmap function can be retrieved using the L_ExtractMessageFromBitmap.


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:

TIFF File Comments

GIF File Comments

PNG File Comments

Exif File Comments

DICOM File Comments

JPEG and LEAD File Comments

JPEG 2000 File Comments

FlashPix File Comments


FlashPix File Comments

FlashPix File Comments (non-image data)

FlashPix files can store a large number of comments (non-image data) containing a variety of information. In order to save comments to a FlashPix file, each comment must be set individually using the L_SetComment function. L_SetComment, by itself, does not write a comment to a file, it prepares the values for the next save. Once all comments have been set, they will be saved in one of two ways. When a new image is created, using L_SaveFile or L_SaveBitmap., or in an already existing file, using L_WriteFileCommentExt.

In the LEADTOOLS FlashPix extended support, you have the option of reading single comments, groups of comments, multiple groups of comments, or all comments. L_ReadFileComment can only read one comment at a time. (See "Example" under L_ReadFileComment and L_GetFileCommentSize.) L_ReadFileCommentExt can read a group of comments, multiple groups of comments or all comments. (See "Example" under L_ReadFileCommentExt.) FlashPix comments are listed below:

Further information concerning the organization of FlashPix Comments may be found in FlashPix Structures and FlashPix Comments

Value

Meaning

CMNT_ALL

[0xFFFF] All FlashPix comments.

CMNT_FPXSUMMARYINFORMATION

[0x8001] This group contains the "Summary Information" which contains the following comments:

CMNT_FPXTITLE

[68] Title of the image.

Data type: FlashPixString .

CMNT_FPXSUBJECT

[69] Image subject.

Data type: FlashPixString .

CMNT_FPXAUTHOR

[70] Image author.

Data type: FlashPixString .

CMNT_FPXKEYWORDS

[71] Keywords about the image.

Data type: FlashPixString .

CMNT_FPXCOMMENTS

[72] Comments about the image.

Data type: FlashPixString .

CMNT_FPXOLETEMPLATE

[73] Not used.

Data type: FlashPixString .

CMNT_FPXLASTAUTHOR

[74] Last user to save the image.

Data type: FlashPixString .

CMNT_FPXREVNUMBER

[75] Number of times image saved.

Data type: FlashPixString .

CMNT_FPXEDITTIME

[76] Duration of editing session.

Data type: FlashPixSystemTime .

CMNT_LASTPRINTED

[77] When image was last printed.

Data type: FlashPixSystemTime .

CMNT_FPXCREATEDTM

[78] Time and date of image creation. It should not be altered after it is initially written.

Data type: FlashPixSystemTime .

CMNT_FPXLASTSAVEDTM

[79] Time and date image was saved. Use of this comment is highly recommended with FlashPix.

Data type: FlashPixSystemTime .

CMNT_FPXPAGECOUNT

[80] Not used.

Data type: FlashPixLong .

CMNT_FPXWORDCOUNT

[81] Not used.

Data type: FlashPixLong .

CMNT_FPXCHARCOUNT

[82] Not used.

Data type: FlashPixLong .

CMNT_FPXTHUMBNAIL

[83] Not used

CMNT_FPXAPPNAME

[84] Name of the application which created the image. Use of this comment is strongly recommended with FlashPix. (Default is LEADTOOLS).

Data type: FlashPixString .

CMNT_FPXSECURITY

[85] Not used.

Data type: FlashPixLong .

CMNT_FPXFILESOURCEGROUP

[0x8002] This group contains the "File Source" information. It refers to how the image was created and consists of the following comments:

CMNT_FPXFILESOURCE

[86] Device source of digital file (film scanner, reflection print scanner, digital camera).

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_SOURCE . Possible values are:

FPXENUM_UNIDENTIFIED_SOURCE

FPXENUM_FILM_SCANNER ,

FPXENUM_REFLECTION_PRINT_SCANNER,

FPXENUM_DIGITAL_CAMERA,

FPXENUM_STILL_FROM_VIDEO,

FPXENUM_COMPUTER_GRAPHICS

CMNT_FPXSCENETYPE

[87] Type of scene captured. "Original" scenes are captured directly from real-world scenes. "Second generation" scenes are captured from hard copy images.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_SCENE . Possible values are:

FPXENUM_UNIDENTIFIED_SCENE

FPXENUM_ORIGINAL_SCENE,

FPXENUM_SECOND_GENERATION_SCENE,

FPXENUM_DIGITAL_SCENE_GENERATION

CMNT_FPXCREATIONPATH

[88] Sequence of capture processes used to create the image. The first entry corresponds to the last capture of the scene (also known as the File Source). Capture processes may be digital or analog.

Data type: FlashPixLongArray .

CMNT_FPXNAMEMANRELEASE

[89] Contains the name of the software used to create the FlashPix image, the version of the software and the manufacturer's name.

Data type: FlashPixWideString .

CMNT_FPXUSERDEFINEDID

[90] Identification system created by the user for tracking images.

Data type: FlashPixWideString .

CMNT_FPXORIGINALSHARPNESSAPPROXIMATION

[91] Effective filter width, which indicates the amount of blurring introduced by the components used to generate the digital image (scanner, digital camera, etc.).

Data type: FlashPixFloat .

CMNT_FPXINTELLECTUALPROPERTYGROUP

[0x8004] This group contains the "Intellectual Property" information. It refers to the ownership and copyright of the image (original and digital) and consists of the following comments:

CMNT_FPXCOPYRIGHT

[92] Copyright statement of the Legal Broker for the digital image, including dates and statements of claims.

Data type: FlashPixWideString .

CMNT_FPXLEGALBROKERFORORIGIMAGE

[93] Person or organization holding the legal right to give permissions or impose restrictions on use of the original image. The original image is the analog source which was scanned or the original digital capture of the scene.

Data type: FlashPixWideString .

CMNT_FPXLEGALBROKERFORDIGITALIMAGE

[94] Person or organization holding the legal right to give permissions or impose restrictions on use of the digital image.

Data type: FlashPixWideString .

CMNT_FPXAUTHORSHIP

[95] Camera owner, photographer or image creator.

Data type: FlashPixWideString .

CMNT_FPXINTELLECTUALPROPNOTES

[96] Any other information not included in this group.

Data type: FlashPixWideString .

CMNT_FPXCONTENTDESCRIPTIONGROUP

[0x8008] This group contains the "Content Description" information. It describes the contents of the image and consists of the following comments:

CMNT_FPXTESTTARGETINTHEIMAGE

[97] Information concerning the type of scale or test target captured in the image.

Data type: FlashPixLong .

CMNT_FPXGROUPCAPTION

[98] Subject of a group of images ("My trip to D.C"). The digital file image serves as one member of the group.

Data type: FlashPixWideString .

CMNT_FPXCAPTIONTEXT

[99] Text describing the subject or purpose of the image. May provide additional information concerning the image.

Data type: FlashPixWideString .

CMNT_FPXPEOPLEINTHEIMAGE

[100] Names of the people in the image.

Data type: FlashPixWideStringArray .

CMNT_FPXTHINGSINIMAGE

[101] Objects present in the image. (The Great Pyramid).

Data type: FlashPixWideStringArray .

CMNT_FPXDATEOFORIGINALIMAGE

[102] Date and time the image was originally captured, or, in the case of printed material, the date of publication. This is not the date it was scanned in, that is stored in CMNT_FPXSCANDATE.

Data type: FlashPixWideStringArray .

CMNT_FPXEVENTSINTHEIMAGE

[103] Events depicted in the image. (wedding, vacation, flood, etc.).

Data type: FlashPixWideStringArray .

CMNT_FPXPLACESINTHEIMAGE

[104] Place shown in the image. (New Orleans, map of North Carolina, etc.).

Data type: FlashPixWideStringArray .

CMNT_FPXCONTENTDESCRIPTIONNOTES

[105] Any other information not included in this group.

Data type: FlashPixWideString .

CMNT_FPXCAMERAINFORMATIONGROUP

[0x8010] This group contains the "Camera Information." It describes the camera used to take the picture and consists of the following comments:

CMNT_FPXCAMERAMANUFACTURERNAME

[106] Name of the manufacturer or vender.

Data type: FlashPixWideString .

CMNT_FPXCAMERAMODELNAME

[107] Model name or number of the camera.

Data type: FlashPixWideString .

CMNT_FPXCAMERASERIALNUMBER

[108] Serial number of the camera.

Data type: FlashPixWideString .

CMNT_FPXPERPICTURECAMERASETTINGGROUP

[0x8020] This group contains the "Per Picture Camera Setting" information. It describes the settings used on the camera when the picture was taken and consists of the following comments:

CMNT_FPXCAPTUREDATE

[109] Date and time the image was captured.

Data type: FlashPixSystemTime .

CMNT_FPXEXPOSURETIME

[110] Exposure time used (in seconds) to capture the image.

Data type: FlashPixFloat .

CMNT_FPXFNUMBER

[111] Lens f-number setting used to capture the image.

Data type: FlashPixFloat .

CMNT_FPXEXPOSUREPROGRAM

[112] Exposure program the camera used to capture the image. (Normal, shutter priority, etc).

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_EXPOSURE_PROGRAM . Possible values are:

FPXENUM_UNIDENTIFIED_EXPOSURE_PROGRAM

FPXENUM_MANUAL,

FPXENUM_PROGRAM_NORMAL,

FPXENUM_APERTURE_PRIORITY,

FPXENUM_SHUTTER_PRIORITY,

FPXENUM_PROGRAM_CREATIVE,

FPXENUM_PROGRAM_ACTION,

FPXENUM_PROTRAIT_MODE,

FPXENUM_LANDSCAPE_MODE

CMNT_FPXBRIGHTNESSVALUE

[113] Brightness value, in APEX units, when the image was captured. Generally between -3.00 and 13.00.

Data type: FlashPixFloatArray .

CMNT_FPXEXPOSUREBIASVALUE

[114] Exposure bias, in APEX units, used when the image was captured (how much over exposed or under exposed the image is). Values range from -99.99 to +99.99 with a value of -1.0 indicating the image is 1 stop underexposed.

Data type: FlashPixFloat .

CMNT_FPXSUBJECTDISTANCE

[115] Distance in meters between the front nodal plane of the lens and the point on which the camera was focused when capturing the image.

Data type: FlashPixFloatArray .

CMNT_FPXMETERINGMODE

[116] Metering mode used when capturing the image. This is the camera's way of spatially weighting the scene luminance values to determine sensor exposure.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_METERING_MODE . Possible values are:

FPXENUM_UNIDENTIFED_METERING_MODE

FPXENUM_AVERAGE,

FPXENUM_CENTER_WEIGHTED_AVERAGE,

FPXENUM_SPOT,

FPXENUM_MULTI_SPOT

CMNT_FPXSCENEILLUMINANT

[117] Light source present when image was captured.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_SCENE_ILLUMINANT . Possible values are:

FPXENUM_UNIDENTIFIED_SCENE_ILLUMINANT

FPXENUM_DAYLIGHT,

FPXENUM_FLUORESCENT_LIGHT,

FPXENUM_TUNGSTEN_LAMP,

FPXENUM_FLASH,

FPXENUM_STANDARD_ILLUMINANT_A,

FPXENUM_STANDARD_ILLUMINANT_B,

FPXENUM_STANDARD_ILLUMINANT_C,

FPXENUM_D55_ILLUMINANT,

FPXENUM_D65_ILLUMINANT,

FPXENUM_D75_ILLUMINANT

CMNT_FPXFOCALLENGTH

[118] Lens focal length, in millimeters.

Data type: FlashPixFloat .

CMNT_FPXMAXIMUMAPERATUREVALUE

[119] Maximum possible aperture opening in APEX units. Range is from 1.00 to 99.99.

Data type: FlashPixFloat .

CMNT_FPXFLASH

[120] Tells whether a flash was used or not.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_FLASH . Possible values are:

FPXENUM_FLASH_USE_UNKNOWN

FPXENUM_NO_FLASH_USED,

FPXENUM_FLASH_USED

CMNT_FPXFLASHENERGY

[121] Amount of flash energy, measured in Beam Candle Power Seconds.

Data type: FlashPixFloat .

CMNT_FPXFLASHRETURN

[122] Indicates whether the camera determined the flash to be effective or ineffective at exposure.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_FLASH_RETURN . Possible values are:

FPXENUM_NOT_A_CAMERA_FEATURE_FLASH_RETURN

FPXENUM_SUBJECT_OUTSIDE_FLASH_RANGE,

FPXENUM_SUBJECT_INSIDE_FLASH_RANGE

CMNT_FPXBACKLIGHT

[123] Lighting conditions at exposure. Front lit, back lit 1, back-lit 2.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_BACK_LIGHT . Possible values are:

FPXENUM_NOT_A_CAMERA_FEATURE_BACKLIGHT

FPXENUM_FRONT_LIT,

FPXENUM_BACK_LIT1,

FPXENUM_BACK_LIT2

CMNT_FPXSUBJECTLOCATION

[124] Location of subject in scene. X,Y coordinate pair gives the approximate location of the center of the subject.

Data type: FlashPixFloatArray .

CMNT_FPXEXPOSUREINDEX

[125] Camera's exposure index setting.

Data type: FlashPixFloat .

CMNT_FPXSPECIALEFFECTSOPTICALFILTER

[126] Type of filter(s) used. The order of elements in the array correspond to the order in which the filters were used.

Data type: FlashPixLongArray .

CMNT_FPXPERPICTURENOTES

[126] Other information not provided for by other comments in this group.

Data type: FlashPixWideString .

CMNT_FPXDIGITALCAMERACHARACTERIZATIONGROUP

[0x8040] This group contains the "Digital Camera Characterization" information. It describes the technical aspects of a digital camera and consists of the following comments:

CMNT_FPXSENSINGMETHOD

[128] Type of sensor used by the camera or other capturing device.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_SENSING_METHOD . Possible values are:

FPXENUM_UNDEFINED

FPXENUM_MONOCHROME_AREA_SENSOR,

FPXENUM_ONE_CHIP_COLOR_AREA_SENSOR,

FPXENUM_TWO_CHIP_COLOR_AREA_SENSOR,

FPXENUM_THREE_CHIP_COLOR_AREA_SENSOR,

FPXENUM_COLOR_SEQUENCIAL_AREA_SENSOR,

FPXENUM_MONOCHROME_LINEAR_SENSOR,

FPXENUM_TRILINEAR_SENSOR,

FPXENUM_COLOR_SEQUENCIAL_LINEAR_SENSOR

CMNT_FPXFOCALPLANEXRESOLUTION

[129] Number of pixels per FocalPlaneResolutionUnit in the ImageWidth direction. If this comment is used, the Focal Length must also be stored in CMNT_FPXFOCALLENGTH and the unit of measurement must be stored in CMNT_FPXFOCALPLANERESOLUTIONUNIT.

Data type: FlashPixFloat .

CMNT_FPXFOCALPLANEYRESOLUTION

[130] Number of pixels per FocalPlaneResolutionUnit in the ImageHeight direction. If this comment is used, the Focal Length must also be stored in CMNT_FPXFOCALLENGTH and the unit of measurement must be stored in CMNT_FPXFOCALPLANERESOLUTIONUNIT.

Data type: FlashPixFloat .

CMNT_FPXFOCALPLANERESOLUTIONUNIT

[131] Unit of measurement for the FocalPlaneXResolution and the FocalPlaneYResolution. This value must be stored if information is stored in either CMNT_FPXFOCALPLANEXRESOLUTION or CMNT_FPXFOCALPLANEYRESOLUTION. If information is stored in this comment, the Focal Length must be stored in CMNT_FPXFOCALLENGTH.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_RESOLUTION_UNIT . Possible values are:

FPXENUM_INCHES

FPXENUM_METERS,

FPXENUM_CENTIMETERS,

FPXENUM_MILLIMETERS

CMNT_FPXSPACIALFREQUENCY

[132] Spatial Frequency Response of the camera or capturing device.

Data type: FlashPixSpacialFrequencyResponseBlock .

CMNT_FPXCFAPATTERN

[133] Color filter array geometric pattern of the image sensor. This includes the number of rows needed to define the pattern (cfa_repeat_rows), the number of columns needed to define the pattern (cfa_repeat_columns) and an array of integer values defining the color pattern.

Data type: FlashPixCFAPatternBlock .

CMNT_FPXSPECTRALSENSITIVITY

[134] Pertains to the spectral sensitivity of each channel of the camera used to capture the image.

Data type: FlashPixWideString .

CMNT_FPXISOSPEEDRATINGS

[135] ISO saturation speed rating and the ISO noise-based speed rating.

Data type: FlashPixShortArray .

CMNT_FPXOECF

[136] Opto-Electronic Conversion Function. This is the relationship between the optical input and the value output of an electronic camera.

Data type: FlashPixOECFBlock .

CMNT_FPXFILMDESCRIPTIONGROUP

[0x8080] This group contains the "Film Description" information. It concerns images which originated on photographic film and consists of the following comments:

CMNT_FPXFILMBRAND

[137] Name of film manufacturer, brand name, product code and generation code (Kodak Gold100).

Data type: FlashPixWideString .

CMNT_FPXFILMCATEGORY

[138] Category of film used.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_FILM_CATEGORY . Possible values are:

FPXENUM_UNIDENTIFIED

FPXENUM_NEGATIVE_BW,

FPXENUM_NEGATIVE_COLOR,

FPXENUM_REVERSAL_BW,

FPXENUM_REVERSAL_COLOR,

FPXENUM_CHROMAGENIC,

FPXENUM_INTERNEGATIVE_BW,

FPXENUM_INTERNEGATIVE_COLOR

CMNT_FPXFILMSIZEX

[139] Width of the original film used.

Data type: FlashPixFloat .

CMNT_FPXFILMSIZEY

[140] Height of the original film used.

Data type: FlashPixFloat .

CMNT_FPXFILMSIZEUNIT

[141] Width and height of the film and the unit of measurement.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_RESOLUTION_UNIT . Possible values are:

FPXENUM_INCHES

FPXENUM_METERS,

FPXENUM_CENTIMETERS,

FPXENUM_MILLIMETERS

CMNT_FPXFILMROLLNUMBER

[142] Roll number of the film.

Data type: FlashPixShort .

CMNT_FPXFILMFRAMENUMBER

[143] Frame number from the roll of film.

Data type: FlashPixShort .

CMNT_FPXORIGINALDOCUMENTSCANDESCRIPTIONGROUP

[0x8100] This group contains the "Original Document Scan Description" information. It concerns images which originated as documents or prints and consists of the following comments:

CMNT_FPXORIGINALSCANNEDIMAGESIZE

[144] Width and height of the scanned area and the unit of measurement.

Data type: FlashPixScannedImageSizeBlock .

CMNT_FPXORIGINALDOCUMENTSIZE

[145] Width and height of the original document or photograph.

Data type: FlashPixScannedImageSizeBlock .

CMNT_FPXORIGINALMEDIUM

[146] Medium of the original photo or document.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_ORIGINAL_MEDIUM . Possible values are:

FPXENUM_UNIDENTIFIED_ORIGINAL_MEDIUM

FPXENUM_CONTINUOUS_TONE_IMAGE,

FPXENUM_HALFTONE_IMAGE,

FPXENUM_LINE_ART

CMNT_FPXTYPEOFREFLECTIONORIGINAL

[147] Type of the original document or photograph.

Data type: FlashPixLong . The long value used must belong to the enumerated type FPXTYPE_TYPE_OF_REFLECTION_ORIGINAL . Possible values are:

FPXENUM_UNIDENTIFIED_TYPE_OF_REFLECTION_ORIGINAL

FPXENUM_BW_PRINT,

FPXENUM_COLOR_PRINT,

FPXENUM_BW_DOCUMENT,

FPXENUM_COLOR_DOCUMENT

CMNT_FPXSCANDEVICEPROPERTYGROUP

[0x8200] This group contains the "Scan Device Property" information. It concerns images scanned from reflection prints, documents, photographic slides or negatives and consists of the following comments:

CMNT_FPXSCANNERMANUFACTURERNAME

[148] Manufacturer or vendor of the scanner used to create the image.

Data type: FlashPixWideString .

CMNT_FPXSCANNERMODELNAME

[149] Model name or number of the scanner used to create the image.

Data type: FlashPixWideString .

CMNT_FPXSCANNERSERIALNUMBER

[150] Serial number of the scanner used to create the image, stored as a string.

Data type: FlashPixWideString .

CMNT_FPXSCANSOFTWARE

[151] Name and version of the scanner software or firmware.

Data type: FlashPixWideString .

CMNT_FPXSCANSOFTWAREREVISIONDATE

[152] Revision date of the scanner software or firmware.

Data type: FlashPixDate .

CMNT_FPXSERVICEBUREAUORGNAME

[153] Service bureau, photofinisher or organization performing the scan.

Data type: FlashPixWideString .

CMNT_FPXSCANOPERATORID

[154] Name or ID of the person performing the scan.

Data type: FlashPixWideString .

CMNT_FPXSCANDATE

[155] Date and time the image was originally digitized, it should not be overwritten.

Data type: FlashPixSystemTime .

CMNT_FPXLASTMODIFIEDDATE

[156] The last date on which the scanned data was modified.

Data type: FlashPixSystemTime .

CMNT_FPXSCANNERPIXELSIZE

[157] Pixel size of the scanner, in micrometers.

Data type: FlashPixFloat .


GIF File Comments

When reading or updating GIF comments, you can specify only one type of comment.

Value | Meaning
CMNT_SZDESC | [3] 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 and LEAD File Comments

You can save comments in JPEG 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.

Value | Meaning
CMNT_SZDESC | [3] Description of the image. This a variable-length character string. The maximum length is 64K.

Please note that LEADTOOLS also supports IPTC Comments, which can be saved inside JPEG files. For more information, refer to IPTC Comments.


JPEG 2000 File Comments

You can save comments in JPEG 2000 files. The following comments are supported:

Value | Meaning
CMNT_J2K_BINARY | JPEG 2000 binary comment
CMNT_J2K_LATIN | 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 | [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_SZHOSTCOMP | [4] Computer and operating system in use.
CMNT_SZMAKE | [5] Manufacturer of the equipment used to create the image.
CMNT_SZMODEL | [6] Model name and number of the equipment.
CMNT_SZNAMEOFDOC | [7] Name of the document from which the image was scanned.
CMNT_SZNAMEOFPAGE | [8] Page name from which the image was scanned.
CMNT_SZSOFTWARE | [9] Name and version of the software package used to create the image.


DICOM File Comments

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

AS

angioscopy

BI

biomagnetic imaging

CD

color flow doppler

CF

cinefluorography

CP

culposcopy

CR

computed radiography

CS

cystoscopy

CT

computed tomography

DD

duplex doppler

DF

digital fluoroscopy

DG

diaphanography

DM

digital microscopy

DS

digital subtraction angiography

EC

echocardiography

ES

endoscopy

FA

fluorescein angiography

FS

fundoscopy

LP

laparoscopy

LS

laser surface scan

MA

magnetic resonance angiography

MR

magnetic resonance

MS

magnetic resonance spectroscopy

NM

nuclear medicine

OT

other

PT

positron emission tomography

RG

radiographic imaging

ST

single photon emission computed tomography

TG

thermography

US

ultrasound

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 | [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_SZHOSTCOMP | [4] Computer and operating system in use.
CMNT_SZMAKE | [5] Manufacturer of the equipment used to create the image.
CMNT_SZMODEL | [6] Model name and number of the equipment.
CMNT_SZNAMEOFDOC | [7] Name of the document from which the image was scanned.
CMNT_SZNAMEOFPAGE | [8] Page name from which the image was scanned.
CMNT_SZSOFTWARE | [9] 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

[21] Exif version. LEADTOOLS always writes this value as 0110, meaning version 1.1. Data type: UNDEFINED. Length: 4.

CMNT_SZSUBSECTIME

[38] Decimal extension for seconds that are specified in the CMNT_SZDATETIME field. Data type: ASCII. Length: variable.

CMNT_SZDATETIMEORIGINAL

[22] 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

[39] Decimal extension for seconds that are specified in the CMNT_SZDATETIMEORIGINAL field. Data type: ASCII. Length: variable.

CMNT_SZDATETIMEDIGITIZED

[23] 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

[40] Decimal extension for seconds that are specified in the CMNT_SZDATETIMEDIGITIZED field. Data type: ASCII. Length: variable.

CMNT_SHUTTERSPEEDVALUE

[24] Shutter speed. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.

CMNT_APERTURE

[25] 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

[26] Brightness value. Data type: SRATIONAL. Length: 1.

CMNT_EXPOSUREBIAS

[27] Exposure bias. This is the value for correcting a biased exposure. The unit of measure is APEX. Data type: SRATIONAL. Length: 1.

CMNT_MAXAPERTURE

[28] Minimum lens f-number. Data type: RATIONAL. Length: 1.

CMNT_SUBJECTDISTANCE

[29] Distance from lens to subject (in meters). Data type: RATIONAL. Length: 1.

CMNT_METERINGMODE

[30] 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

[31] 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

[32] Flash On/Off. Possible values are 1 for on or 0 for off. Data type: SHORT. Length: 1.

CMNT_FOCALLENGTH

[33] Focal length, measured in millimeters. Data type: RATIONAL. Length: 1.

CMNT_EXPOSURETIME

[34] Exposure time, expressed as a fraction of a second. Data type: RATIONAL. Length: 1.

CMNT_FNUMBER

[35] 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

[37] 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

[158] Supported FlashPix version (Exif 2.0). LEADTOOLS always writes 0100 here. Data type: UNDEFINED. Length: 4

CMNT_COLORSPACE

[159] 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

[160] 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

[161] 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

[162] 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

[163] 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

[164] 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

[165] 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

[166] 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

[167] 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

[168] 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_FOCALPLANERESOLUTIONUNIT

[245] Focal plane resolution unit (Exif). This is the resolution unit for the CMNT_FOCALPLANEXRESOLUTION and CMNT_FOCALPLANEYRESOLUTION comments. Data type: SHORT. Length: 1. Possible values are:

2 = inch (CMNT_FOCALPLANEXRESOLUTION and CMNT_FOCALPLANEYRESOLUTION are expressed in dots per inch).

3 = cm (CMNT_FOCALPLANEXRESOLUTION and CMNT_FOCALPLANEYRESOLUTION are expressed in dots per cm).

CMNT_SUBJECTLOCATION

[169] 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

[170] Exposure index (Exif) - the image sensor type on the camera or input device. Data type: SHORT. Length: 1

CMNT_SENSINGMETHOD

[171] 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

[172] 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

[173] 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

[174] 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

[227] 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

[228] 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

[229] 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

[230] 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

[231] 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

[232] 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

[233] 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

[234] 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

[235] 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

[236] 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

[237] 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

[238] 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

[239] 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

[240] 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 | [41] 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 | [42] North or south latitude. Possible values are "N" for north and "S" for south. Data type: ASCII. Length: 2.
CMNT_GPSLATITUDE | [43] 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 | [44] East or west longitude. Possible values are "E" for east and "W" for west. Data type: ASCII. Length: 2.
CMNT_GPSLONGITUDE | [45] 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 | [46] 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 | [47] Altitude, in meters, relative to the reference altitude. Data type: RATIONAL. Length: 1.
CMNT_GPSTIMESTAMP | [48] 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 | [49] 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 | [50] 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 | [51] GPS measurement mode. A value of "2" denotes two-dimensional measurement, and "3" denotes three-dimensional measurement. Data type: ASCII. Length: 2.
CMNT_GPSDOP | [52] 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 | [53] Unit for measuring speed. Possible values are "K" for kilometers, "M" for miles, and "N" for knots. Data type: ASCII. Length: 2.
CMNT_GPSSPEED | [54] Speed of the GPS receiver. Data type: RATIONAL. Length: 1.
CMNT_GPSTRACKREF | [55] 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 | [56] Direction of GPS receiver movement. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSIMGDIRECTIONREF | [57] 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 | [58] Direction of photography in the recorded image. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSMAPDATUM | [59] 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 | [60] 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 | [61] 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 | [63] 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 | [64] 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 | [65] Bearing to the destination point. The range of values is 0.00 to 359.00. Data type: RATIONAL. Length: 1.
CMNT_GPSDESTDISTANCEREF | [66] 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 | [67] 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.


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


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


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.


Displaying an Image

The LEADTOOLS functions for painting an image use four rectangles. Two of them, the source rectangle and the destination rectangle, determine how much an image is scaled (zoomed) when it is displayed. The other two, the source clipping rectangle and the destination clipping rectangle, determine which part of an image is painted. For a complete description of the rectangles, with illustrations, refer to the L_PaintDC function.

Other painting functions, which implement features such as transitional effects and region processing, use the same rectangles. For a list of functions, please refer to Displaying Images.

The following topics describe how the painting rectangles can be used to meet particular needs:

Fitting an Image to a Window

Implementing Scrollbars

When painting an image with a display mode of 256 colors or less, you must specify the palette to use. The following topic describes how to do that:

Handling Palette Changes

You can zoom in on an image either by making the display rectangle larger or by making source rectangle smaller (so that it gets only a portion of the bitmap). If you zoom in by making the source rectangle smaller, you must consider the view perspective of the bitmap. For general information about the view perspective, refer to Accounting for View Perspective. For an example of how this can be implemented, refer to Zooming In on a Selection.

LEADTOOLS offers the user draws an overlay bitmaps on top of you main bitmap. For more information, refer to Overlay Overview.

The LEADTOOLS special effects functions give you precise control over a large variety of effects when you paint bitmaps, text, patterns, and shapes to a device context. For details, refer to the following topic:

Implementing Special Effects

LEADTOOLS offers additional options while displaying an image including transparency, dithering options, scale to gray, favor black, halftone, contrast, gamma, intensity, window leveling and paint and transition effects. For a list of functions, please refer to Displaying Images.


Fitting an Image to a Window

To fit an image to a window, you only have to calculate a display rectangle that fits the window's client area, while preserving the image's aspect ratio. The following code snippets from the EZFUNC example program show how this can be done. (This example code includes some palette handling, which is explained more fully in Handling Palette Changes).

Variable declarations:

/* Global declarations */

RECT rWndSize; /* RECT for sizing the window. */
RECT rClientSize; /* RECT for the client area. */
RECT rLeadDest; /* RECT for the destination rectangle for painting. */
RECT rLeadSource; /* RECT for the source rectangle for painting. */
HPALETTE hpalPaint; /* Paint palette handle. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image. */
L_INT DisplayWidth, DisplayHeight; /* Dimensions of the displayed image */
/* Local declarations in the message-processing function */
PAINTSTRUCT ps; /* Structure for processing the WM_PAINT message */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
HDC hdc; /* Device context used with the palette functions */
int AdjustedWidth, AdjustedHeight; /* Adjusted dimensions of the window */

Code that sets the rectangles:

In this snippet from the message-processing function, the bitmap (LeadBitmap) has been loaded, but has not been displayed.

/* Get the current window size and client area */
GetWindowRect(hWnd, &rWndSize);
GetClientRect(hWnd,&rClientSize);
/* Use this user-defined function to fit the displayed image in the client area. */
CalcDisplay ( rClientSize.right, /* Width allowed */
rClientSize.bottom, /* Height allowed */
BITMAPWIDTH(&LeadBitmap), /* Width factor, for aspect ratio */
BITMAPHEIGHT(&LeadBitmap), /* Height factor, for aspect ratio */
NULL, /* Resulting left value, not used */
NULL, /* Resulting top value, not used */
&DisplayWidth, /* Resulting width value */
&DisplayHeight); /* Resulting height value */
/* Adjust the window size to remove blank space at the right or bottom */
AdjustedWidth = rWndSize.right - rWndSize.left + DisplayWidth - rClientSize.right;
AdjustedHeight = rWndSize.bottom - rWndSize.top + DisplayHeight - rClientSize.bottom;
MoveWindow(hWnd, rWndSize.left, rWndSize.top, AdjustedWidth, AdjustedHeight, FALSE);
/* Get the client area of the adjusted window */
GetClientRect(hWnd,&rClientSize);
/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;
/* Set the source rectangle to use the whole bitmap */
SetRect(&rLeadSource, 0, 0, LeadBitmap.Width, LeadBitmap.Height);

Code that paints the image:

case WM_PAINT:

/* Get the handle to the device context */
hdc = BeginPaint (hWnd, &ps);
if (LeadBitmap.Flags.Allocated) /* Do we have an image? */
{
if (hpalPaint) /* If we have a paint palette, select it */
{
hPalette = SelectPalette (hdc, hpalPaint, FALSE);
/* Uncomment this if you do not process WM_QUERYNEWPALETTE */
/* RealizePalette (hdc); */
}
/* Paint the image */
L_PaintDC (hdc,
&LeadBitmap,
&rLeadSource, /* Source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
&ps.rcPaint, /* Dest clip set by WM_PAINT */
SRCCOPY); /* Normal Paint */
if (hpalPaint) /* Return the old palette */
SelectPalette (hdc, hPalette, FALSE);
}
EndPaint (hWnd, &ps); /* Return the DC */
return (0);

Local function for calculating the display rectangle:

/*---[CalcDisplay]-----------------------------------------------------------

Parameters: | WidthAllowed | Maximum width
 | HeightAllowed | Maximum height
 | WidthFactor | For preserving aspect ratio, usually bitmap width
 | HeightFactor | For preserving aspect ratio, usually bitmap height
 | *ResultLeft | Pass NULL if you do not care about centering
 |  | Otherwise, this is updated with the X offset
 | *ResultTop | Pass NULL if you do not care about centering
 |  | Otherwise, this is updated with the Y offset
 | *ResultWidth | Address of the width variable to update
 | *ResultHeight | Address of the height variable to update

Notes:

Use this function to fit a displayed image in a particular space, while preserving the aspect ratio.

--------------------------------------------------------------------------*/

void CalcDisplay (L_INT WidthAllowed, L_INT HeightAllowed,
L_INT WidthFactor, L_INT HeightFactor,
L_INT *ResultLeft, L_INT *ResultTop,
L_INT *ResultWidth, L_INT *ResultHeight)
{
/* Local variables for calculating results */
L_INT Left, Top, Width, Height;
/* See if using the maximum width will make the image too tall */
if(MulDiv(WidthAllowed, HeightFactor, WidthFactor) < HeightAllowed)
{ /* Use the maximum width, and calculate the height and top values */
Left = 0;
Width = WidthAllowed;
Height = MulDiv(Width, HeightFactor, WidthFactor);
Top = (HeightAllowed - Height) / 2;
}
else
{ /* Use the maximum height, and calculate the width and left values */
Top = 0;
Height = HeightAllowed;
Width = MulDiv(Height, WidthFactor, HeightFactor);
Left = (WidthAllowed - Width) / 2;
}
/* Update the top and left results, if the caller did not pass NULL */
if (ResultTop != NULL)
*ResultTop = Top;
if (ResultLeft != NULL)
*ResultLeft = Left;
/* Update the width and height results */
*ResultWidth = Width;
*ResultHeight = Height;
return;
}


Implementing Scrollbars

Scrollbars can be useful whenever the display rectangle is larger than the window's client area. This is an alternative to making the displayed image fit the window. The following instructions describe how to implement scrollbars, turning them on when they are required and turning them off when they are not.

To be as simple and specific as possible, these instructions describe how to modify the EZFUNC example program. If you want to test the sample code, you should make a copy of the EZFUNC program, and modify the copy. The display rectangles used in this program are described in Fitting an Image to a Window.

1. | Modify the window style specified in the InitInstance function so that the window can have scrollbars. You do this by adding the WS_VSCROLL and WS_HSCROLL styles.
2. | Modify the EZFUNC.H file to add global variables that track the scroll range and position, and to add the prototype for a CalcClientMetrics function that aids in calculating scroll ranges and positions.
3. | At the end of the EZFUNC.C file, add the new local function, CalcClientMetrics, which interprets the WM_SIZE message's client area parameters. It is necessary to interpret these parameters because turning on or turning off scrollbars when processing the WM_SIZE message changes the size of the client area.
4. | In the MainWndProc function, add some new local variables to support scrolling.
5. | In the MainWndProc function, modify the WM_CREATE message processing so that the display rectangle does not fit the client area. To keep it simple, initialize the display rectangle to be the same size as the bitmap.
6. | In the MainWndProc function, add code to process WM_SIZE messages. This code shows or hides the scrollbars, as needed, and it adjusts the scrollbar ranges and positions.
7. | In the MainWndProc function, add code to process WM_HSCROLL and WM_VSCROLL messages.

The following topics provide detailed descriptions of these steps, with code that you can copy from the online help and paste into the sample program.


Handling Palette Changes

Whenever you paint an image to a device of 256 colors or less, the current system palette is used. This topic describes how to ensure that the current system palette is the one you want to use.

First, consider that LEADTOOLS gives you the following two choices for painting to a device of 256 colors or less:

A fixed palette (LEAD's fixed palette or the Netscape palette). The fixed palette is the same for any image. It is good to use when more than one image is displayed at the same time and you want all of the images to look good. A fixed palette is always used when painting a high-color or true-color image. The default is the LEAD fixed palette, but you can specify the Netscape palette for 256-color devices.

The bitmap's own palette. This is the best available representation of the image's colors. It may be an optimized palette or a fixed palette, depending on how the image was created.

Generally, the following order of execution ensures that the current system palette is the one you want to use:

1. | Set the display mode to turn on or turn off the fixed palette when painting all images.
 | The following code turns on the LEAD fixed palette:

L_SetDisplayMode (DISPLAYMODE_FIXEDPALETTE, DISPLAYMODE_FIXEDPALETTE);

The following code turns off the LEAD fixed palette:

L_SetDisplayMode (DISPLAYMODE_FIXEDPALETTE, 0);

2.

Create the paint palette. The L_CreatePaintPalette function returns a handle to the palette that you want to use. If the fixed palette is turned on, this is always the handle to the fixed palette. Otherwise it is the best available palette for the specified image. The following code shows the variable declarations and the function call. (The scope of the variables is application dependent; they are shown all together here for simplicity.)

HWND hWnd; /* The current window, usually specified in a function parameter */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image. */
HPALETTE hpalPaint; /* Paint palette handle. */
HDC hdc; /* Device context */

hdc = GetDC (hWnd);
hpalPaint = L_CreatePaintPalette (hdc, &LeadBitmap);

3.

Select and realize the system palette, using the palette handle returned by the L_CreatePaintPalette function. The following shows the required function calls (with none of the normal housekeeping):

SelectPalette (hdc, hpalPaint, FALSE);
RealizePalette (hdc);

4.

Call one of the LEADTOOLS painting functions. The following example uses RECT variables that are defined elsewhere, as described in the comments:

L_PaintDC (hdc,
&LeadBitmap,
&rLeadSource, /* Source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
&ps.rcPaint, /* Destination clipping set by WM_PAINT */
SRCCOPY); /* Normal Paint */

Normally the execution order described above is handled in the code for the windows palette and painting messages: WM_PALETTECHANGED, WM_QUERYNEWPALETTE, and WM_PAINT. The DEMO example example program shows how these can be implemented.

However, in some cases, such as implementing a paint-while-load feature, it is more efficient to create, select, and realize the palette without going through the message processing. For an example, refer to the FILEREADCALLBACK function.

Please note that if you are painting a 16-bit grayscale image to a 24-bit device, you must call L_CreatePaintPalette before you call L_PaintDC.

LEADTOOLS provides two functions for duplicating palettes. The L_DupPalette function duplicates a specified Windows palette. The L_DupBitmapPalette function duplicates the Windows palette of a specified bitmap.


L_ColorResBitmap function's pPalette parameter

LPRGBQUAD pPalette (with CRF_USERPALETTE)

The palette that you supply is an array of RGBQUAD values. The RGBQUAD structure (defined in WINDOWS.H) has four one-byte fields as follows:

rgbBlue
rgbGreen
rgbRed
rgbReserved

L_ColorResBitmap maps the bitmap's pixel values to the palette entries that are not reserved. In the last field of the RGBQUAD structure (rgbReserved), you can enter the following flags to control whether the function maps any pixel values to the entry:

Value | Meaning
RGB_RESERVED | [0x01] Do not map any pixel values to this entry. Use this flag if you want to reserve the entry for later use.
0 | Map pixel values to the color that you supply.


L_ColorResBitmap function's pPalette para(Opt)

LPRGBQUAD pPalette (with CRF_OPTIMIZEDPALETTE)

The palette that you supply is an array of RGBQUAD values. The RGBQUAD structure (defined in WINDOWS.H) has four one-byte fields as follows:

rgbBlue
rgbGreen
rgbRed
rgbReserved

L_ColorResBitmap which maps the bitmap's pixel values to the palette entries, can also fill in some of the entries with optimized colors if you specify CRF_OPTIMIZEDPALETTE in the uFlags parameter. In the last field of the RGBQUAD structure (rgbReserved), you can enter the following flags to control whether the function fills in the entry and whether it maps any pixel values to the entry:

Value | Meaning
RGB_RESERVED | [0x01] Do not map any pixel values to this entry. Use this flag if you want to reserve the entry for later use.
RGB_EMPTY | [0x02] Let the function fill in the color. The function supplies optimized colors to fill the RGB_EMPTY entries, and it maps pixel values to the entries.
0 | Map pixel values to the color that you supply.


Accounting for View Perspective

Many LEADTOOLS functions reference bitmap coordinates, which are often different from the display coordinates of an image. For example, in Windows, the first pixel of a displayed image is always in the top-left corner, but in the bitmap of the same image, the first pixel in memory is often the bottom-left corner of the image. The arrangement of pixels in the bitmap is called the view perspective.

For information on changing bitmap coordinates, based on view perspective, refer to Translating to or from Bitmap Coordinates .

LEADTOOLS keeps track of the view perspective in the ViewPerspective field of the bitmap handle.

The following are possible values.

All toolkits:

TOP_LEFT | [1] Top-left of image is first in memory.
BOTTOM_LEFT | [4] Bottom-left of image is first in memory.

Document/Medical only:

TOP_RIGHT | [2] Top-right of image is first in memory.
BOTTOM_RIGHT | [3] Bottom-right of image is first in memory.
RIGHT_TOP | [6] First row is the right side, first column is top side.
TOP_LEFT90 | [6] Same as RIGHT_TOP, which is TOP_LEFT rotated clockwise by 90 degrees.
LEFT_BOTTOM | [8] First row is the left side, first column is the bottom side.
TOP_LEFT270 | [8] Same as LEFT_BOTTOM, which is TOP_LEFT rotated clockwise by 270 degrees.
BOTTOM_LEFT180 | [2] Same as TOP_RIGHT, which is BOTTOM_LEFT rotated clockwise by 180 degrees.
TOP_LEFT180 | [3] Same as BOTTOM_RIGHT, which is TOP_LEFT rotated clockwise by 180 degrees.
LEFT_TOP | [5] First row is the left side, first column is the top side
BOTTOM_LEFT90 | [5] Same as LEFT_TOP, which is BOTTOM_LEFT rotated clockwise by 90 degrees
RIGHT_BOTTOM | [7] First row is the right side, first column is the bottom side
BOTTOM_LEFT270 | [7] Same as RIGHT_BOTTOM, which is BOTTOM_LEFT rotated clockwise by 270 degrees

The functions that display images account for the view perspective, so that the displayed image has the proper orientation. Nevertheless, when getting the bitmap width and height, you must consider the possibilty that the bitmap may have a rotated view perspective. Also, in some cases, you must translate to or from bitmap coordinates.

Interpreting the Bitmap Width and Height (Document/Medical only)

In the LEADTOOLS Document/Medical toolkit, a bitmap can have a rotated view perspective if you load it with the ELO_ROTATED flag set in the LOADFILEOPTION structure, or if you use the L_RotateBitmapViewPerspective function for fast rotation.

In such cases, the Width and Height fields in the BITMAPHANDLE or FILEINFO structure may not match the displayed orientation of the image. This is an important consideration in any calculations of the image's aspect ratio. LEADTOOLS provides the following macros (in Ltkrnl.h) to help you with the interpretation:

Macro | Usage
ISROTATED(pBitmap) | Takes a pointer to the BITMAPHANDLE and returns TRUE if the view perspective is rotated, or FALSE if it is not.
BITMAPWIDTH(pBitmap) | Takes a pointer to the BITMAPHANDLE and returns the bitmap width that matches the displayed orientation.
BITMAPHEIGHT(pBitmap) | Takes a pointer to the BITMAPHANDLE and returns the bitmap height that matches the displayed orientation.
INFOROTATED(pInfo) | Takes a pointer to the FILEINFO structure and returns TRUE if the view perspective is rotated, or FALSE if it is not.
INFOWIDTH(pInfo) | Takes a pointer to the FILEINFO structure and returns the bitmap width that matches the displayed orientation.
INFOHEIGHT(pInfo) | Takes a pointer to the FILEINFO structure and returns the bitmap height that matches the displayed orientation.

Translating to and from Bitmap Coordinates

In some situations you must translate to or from bitmap coordinates. For example, suppose you are using the L_GetPixelColor function to get the color at the current mouse position. Because L_GetPixelColor uses bitmap coordinates, you must translate the mouse coordinates.

Similarly, if you are working with two bitmaps that have different view perspectives, you may need to translate the bitmap coordinates from one to the other. LEADTOOLS provides the following functions to simplify the translation:

L_PointFromBitmap

L_PointToBitmap

L_RectFromBitmap

L_RectToBitmap

If necessary, you can also use the following function to rotate and flip the bitmap data as necessary to achieve a different view perspective:

L_ChangeBitmapViewPerspective


*Changing Bitmap Coordinates

For the L_PaintDCxxx functions you have the option of setting source and destination rectangles. The source rectangles are in bitmap coordinates and the destination rectangles are in display coordinates (TOP_LEFT).

If the image is not in TOP_LEFT view perspective, then the source rectangle is in the bitmap's view perspective. It is easier to calculate the source rectangle in terms of the display rectangle and then convert it to the bitmap's view perspective using L_RectToBitmap as follows:

//calculate the rcSrc in TOP_LEFT coordinates
….
L_RectToBitmap(pBitmap, TOP_LEFT, &rcSrc);


Zooming In on a Selection

This topic describes how to let the user select an area with a mouse and zoom in on the selected area. In this topic, you learn the following:

How to use the source rectangle with the L_PaintDC function.

How to translate client area coordinates to bitmap coordinates, while accounting for differences in view perspective. For general information about view perspectives, refer to Accounting for View Perspective.

To be as simple and specific as possible, these instructions describe how to modify the EZFUNC example program. If you want to test the sample code, you should make a copy of the EZFUNC program, and modify the copy. The display rectangles used in this program are described in Fitting an Image to a Window.

1. | Step 1 On WIN32 systems, include the GDI library so that we can display an outline of the selection.
2. | Step 2 Modify the EZFUNC.H file to add global variables for tracking coordinates.
3. | Step 3 In the MainWndProc function, add some new local variables to support the GDI functions.
4. | Step 4 In the MainWndProc function, add code to process WM_LBUTTONDOWN messages. This code initializes coordinates for defining two rectangles. One rectangle is relative to the client area and is used with the GDI functions to outline the selection. The other rectangle is relative to the bitmap and is used to zoom in by defining the source rectangle for painting.
5. | Step 5 In the MainWndProc function, add code to process WM_MOUSEMOVE messages. This code outlines the selection using GDI functions .
6. | Step 6 In the MainWndProc function, add code to process WM_LBUTTONUP messages. This code defines the source and destination rectangles for painting, and forces a repaint.
7. | Step 7 In the MainWndProc function, add code to process WM_RBUTTONDOWN messages. This code returns to the display of the full image when the user clicks the right mouse button.

The following topics provide detailed descriptions of these steps, with code that you can copy from the online help and paste into the sample program.


Implementing Transparency

You can implement transparency when doing any of the following:

Animation. When playing an animation, the playback process recognizes the transparent color and the transparency flag specified in the BITMAPHANDLE of each bitmap. The transparent color is loaded from and saved to GIF files. If you save animated files in other multi-page formats, you must maintain this BITMAPHANDLE information yourself. For more information, refer to Implementing Animation.

Paint effects. When painting a bitmap or other object, you can specify a transparent color. Keep in mind that you must use one of the special effects functions, such as L_EfxPaintBitmap, and you must pass the color in a parameter. (For example, you could pass the transparent color that is specified in the BITMAPHANDLE of a GIF image.) For more information about paint effects, refer to Implementing Special Effects.

Region processing. Defining a region in a bitmap makes it possible to treat the area outside the region as transparent. The L_PaintRgnDC function paints only the region that is defined for a bitmap. The L_CombineBitmap function combines only the area inside the region. You can define a region in a number of ways, including specification of a color. 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 Creating a Bitmap Region.

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

When specifying a transparent color, you can use the Windows PALETTEINDEX macro to refer to a particular palette index (where the COLORREF value is >= 0x01000000). Using a palette index for transparency means that one of the remaining colors in the palette can have the same RGB value as the transparent color, without being interpreted as transparent.

L_FeatherAlphaBlendBitmap 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, call L_GetBitmapAlpha 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 L_FeatherAlphaBlendBitmap function as the mask. The following code demonstrates how to do this:

void TestFunction(HWND hWnd, pBITMAPHANDLE pDstBitmap)
{
BITMAPHANDLE MainBitmap; /* Main bitmap */
BITMAPHANDLE AlphaBitmap; /* Alpha channel bitmap */
RGNXFORM XFormToBitmap; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the current region */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nRet;
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap at 16 bits per pixel */
nRet = L_LoadBitmap("TEST.bmp", &MainBitmap, sizeof(BITMAPHANDLE), 16, ORDER_BGR, NULL, NULL);
/* Set XFormToBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormToBitmap.uViewPerspective = TOP_LEFT;
XFormToBitmap.nXScalarNum = BITMAPWIDTH(&MainBitmap);
XFormToBitmap.nXScalarDen = rClientArea.right;
XFormToBitmap.nYScalarNum = BITMAPHEIGHT(&MainBitmap);
XFormToBitmap.nYScalarDen = rClientArea.bottom;
XFormToBitmap.nXOffset = 0;
XFormToBitmap.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create an elliptical region in the AlphaBitmap */
nRet = L_SetBitmapRgnEllipse(&MainBitmap, &XFormToBitmap, &rRgnRect, L_RGN_SET);
/* Create a mask bitmap from the region */
nRet = L_CreateMaskFromBitmapRgn ( &MainBitmap, &AlphaBitmap, sizeof(BITMAPHANDLE) );
/* Update the alpha channel in the main bitmap */
nRet = L_SetBitmapAlpha(&MainBitmap, &AlphaBitmap);
/* Save the bitmap at 16 bits per pixel to keep the alpha channel */
nRet = L_SaveBitmap("TEST.TIF", &MainBitmap, FILE_TIF, 16, 0, NULL);

/* Free the bitmaps */
L_FreeBitmap(&MainBitmap);
L_FreeBitmap(&AlphaBitmap);
/* Load the bitmap that we just saved and get its alpha channel */
nRet = L_LoadBitmap("TEST.TIF", &MainBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
nRet = L_GetBitmapAlpha(&MainBitmap, &AlphaBitmap, sizeof(BITMAPHANDLE));

nRet = L_FeatherAlphaBlendBitmap(pDstBitmap, 0, 0,AlphaBitmap.Width, AlphaBitmap.Height, &MainBitmap, 0, 0, &AlphaBitmap);
L_FreeBitmap(&MainBitmap);
L_FreeBitmap(&AlphaBitmap);
return;

}

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

The annotation Stamp object (ANNOBJECT_STAMP, which includes the different Rubber Stamp tools) and Point object (ANNOBJECT_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 L_AnnSetTransparent function to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). Use the L_AnnSetTransparentColor function to set the color to be used as the transparent color. Use the L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Use the L_AnnGetTransparentColor function to get a value that indicates which color is being used as the transparent color.


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 BITMAPHANDLE.Flags.Transparency to 1 and sets BITMAPHANDLE.Transparency to the transparent color. Please note that if the loaded PNG bitmap is not palettized, then BITMAPHANDLE.Transparency is set to an RGB color. If the loaded PNG bitmap is palettized, BITMAPHANDLE.Transparency is set to 0x010000XX, where XX is the index of the transparent color.

When a bitmap that contains transparency (i.e. BITMAPHANDLE.Transparency is set) 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, L_FeatherAlphaBlendBitmap is a powerful function 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, call L_GetBitmapAlpha 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 L_FeatherAlphaBlendBitmap function 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. For these files, FILEINFO.BitsPerPixel is 8 and FILEINFO.Flags has FILEINFO_HAS_ALPHA set. By default (when passing 0 for nBitsPerPixel when calling the load functions), 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 will be loaded in the alpha channel. LEADTOOLS does not save these 8+8 files.


Minimizing Flicker with Double Buffering

Double buffering is used to reduce flickering when painting windows. In many cases, double buffering is entirely unnecessary, but there are some instances where it can improve the appearance of your application.

For example, there are certain situations when using annotations that "flickering" is very difficult to avoid. One such situation occurs when zooming in very quickly on an annotation. To see this, perform the following steps:

1. | Run the main API annotation demo (annot32.exe)
2. | Load an image
3. | Draw a button annotation
4. | In the View menu, disable double buffering
5. | Hold the "+" key to zoom in very quickly

Note that you can very clearly see the image being painted, and then the annotation over the image. For a fraction of a second, you can see the image under the annotation.

Now enable the double buffering option, and begin zooming. Notice how there is no flickering.

You can very easily add double buffering to your applications by using the following functions.

L_DoubleBufferBegin

L_DoubleBufferCreateHandle

L_DoubleBufferDestroyHandle

L_DoubleBufferEnable

L_DoubleBufferEnd

To use double buffering, first you must create a double buffer handle using L_DoubleBufferCreateHandle. The double buffer handle is an argument for all of the double buffering functions.

Next you must decide which paint operations will be double buffered. All such paint operations must be wrapped in L_DoubleBufferBegin and L_DoubleBufferEnd calls.

The L_DoubleBufferBegin call returns a memory hDC. All subsequent paint operations should use this hDC for painting. To render the contents of the memory hDC, call L_DoubleBufferEnd.

The L_DoubleBufferBegin and L_DoubleBufferEnd calls intelligently manage an internal memory hDC. The memory hDC is only reallocated when necessary.

At any time in your application, you can easily enable/disable the double buffering by calling L_DoubleBufferEnable with appropriate arguments. When the double buffering is disabled, all wrapped paint calls paint directly to the screen. When double buffering is enabled, paints are triggered only by calls to L_DoubleBufferEnd.

When you are finished double buffering, call L_DoubleBufferDestroyHandle to free the internally allocated resources.


Overlay Overview

General information

Overlay bitmaps are separate 1-bit bitmaps that are drawn on top of you main bitmap. Every main bitmap can have up to 17 (MAX_OVERLAYS + 1) overlay bitmaps. The overlays are stored in an array containing MAX_OVERLAYS + 1 entries. Each array entry contains the overlay bitmap and its attributes. The array uses a 0-based index. (That is the index of the first entry is 0.)

For each overlay, the overlay pixels with a value of 0 are considered transparent. The overlay pixels with a value of 1 are considered non-transparent and will be painted using the color set by the use in OVERLAYATTRIBUTES.crColor.

The overlays can be painted automatically by the L_PaintDC function or you can paint them manually using L_PaintDCOverlay. L_PaintDC paints the overlays in ascending index order: The overlay with index 0 is painted first, overlay with index 1 is painted next, etc. If you need to change the order in which the overlays are painted, you must paint them manually with L_PaintDCOverlay. Another option is to rearrange the overlays and make sure that the overlay with index 0 is the overlay you want painted first, and then use L_PaintDC.

Overlay attributes

Each overlay has a number of attributes (or properties), which can be set by the user. These attributes are broken into two categories:

Display attributes

These properties specify how an overlay gets painted:

Origin | The top-left offset, relative to the top-left displayed margin of the bitmap. The offset is in the display view perspective, with the 0,0 being the top-left corner.
Color | The color used to paint bits 1 of the overlay.
Index | Each overlay has an index (0 – MAX_OVERLAYS).
BitPosition | The associated bit plane (valid only for grayscale 8, 12 and 16-bits per pixel bitmaps). Each overlay can be associated with a bitmap bit plane (between 0 and bitmap’s BitsPerPixel – 1). You can specify whether you want to associate each overlay with a bit plane or not. Do not confuse this with Index. The overlay’s associated BitPosition does not have to be the same as the overlay index. This property is valid only if the UseBitPlane flag is set.
AutoPaint flag | Flag which determines whether the overlay is automatically painted by the L_PaintDC functions or not. If set, L_PaintDC will automatically paint this overlay. If not set, L_PaintDC will not automatically paint this overlay. In this case, you might want to paint the overlay manually, using L_PaintDCOverlay.
AutoProcess flag | Flag which determines whether the overlay will be automatically processed when the associated bitmap changes.
 | If set, the overlay will be automatically processed when the associated bitmap is rotated, flipped, reversed, resized, sheared. The left, right and the overlay size will automatically be adjusted to stay on the corresponding bitmap pixels.
 | If not set, the overlay will not be automatically processed when the associated bitmap is rotated, flipped, reversed, resized, sheared.
UseBitPlane flag | Flag that indicates whether the BitPosition attribute should be used or not. If set, BitPosition is a corresponding plane index (0-bitmap bits/pixel – 1). If not set, the BitPosition property is ignored.

DICOM-related attributes

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

Rows | Number of rows in the overlay.
Columns | Number of columns in the overlay.
Type | Indicates whether this overlay represents a region of interest or other graphics.
BitsAllocated | Number of bits allocated in the overlay.
Description | User-defined comments about the overlay.
Subtype | Defined term, which identifies the intended purpose of the overlay type.
Label | A user-defined text string, which may be used to label or name this overlay.
ROIArea | Number of pixels in the Region Of Interest.
ROIMean | Average pixel value in the Region Of Interest.
ROIStandardDeviation | Standard deviation of the pixel values in the Region Of Interest.
NumFramesInOverlay | Number of frames in the overlay. This is required if the overlay data contains multiple frames.
ImageFrameOrigin | Number of the frame of a multi-frame image to which this overlay applies; frames are numbered starting with 1.
ActivationLayer | The layer in which the overlay shall be displayed.

Overlay operations

The overlay array is automatically created the first time you set the attributes or the bitmap for a particular overlay index. The overlay array is automatically freed when the main bitmap is freed. To set the attributes for a specific overlay, use L_SetOverlayAttributes. One or more attributes may be set at a time. TO get the current attributes for a specific overlay, call L_GetOverlayAttributes. The L_GetOverlayCount gets the number of overlays that have been defined.

The overlay bitmaps are independent of the main bitmap. Separate memory is allocated for each overlay bitmap. You can set the overlay bitmap by:

1. | Calling L_SetOverlayBitmap and passing the overlay bitmap.
2. | Having LEADTOOLS generate an overlay bitmap from the bits of a certain bitplane from the main bitmap by calling L_UpdateBitmapOverlayBits and setting SETOVERLAYBITS_FROMBITMAP in uFlags.

To get the overlay bitmap for a specific overlay, call L_GetOverlayBitmap.

You can update the corresponding bitplane in the main bitmap with the bits from the overlay bitmap by calling L_UpdateBitmapOverlayBits and setting the SETOVERLAYBITS_FROMOVERLAY flag. This may be used to preserve a specific bitplane during an image processing function. To prevent a certain image processing function from affecting a bitplane,:

get the bitplane into an overlay bitmap with L_UpdateBitmapOverlayBits(…, SETOVERLAYBITS_FROMBITMAP);

apply the image processing function

restore the desired main bitmap bitplane with L_UpdateBitmapOverlayBits(…, SETOVERLAYBITS_FROMOVERLAY);

To preserve the whole bitplane, make sure the overlay offset is 0,0 and that the overlay has the same size as the overlay bitmap. This is true by default, but if you change the overlay position and size, you must reset them.

The default overlay width is the display bitmap width – the overlay's left offset. The overlay's left offset is set in the OVERLAYATTRIBUTES.ptOrigin.x member. The display width depends on the bitmap’s view perspective and it is the width of the bitmap painted on the screen with a zoom factor of 100%.

The default overlay height is the display bitmap height – the overlay's top offset. The overlay's top offset is set in the OVERLAYATTRIBUTES.ptOrigin.y member.

You can change the size of the overlay bitmap by calling L_SetOverlayBitmap. Note that you can call L_SetOverlayBitmap with an unallocated bitmap. In that case, only the width and height are used from the overlay bitmap.


Implementing Special Effects

The LEADTOOLS special effects functions give you precise control over a large variety of effects when you paint bitmaps, text, patterns, and shapes to a device context.

Painting Bitmaps

To apply a transitional effect when painting a bitmap, you can use L_EfxPaintBitmap or L_EfxEffectBlt, and you can specify the following:

The same source and destination rectangles and ROP codes that are available in other painting functions.

The transitional effect to apply. For a complete list refer to Effect Types.

The speed of the effect. The speed is affected by two parameters: one for granularity (the size of the step) and the other for the delay between steps.

The number of passes to complete the effect. You can call the paint effect function more than once, each time specifying which pass of the total number to paint. The function applies a pattern brush to paint some of the pixels on each pass. The transition to the new image is complete when you finish all of the passes.

A transparent color. The function skips pixels of the specified color.

A wand, which is a line on the leading edge of some effects, such as horizontal or vertical wipes. You can specify the width and color of the wand

Painting Rectangular Areas

You can paint a rectangular area with a solid color, a gradient color transition, or a pattern. The following functions are available:

L_EfxPatternFillRect lets you paint a rectangle with various patterns of lines. You can specify the foreground color and background color. (There are no timed transitional effects.)

L_EfxGradientFillRect lets you paint a rectangle with a gradient color transition. You specify the beginning and ending colors, and the number of steps from one to the other. There are several transition patterns, as described in Effect Gradient Styles. (There are no timed transitional effects.)

L_EfxPaintTransition lets you paint a rectangle with a gradient color transition, and with all of the same controls that are available in the paint effects for bitmaps. You can control the transitional effect, speed, number of passes, transparent color, and wand.

Painting Three-Dimensional Text

You can paint rotated text using L_EfxDrawRotated3dText or unrotated text using L_EfxDraw3dText. For rotated text, you can specify the angle of rotation. With either of the functions, you can also specify the following:

The text string, the font, and the rectangle to use for positioning.

Any of the positioning and style flags listed in Effect Text Style Flags and Effect Text Alignment Flags.

The color of the text, or an image to paint on the face of the text instead of the color.

The color and position of a shadow, if the style requires it.

The color of the border or highlight, if the style requires it.

Painting a Frame

You can use L_EfxDrawFrame to paint a frame. The interior is transparent. The frame, itself, has a three-dimensional apperance. You can specify the following:

The rectangle that defines the frame. You can control whether the frame itself is inside or outside the rectangle.

One of the several inset or raised three-dimensional styles.

Three bands used for the three-dimensional appearance: middle, inner, and outer. For each band you can specify the overall width, and the colors of the band and its highlight and shadow. Usage of the bands, highlights, and shadows depends on the selected three-dimensional style.

Painting a Three-Dimensional Shape

You can use L_EfxDraw3dShape to paint a three-dimensional shape, such as a circle or triangle. For each shape, you can specify the following:

Any of the shapes listed in Effect Shapes.

The background style and color. The style can be transparent, or it can use an opaque or translucent color, or it can use an opaque or translucent tiled image.

The border width, style, and color.

The inner and outer bands that are applied to the border for three-dimensional effects. For each band, you can specify the width, style (raised, inset, or none), and the highlight and shadow colors. The usage of highlights and shadows depends on the style.

The position and color of a shadow.


Using the ImageList Control

LEADTOOLS provides an ImageList control for manipulating and displaying a list of images. When the LTLST dll loads, it registers a window class (LTIMGLISTCLASS) for you. You can then create windows of this class using the LEADTOOLS function L_CreateImageListControl, using the Windows API CreateWindow, or in your application's Resource Script file (.RC) using code such as the following:

CONTROL "",IDC_IMGLIST,LTIMGLISTCLASS,WS_CHILD|WS_BORDER|WS_VISIBLE,10,10,100,100

If you create the control using CreateWindow, or in your application's .RC file, you must make sure the LTLST dll is loaded in your application's InitInstance function. You can use the LEADTOOLS function L_UseImageListControl to insure the dll is loaded.

Once the control has been created, you can send messages to the control to insert items, remove items, update/replace items and sort the items. You can also send messages to change the item display attributes such as scroll style, item spacing, item display size, and how items that have the selected attribute are displayed. You can also send message to export a number of bitmaps from the ImageList Control to a Bitmap List and send a message to insert a list of bitmaps into the ImageList Control. The image list control can automatically select items for you when the user clicks on an item using the mouse, or you can send messages to the control to set an item's selected attribute. For more information, see ImageList Control Messages.

To make sending messages easier, LEADTOOLS also provides function-like macros. For a complete list of available macros, refer to the Ltlst.h file.

The ImageList Control also sends notification messages of certain events to its parent window. These notifications are sent in the form of a WM_COMMAND message. These messages notify the parent window of events such as focus changes, scrolling, click & double-click events, and when an item has been selected by the user. For more information, see ImageList Control Command Notifications.

To destroy the control when your application no longer needs it, you can use the Windows function DestroyWindow.


ImageList Control Command Notifications

The ImageList Control supports the following Command Notifications:

Notification Code | Value
L_ILN_SETFOCUS | 0x100
L_ILN_KILLFOCUS | 0x101
L_ILN_HSCROLL | 0x200
L_ILN_VSCROLL | 0x201
L_ILN_CLICKED | 0x300
L_ILN_DBLCLCK | 0x301
L_ILN_ITEMSEL | 0x400

The ImageList Control's parent window will receive these notifications in the form of a WM_COMMAND message.


ImageList Control Messages

The ImageList Control supports the following Window Messages:

Message

Value

L_ILM_GETSELOPTIONS

WM_USER + 1

L_ILM_SETSELOPTIONS

WM_USER + 2

L_ILM_GETITEMOPTIONS

WM_USER + 3

L_ILM_SETITEMOPTIONS

WM_USER + 4

L_ILM_GETROWCOUNT

WM_USER + 5

L_ILM_GETCOLCOUNT

WM_USER + 6

L_ILM_GETITEMCOUNT

WM_USER + 7

L_ILM_GETITEM

WM_USER + 8

L_ILM_CLEAR

WM_USER + 9

L_ILM_INSERT

WM_USER + 10

L_ILM_INSERTAT

WM_USER + 11

L_ILM_SETITEM

WM_USER + 12

L_ILM_REMOVE

WM_USER + 13

L_ILM_SORT

WM_USER + 14

L_ILM_HITTEST

WM_USER + 15

L_ILM_SCROLLITEMS

WM_USER + 16

L_ILM_ENSUREVISIBLE

WM_USER + 17

L_ILM_GETSELCOUNT

WM_USER + 18

L_ILM_GETSELITEMS

WM_USER + 19

L_ILM_GETBACKCOLOR

WM_USER + 20

L_ILM_SETBACKCOLOR

WM_USER + 21

L_ILM_GETBORDERCOLOR

WM_USER + 22

L_ILM_SETBORDERCOLOR

WM_USER + 23

L_ILM_SELECTALL

WM_USER + 24

L_ILM_GETSCROLLSTYLE

WM_USER + 25

L_ILM_SETSCROLLSTYLE

WM_USER + 26

L_ILM_ITEMSELECTED

WM_USER + 27

L_ILM_GETPAGECOUNT

WM_USER + 28

L_ILM_GETPAGE

WM_USER + 29

L_ILM_ENABLEKEYBOARD

WM_USER + 30

L_ILM_SETDISPLAYFLAGS

WM_USER + 31

L_ILM_SETSELBITMAP

WM_USER + 32

L_ILM_ITEMUNSELECTED

WM_USER + 33

L_ILM_SAVEDATABASE

WM_USER + 34

L_ILM_LOADDATABASE

WM_USER + 35

L_ILM_DRAWITEM

WM_USER + 36

L_ILM_GETVIEWSIZE

WM_USER + 37

L_ILM_GETFIRSTVISIBLE

WM_USER + 38

L_ILM_IMPORTBITMAPLIST

WM_USER + 41

L_ILM_EXPORTBITMAPLIST

WM_USER + 42

L_ILM_SORTEXT

WM_USER + 44


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 another main 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. The Pan Window Callback function will notify the user that the main window should be updated. The Pan Window Callback function will be called after the Pan Window processes a WM_PAINT message, to allow the user to do custom painting or to be notified of interactive Pan Window updates.

The functions provided for working with a PanWindow are:

L_CreatePanWindow

L_DestroyPanWindow

L_UpdatePanWindow

PANWNDCALLBACK callback function


Using the Magnifying Glass

LEADTOOLS provides a "magnifying glass" that can be attached to a window handle. This magnifying glass provides a means of "zooming in" on the image loaded into the window to which it is attached.

Use the "Magnifying Glass" if you want to:

Work with the magnifying glass after passing a callback function to the L_StartMagGlass function; the optional callback is used to handle the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached.

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 attach the magnifying glass to a window, call L_StartMagGlass or L_StartMagGlass. To determine whether a window has a magnifying glass attached to it, call the L_WindowHasMagGlass function. As the magnifying glass is moved over an image, the zoomed - in view is also displayed.

One of three scenarios can be followed when working with magnifying glass:

1.

Work with an ordinary magnifying glass that will be attached to the window and there is no need to write any code to show the magnifying glass or to move it over the image, since this will be handled internally by LEADTOOLS. This scenario can be achieved through calling L_StartMagGlass function but without passing a callback function or setting the MAGGLASS_MANUAL_UPDATE flag.

2.

Work with the magnifying glass after passing a callback function to the L_StartMagGlass function; the optional callback is used to handle the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached. The passed callback function will receive 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 represents the needed pixel colors of the Bitmap parts that the magnifying glass is over it now (Also it is called the non-updated parts of the bitmap). Low-level functions like L_GetPixelColor can then be used to get color information for the non-updated parts of the bitmap. This callback works more efficiently when working with a Client/Server model, available in the Multimedia/Internet toolkits, and using Internet functions to get the needed information. This new color information can then be passed to L_UpdateMagGlass to update the Magnifying Glass zoomed image. The user is involved in this scenario by passing the needed pixel colors by calling the L_UpdateMagGlass function.

If a callback function is passed to L_StartMagGlass, L_UpdateMagGlass must be called in order to paint the zoomed image in the Magnifying Glass display area.

3.

If the MAGGLASS_MANUAL_UPDATE flag was passed to the L_StartMagGlass function, the user will be responsible for handling WM_LBUTTONDOWN, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MOUSEMOVE, WM_SETCURSOR and WM_KILLFOCUS messages instead of handling them internally by LEADTOOLS.

L_ShowMagGlass, L_SetMagGlassPos and L_UpdateMagGlassBitmap functions can be used only when manually updating the Magnifying Glass. L_ShowMagGlass function will show or hide the Magnifying Glass, while the L_SetMagGlassPos function will move the Magnifying Glass to a specified position. The L_UpdateMagGlassBitmap function can be used to update the bitmap that the Magnifying Glass displays in the zoomed display area.

The following can be set using the L_StartMagGlass function:

size of the magnifying glass

shape of the magnifying glass

magnifying glass border (color, thickness, appearance)

magnification level

size of the rectangle used to display the zoomed image

paint characteristics

section of the pixel on which to center the zoomed image

color masks

To update the Magnifying Glass procedure with a new destination rectangle, call L_UpdateMagGlassRect. This should be done anytime the image’s destination rectangle is modified, for example, when scrolling or zooming.

The L_StartMagGlass function lets you set all of the previously listed properties as well as the following:

flags that indicate which colors in the bitmap to display and which to mask

flags that enable or disablethe manual updating of the magnifying glass

an optional callback to handle the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached.

If a callback function is passed to L_StartMagGlass, information about the non-updated parts of the bitmap can be obtained from the callback function. Low-level functions like L_GetPixelColor can then be used to get color information for the non-updated parts of the bitmap. This new color information can then be passed to L_UpdateMagGlass to update the Magnifying Glass zoomed image. This callback function receives information when the left mouse button is pressed or released and when the mouse is moved while the left mouse button is pressed.

If a callback function is passed to L_StartMagGlass, L_UpdateMagGlass must be called in order to paint the zoomed image in the Magnifying Glass display area.

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

L_SetMagGlassPaintOptions gives the user the ability to set the contrast, gamma and intensity for the zoomed area.

after L_StartMagGlass 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 a user-defined callback function of the MAGGLASSOWNERDRAWCALLBACK prototype. In order to use this callback function, the callback function must be set by calling L_SetMagGlassOwnerDrawCallback. 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 discontinue using the MAGGLASSOWNERDRAWCALLBACK to render the Magnifying Glass, call L_SetMagGlassOwnerDrawCallback a second time, with the pfnCallback parameter set to NULL.

When the magnifying glass is no longer needed, call L_StopMagGlass to stop the magnifying glass procedure and to detach it from the window handle.


Using Color Values in LEADTOOLS

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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter. Please note that just because a bitmap has a palette, that does not mean the returned COLORREF value is automatically an index.

In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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. This is not a standard Windows value. Therefore, LEADTOOLS functions will recognize a COLORREF having this format, but Windows functions will not. To use a COLORREF value of this type in a non-LEADTOOLS function, you must do the following:

COLORREF color;

color = L_GetPixelColor(pBitmap, x, y);
if(color & COLORREF_GRAY16)
{
// nonstandard colorref value, convert it to a windows COLORREF
// get an 8 bit gray value corresponding to the 16 bit gray value
L_UCHAR gray = (color & 0xFFFF) >> 8;
// use the standard windows RGB macro to get a windows COLORREF
color = RGB(gray, gray, gray);
}


Vector Images

LEADTOOLS provides support for working with vector images. The most extensive support is available in selected products only. For more information on the functions supported in the Vector Features, refer to the Ltvecdlln.chm file in your LEADTOOLS \Help directory.

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

L_2DGetViewMode

L_2DSetViewMode

L_2DGetViewport

L_2DSetViewport

LEADTOOLS lets you set the color scheme to use when loading AutoCAD files (DXF and DWG). These files can be loaded either Black on White or White on Black. To determine the current color scheme being used by LEADTOOLS, call L_GetAutoCADFilesColorScheme. To set the color shceme to use, call L_SetAutoCADFilesColorScheme.


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

Work with the magnifying glass after passing a callback function to the L_StartMagGlass function; the optional callback is used to handle the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached.

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 window, call the L_CreateZoomView function. To determine whether a window has a zoomed view attached to it, call the L_WindowHasZoomView function. As the source rectangle is moved over an image, the zoomed - in view also changes.

The following can be set using the ZOOMVIEWPROPS structure:

The rectangle describing the source area of the image to be zoomed

The rectangle describing the location of the zoomed view

The zoom factor

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

The border style for the zoomed view, along with border color and pen style

The border style for the source rectangle, along with border color and pen style

Whether callout lines will be used, along with color and pen style

The annotation object to be displayed

Use the L_GetZoomViewProps function to obtain the properties for the specified zoom view.

To change the current options for the specified Zoom View, change the values in the structure pointed to by pZoomViewProps and pass a pointer to the updated structure to L_UpdateZoomView.

To update the Zoom View procedure with a new destination rectangle, call the L_UpdateZoomView function. This should be done anytime the image’s destination rectangle is modified, for example, when scrolling or zooming. This should also be done anytime the source image is changed, for example resized, flipped, etc.

The L_CreateZoomView function lets you set all of the previously listed properties.

Use the L_RenderZoomView function to display the Zoom Views that are attached to the specified window in the specified device context.

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 L_DestroyZoomView to stop the Zoom View procedure and to detach it from the window handle.


Implementing Animation

To load and play an animated GIF file, you can load a list of bitmaps from the file, then play the list to a target bitmap in a loop that displays each change in the target bitmap. You can also create an animation sequence from scratch and save the bitmaps to create an animated GIF file.

The following is an outline of possible steps:

1. | Create and load a bitmap list using L_LoadBitmapList.
2. | Use L_CreateBitmap to create a target bitmap that is the size of the images in the bitmap list.
3. | Use L_CreatePlayback to create an animation playback that references bitmap list and the target bitmap.
4. | In a loop that processes each bitmap in the list, do the following:

a. | Use L_ProcessPlayback to process the current state and get the next state of the playback.
b. | Use L_GetPlaybackUpdateRect to get the update rectangle (the portion of the target bitmap that has changed).
c. | Use L_PaintDC to paint the changed portion of the bitmap. To paint only the changed portion, use the update rectangle as the source clipping rectangle.

The playback loop can have a number of states, and you should only paint the changes in an appropriate state (for example, when the next state is PLAYSTATE_POSTRENDER). For a list of possible states, refer to Animation Playback States.

The DisposalMethod field in the BITMAPHANDLE for the target bitmap determines what happens to the bitmap in the playback loop after rendering and after any wait state, when the next state is PLAYSTATE_POSTDISPOSE. The options are as follows: keep the image as it is, restore the background, or restore the previous image. (Restoring the background is a common option for animation.)

The playback loop goes continuously through the list of bitmaps. If you want to stop at the end of the list, you can exit the loop when the next state is PLAYSTATE_END.

Animated GIF Files

Before you load an animated GIF file, you can use the L_FileInfo function to get the file's global animation information, which is updated in the following FILEINFO fields: Flags, GlobalLoop, GlobalWidth, GlobalHeight, GlobalBackground, and GlobalPalette. You can use these values in the animation playback.

When you load an animated GIF file, using L_LoadBitmapList, the following animation fields in each BITMAPHANDLE are updated with information from the file: Left, Top, Delay, Background, Transparency, and DisposalMethod. These fields are used in the animation playback.

When you save an animated GIF file, using L_SaveBitmapList, these same BITMAPHANDLE fields are saved in the file. In addition, if you want to save the global animation information, you can use the SAVEFILEOPTION structure to set the following fields: Flags, GlobalLoop, GlobalWidth, GlobalHeight, GlobalBackground, and GlobalPalette. Notice that the field names are the same as in the FILEINFO structure (although the values of the Flags field are different).

When loading an AVI file, the same BITMAPHANDLE and FILEINFO fields are updated, but you cannot save an AVI file.

Code Examples

Code examples for supporting functions show how to implement various features. Refer to the following function descriptions:

Function | What the Example Shows
L_ProcessPlayback | This example loads a bitmap list from an animated GIF or AVI file. It then plays the animation, using the current bitmap as the target.
L_AppendPlayback | This example plays an animated GIF or AVI file as it loads the file. The example includes both the calling function and the FILEREADCALLBACK function, which displays the image.
L_CreateBitmapList | This example creates a bitmap list from the current bitmap, rotating each copy by 10 degrees. It defines the rotation fill color as a transparent color, and assigns an animation background color. It then plays the animation, using the current bitmap as the target.
L_GetBitmapListItem | This example changes the hue of bitmaps in a list, then updates the paint palette and the target bitmap's palette for animation playback. When changing the hue, it preserves the transparent color in the last palette entry.

Related Functions

For a summary of the functions for creating and managing a bitmap list, refer to Creating and Maintaining Lists of Images.

For a summary of the animation playback functions, refer to Playing Animated Images.


Animation Disposal Methods

The following are constants for the disposal methods used after rendering each image in an animation playback:

Constant | Meaning
PLAYDISPOSE_NONE | [0] Do nothing.
PLAYDISPOSE_LEAVE | [1] Leave the target bitmap as is.
PLAYDISPOSE_RESTOREBACKGROUND | [2] Restore the background.
PLAYDISPOSE_RESTOREPREVIOUS | [3] Restore the previous image.


Animation Playback States

The following are constants for the animation playback states:

Constant | Meaning
PLAYSTATE_PRECLEAR | [0x0000] The initial state of the playback (index = -1). The target bitmap will be cleared to the Bitmap.Background color on the next call.
PLAYSTATE_POSTCLEAR | [0x0001] Indicates that the target bitmap has been cleared.
PLAYSTATE_PRERENDER | [0x0002] Indicates that the current image will be rendered to the target bitmap on the next call.
PLAYSTATE_RENDER | [0x0003] Indicates that an image has been rendered to the target bitmap.
PLAYSTATE_POSTRENDER | [0x0004] Indicates that an image is in the midst of being rendered to the target bitmap.
PLAYSTATE_WAITINPUT | [0x0005] Indicates that the playback engine is waiting for user input before moving on to PLAYSTATE_PREDISPOSE.
PLAYSTATE_WAITDELAY | [0x0006] Indicates that the engine is waiting for a delayed time before moving on to PLAYSTATE_PREDISPOSE.
PLAYSTATE_WAITINPUTDELAY | [0x0007] Indicates that the engine is waiting for user input and a delayed time before moving on to PLAYSTATE_PREDISPOSE.
PLAYSTATE_PREDISPOSE | [0x0008] Indicates that the current image will be disposed of on the next call.
PLAYSTATE_POSTDISPOSE | [0x0009] Indicates that the current image has been disposed of. The index is incremented after processing this state.
PLAYSTATE_END | [0x000A] Indicates that the playback is past the last image in the list (index = number of images). The playback will loop to index = 0 on the next call with the state set to PLAYSTATE_PRERENDER


Effect Background Styles

The following are possible background styles that you can specify when using the L_EfxDraw3dShape function:

Value | Meaning
EFX_BACKSTYLE_TRANSPARENT | Transparent
EFX_BACKSTYLE_OPAQUE | Opaque
EFX_BACKSTYLE_TRANSLUCENT | Translucent
EFX_BACKSTYLE_TILEDIMAGE | Tiled image
EFX_BACKSTYLE_TRANSLUCENTTILEDIMAGE | Translucent tiled image


Effect Gradient Styles

The following are possible values for the L_EfxGradientFillRect function's uStyle parameter, which specifies the gradient direction (transitioning from one color to another):

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.


Effect Shapes

The following are possible shapes that you can paint using the L_EfxDraw3dShape function:

Value | Meaning
Rectangle class |
EFX_SHAPE_RECTANGLE | Rectangle
EFX_SHAPE_RECTANGLE_ROUNDED | Rounded rectangle
EFX_SHAPE_RECTANGLE_MAX | Number of shapes in this class.

Square class

EFX_SHAPE_SQUARE | Square
EFX_SHAPE_SQUARE_ROUNDED | Rounded square
EFX_SHAPE_SQUARE_MAX | Number of shapes in this class

Parallelogram class

EFX_SHAPE_PARALLELOGRAM_L | Parallelogram left
EFX_SHAPE_PARALLELOGRAM_R | Parallelogram right
EFX_SHAPE_PARALLELOGRAM_T | Parallelogram top
EFX_SHAPE_PARALLELOGRAM_B | Parallelogram bottom
EFX_SHAPE_PARALLELOGRAM_MAX | Number of shapes in this class.

Trapezoid class

EFX_SHAPE_TRAPEZOID_L | Trapezoid left
EFX_SHAPE_TRAPEZOID_R | Trapezoid right
EFX_SHAPE_TRAPEZOID_T | Trapezoid top
EFX_SHAPE_TRAPEZOID_B | Trapezoid bottom
EFX_SHAPE_TRAPEZOID_MAX | Number of shapes in this class.

Circle class

EFX_SHAPE_CIRCLE | Circle
EFX_SHAPE_CIRCLE_90_LT | Circle 90° left-top
EFX_SHAPE_CIRCLE_90_LB | Circle 90° left-bottom
EFX_SHAPE_CIRCLE_90_RT | Circle 90° right-top
EFX_SHAPE_CIRCLE_90_RB | Circle 90° right-bottom
EFX_SHAPE_CIRCLE_180_L | Circle 180° left
EFX_SHAPE_CIRCLE_180_R | Circle 180° right
EFX_SHAPE_CIRCLE_180_T | Circle 180° top
EFX_SHAPE_CIRCLE_180_B | Circle 180° bottom
EFX_SHAPE_CIRCLE_270_LT | Circle 270° left-top
EFX_SHAPE_CIRCLE_270_LB | Circle 270° left-bottom
EFX_SHAPE_CIRCLE_270_RT | Circle 270° right-top
EFX_SHAPE_CIRCLE_270_RB | Circle 270° right-bottom
EFX_SHAPE_CIRCLE_MAX | Number of shapes in this class.

Ellipse class

EFX_SHAPE_ELLIPSE | Ellipse
EFX_SHAPE_ELLIPSE_90_LT | Ellipse 90° left-top
EFX_SHAPE_ELLIPSE_90_LB | Ellipse 90° left-bottom
EFX_SHAPE_ELLIPSE_90_RT | Ellipse 90° right-top
EFX_SHAPE_ELLIPSE_90_RB | Ellipse 90° right-bottom
EFX_SHAPE_ELLIPSE_180_L | Ellipse 180° left
EFX_SHAPE_ELLIPSE_180_R | Ellipse 180° right
EFX_SHAPE_ELLIPSE_180_T | Ellipse 180° top
EFX_SHAPE_ELLIPSE_180_B | Ellipse 180° bottom
EFX_SHAPE_ELLIPSE_270_LT | Ellipse 270° left-top
EFX_SHAPE_ELLIPSE_270_LB | Ellipse 270° left-bottom
EFX_SHAPE_ELLIPSE_270_RT | Ellipse 270° right-top
EFX_SHAPE_ELLIPSE_270_RB | Ellipse 270° right-bottom
EFX_SHAPE_ELLIPSE_MAX | Number of shapes in this class.

Triangle class

EFX_SHAPE_TRIANGLE_EQUILATERAL_L | Equilateral triangle left
EFX_SHAPE_TRIANGLE_EQUILATERAL_R | Equilateral triangle right
EFX_SHAPE_TRIANGLE_EQUILATERAL_T | Equilateral triangle top
EFX_SHAPE_TRIANGLE_EQUILATERAL_B | Equilateral triangle bottom
EFX_SHAPE_TRIANGLE_ISOSCELES_L | Isosceles triangle left
EFX_SHAPE_TRIANGLE_ISOSCELES_R | Isosceles triangle right
EFX_SHAPE_TRIANGLE_ISOSCELES_T | Isosceles triangle top
EFX_SHAPE_TRIANGLE_ISOSCELES_B | Isosceles triangle bottom
EFX_SHAPE_TRIANGLE_RIGHT_LT | Right triangle left-top
EFX_SHAPE_TRIANGLE_RIGHT_LB | Right triangle left-bottom
EFX_SHAPE_TRIANGLE_RIGHT_RT | Right triangle right-top
EFX_SHAPE_TRIANGLE_RIGHT_RB | Right triangle right-bottom
EFX_SHAPE_TRIANGLE_MAX | Number of shapes in this class.

Other polygons class

EFX_SHAPE_OCTAGON | Octagon
EFX_SHAPE_DIAMOND | Diamond
EFX_SHAPE_PENTAGON | Pentagon
EFX_SHAPE_HEXAGON | Hexagon
EFX_SHAPE_LINE | Line
EFX_SHAPE_REGION | Region
EFX_SHAPE_OTHER_MAX | Number of shapes in this class.

Star class

EFX_SHAPE_STAR4 | Star 4 points
EFX_SHAPE_STAR5 | Star 5 points
EFX_SHAPE_STAR8 | Star 8 points
EFX_SHAPE_STAR16 | Star 16 points
EFX_SHAPE_STAR24 | Star 24 points
EFX_SHAPE_STAR32 | Star 36 points
EFX_SHAPE_STAR_MAX | Number of shapes in this class.

Cross class

EFX_SHAPE_CROSS_SMALL | Cross small
EFX_SHAPE_CROSS_MEDIUM | Cross medium
EFX_SHAPE_CROSS_LARGE | Cross large
EFX_SHAPE_CROSS_MAX | Number of shapes in this class.

Arrow class

EFX_SHAPE_ARROW_L | Arrow left
EFX_SHAPE_ARROW_R | Arrow right
EFX_SHAPE_ARROW_T | Arrow top
EFX_SHAPE_ARROW_B | Arrow bottom
EFX_SHAPE_ARROW2_L_AND_R | Arrow2 left and right
EFX_SHAPE_ARROW2_T_AND_B | Arrow2 top and bottom
EFX_SHAPE_ARROW2_L_AND_T | Arrow2 left and top
EFX_SHAPE_ARROW2_L_AND_B | Arrow2 left and bottom
EFX_SHAPE_ARROW2_R_AND_T | Arrow2 right and top
EFX_SHAPE_ARROW2_R_AND_B | Arrow2 right and bottom
EFX_SHAPE_ARROW3_L_AND_T_AND_R | Arrow3 left and top and right
EFX_SHAPE_ARROW3_T_AND_R_AND_B | Arrow3 top and right and bottom
EFX_SHAPE_ARROW3_L_AND_B_AND_R | Arrow3 left and bottom and right
EFX_SHAPE_ARROW3_L_AND_T_AND_B | Arrow3 left and top and bottom
EFX_SHAPE_ARROW4_L_AND_T_AND_R_AND_B | Arrow4 left and top and right and bottom
EFX_SHAPE_ARROW_MAX | Number of shapes in this class.


Effect Text Alignment Flags

The following are possible values for the text alignment that can be applied by L_EfxDraw3dText or L_EfxDrawRotated3dText:

Value | Meaning
EFX_TEXT_LEFT | Left align
EFX_TEXT_HCENTER | Horizontal center align
EFX_TEXT_RIGHT | Right align
EFX_TEXT_TOP | Top align
EFX_TEXT_VCENTER | Vertical center align
EFX_TEXT_BOTTOM | Right align
EFX_TEXT_WORDWRAP | Word-wrapping text


Effect Text Style Flags

The following are possible values for the text style that can be applied by L_EfxDraw3dText or L_EfxDrawRotated3dText:

Value | Meaning
EFX_TEXT_NORMAL | No three-dimensional effect
EFX_TEXT_INSETLIGHT | Inset light
EFX_TEXT_INSETEXTRALIGHT | Inset extra light
EFX_TEXT_INSETHEAVY | Inset heavy
EFX_TEXT_INSETEXTRAHEAVY | Inset extra heavy
EFX_TEXT_RAISEDLIGHT | Raised light
EFX_TEXT_RAISEDEXTRALIGHT | Raised extra light
EFX_TEXT_RAISEDHEAVY | Raised heavy
EFX_TEXT_RAISEDEXTRAHEAVY | Raised extra heavy
EFX_TEXT_DROPSHADOW | Drop shadow
EFX_TEXT_BLOCKSHADOW | Block shadow
EFX_TEXT_OUTLINEBLOCK | Outline block


Effect Transition Filling Styles

The following are possible values for the L_EfxPaintTransition function's uTransition parameter, which specifies the filling style of the effect:

Value | Meaning
Transition pattern class |
EFX_TRANS_SOLID | Solid filling
EFX_TRANS_HORZ_LINE | Horizontal lines
EFX_TRANS_VERT_LINE | Vertical lines
EFX_TRANS_DOWNWARD_DIAG | Downward diagonal lines
EFX_TRANS_UPWARD_DIAG | Upward diagonal lines
EFX_TRANS_CROSS | Cross lines
EFX_TRANS_DIAG_CROSS | Diagonal cross lines
EFX_TRANS_PATTERN_MAX | Number of patterns in this class.

Transition linear gradient class

EFX_TRANS_GRADIENT_LINE_L_TO_R | Line left to right
EFX_TRANS_GRADIENT_LINE_R_TO_L | Line right to left
EFX_TRANS_GRADIENT_LINE_T_TO_B | Line top to bottom
EFX_TRANS_GRADIENT_LINE_B_TO_T | Line bottom to top
EFX_TRANS_GRADIENT_LINE_LT_TO_RB | Line left-top to right-bottom
EFX_TRANS_GRADIENT_LINE_LB_TO_RT | Line left-bottom to right-top
EFX_TRANS_GRADIENT_LINE_RT_TO_LB | Line right-top to left-bottom
EFX_TRANS_GRADIENT_LINE_RB_TO_LT | Line right-bottom to left-top
EFX_TRANS_GRADIENT_LINE2_L_AND_R_TO_C | Line2 left and right to center
EFX_TRANS_GRADIENT_LINE2_C_TO_L_AND_R | Line2 center to left and right
EFX_TRANS_GRADIENT_LINE2_T_AND_B_TO_C | Line2 top and bottom to center
EFX_TRANS_GRADIENT_LINE2_C_TO_T_AND_B | Line2 center to top and bottom
EFX_TRANS_GRADIENT_LINE2_LT_AND_RB_TO_C | Line2 left-top and right-bottom to center
EFX_TRANS_GRADIENT_LINE2_C_TO_LT_AND_RB | Line2 center to left-top and right-bottom
EFX_TRANS_GRADIENT_LINE2_RT_AND_LB_TO_C | Line2 right-top and left-bottom to center
EFX_TRANS_GRADIENT_LINE2_C_TO_RT_AND_LB | Line2 center to right-top and left-bottom
EFX_TRANS_GRADIENT_LINE_MAX | Number of transitions in this class.

Transition angular gradient class

EFX_TRANS_GRADIENT_ANGLE_TO_LT | Angle to left-top
EFX_TRANS_GRADIENT_ANGLE_TO_LB | Angle to left-bottom
EFX_TRANS_GRADIENT_ANGLE_TO_RT | Angle to right-top
EFX_TRANS_GRADIENT_ANGLE_TO_RB | Angle to right-bottom
EFX_TRANS_GRADIENT_ANGLE_FROM_LT | Angle from left-top
EFX_TRANS_GRADIENT_ANGLE_FROM_LB | Angle from left-bottom
EFX_TRANS_GRADIENT_ANGLE_FROM_RT | Angle from right-top
EFX_TRANS_GRADIENT_ANGLE_FROM_RB | Angle from right-bottom
EFX_TRANS_GRADIENT_ANGLE_MAX | Number of transitions in this class.

Transition rectangular gradient class

EFX_TRANS_GRADIENT_RECTANGLE_TO_C | Rectangle to center
EFX_TRANS_GRADIENT_RECTANGLE_FROM_C | Rectangle from center
EFX_TRANS_GRADIENT_RECTANGLE_MAX | Number of transitions in this class.

Transition elliptical gradient class

EFX_TRANS_GRADIENT_ELLIPSE_TO_C | Ellipse to center
EFX_TRANS_GRADIENT_ELLIPSE_FROM_C | Ellipse from center
EFX_TRANS_GRADIENT_ELLIPSE_MAX | Number of transitions in this class.

Transition conical gradient class

EFX_TRANS_GRADIENT_CONE_FROM_L | Cone from left
EFX_TRANS_GRADIENT_CONE_FROM_R | Cone from right
EFX_TRANS_GRADIENT_CONE_FROM_T | Cone from top
EFX_TRANS_GRADIENT_CONE_FROM_B | Cone from bottom
EFX_TRANS_GRADIENT_CONE_FROM_LT | Cone from left-top
EFX_TRANS_GRADIENT_CONE_FROM_LB | Cone from left-bottom
EFX_TRANS_GRADIENT_CONE_FROM_RT | Cone from right-top
EFX_TRANS_GRADIENT_CONE_FROM_RB | Cone from right-bottom
EFX_TRANS_GRADIENT_CONE_MAX | Number of transitions in this class.


Effect Types

The following are possible values for the effect that can be applied by L_EfxEffectBlt, L_EfxPaintBitmap, L_EfxPaintTransition, L_PaintRgnDCEffect or L_PaintDCEffect:

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.


Compressing and Decompressing Buffers

LEADTOOLS provides several functions for compressing and decompressing images in buffers.

To begin the compression process, the L_StartCompressBuffer function must be called. This function initializes the compression engine, sets the characteristics such as compression factor and output type for the compression, and establishes the COMPBUFFCALLBACK callback that will handle the compressed data. Compression is actually carried out by calling L_CompressBuffer. Once the L_CompressBuffer function is called, the COMPBUFFCALLBACK function is called each time the buffer is filled with compressed data, or when the compression is complete. When compression is completed, the data variables and buffers allocated by the L_StartCompressBuffer and L_CompressBuffer functions should be freed by calling L_EndCompressBuffer.

To begin the decompression process, the L_StartDecompressBuffer function must be called. This function initializes the decompression engine and establishes characteristics of the decompression, such as whether strips or tiles will be decompressed, the format of the image, the view perspective, the load order, and where to place the decompressed image. For more information about the decompression characteristics set by this function, refer to the STARTDECOMPRESSDATA structure. For each strip or tile to be decompressed, the L_DecompressBuffer function must be called. When decompression is completed, data variables and buffers allocated by the L_StartDecompressBuffer and L_DecompressBuffer functions should be freed by calling L_StopDecompressBuffer.

TWAIN buffer transfers can return data in raw compressed form. These functions provide a means of decompressing this data. Consequently, these functions only work for certain file types. These file types and the corresponding TWAIN constant are given below:

LEAD file constant | Twain constant
FILE_JPEG | TWCP_JPEG
FILE_RAW_RLE4 | TWCP_RLE4
FILE_RAW_RLE8 | TWCP_RLE8
FILE_RAW_BITFIELDS | TWCP_BITFIELDS
FILE_RAW_PACKBITS | TWCP_PACKBITS
FILE_RAW_CCITT | TWCP_GROUP31D
FILE_FAX_G3_1D | TWCP_GROUP31DEOL
FILE_FAX_G3_2D | TWCP_GROUP32D
FILE_FAX_G4 | TWCP_GROUP4

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

To begin the compression process, the L_EncodeABIC function must be called. This 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 L_DecodeABIC function must be called. This function decompresses the input 1-bit bi-level or 4-bit grayscale ABIC raw data using the ABIC decoder.


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 L_SaveXXX function. For more information about setting the options for saving J2K files, refer to the FILEJ2KOPTIONS structure, L_GetJ2KOptions, or L_SetJ2KOptions.

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 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 API 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 handle.

JPEG 2000 Compliant

LEADTOOLS API 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. For more information on loading RLE compressed images, refer to Speeding up 1-bit Documents.

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.

To allocate storage for a super compressed bitmap, call L_AllocateBitmap. To initialize and allocate a supercompressed bitmap, call L_CreateBitmap.

The L_LoadFile function can be used to load 1-bit, 8-bit or 24-bit images as super compressed.

The L_ChangeBitmapCompression function can be used to super compress 1-bit, 8-bit, or 24-bit bitmaps, as well as, uncompress bitmaps and compress 1-bit bitmaps using RLE compression.


Scanning Images Using TWAIN or ISIS Devices

You can load an image from a TWAIN device, or an ISIS device, such as a scanner, or you can capture an image from a screen. For an overview of the available TWAIN functions, refer to Using TWAIN to Scan Images. For an overview of the available ISIS functions, refer to Using ISIS to Scan Images.

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.


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. The software includes support for ISIS scanning one or more images through its LEADTOOLS L_ISISAcquire and L_ISISAcquireMulti functions, provided an ISIS driver is present. (The LEADTOOLS software does not include ISIS Drivers). L_ISISAcquire loads an image scanned from an ISIS scanner into a bitmap. L_ISISAcquireMulti provides support for multi-page scanning, saving pages in a single or multiple files. The ISISCALLBACK function is provided for additional processing of each scanned page.

Prior to scanning however, other functions must be used to prepare for scanning. L_IsISISAvailable indicates whether ISIS support DLLs are available for use. If so, load the ISIS Scanner Driver using L_ISISLoadDriver. L_ISISSelect displays a dialog box for selecting the desired ISIS driver, if there is more than one. New ISIS drivers can also be added using this dialog box. To set scanner options, call L_ISISSetScanOptions.

LEADTOOLS provides the L_ISISGetTagLong, L_ISISGetTagShort and L_ISISGetTagASCII functions for getting information on the current scanner settings and scanning properties. Certain scanner settings and scanning properties can be changed using L_ISISSetTagLong, L_ISISSetTagShort and L_ISISSetTagASCII. ISIS tags can have multiple values, also called choices. LEADTOOLS provides the L_ISISGetTagASCIIChoice, L_ISISGetTagLongChoice, and L_ISISGetTagShortChoice functions for determining the number of available values/choices and for retrieving individual values/choices for a specified tag. For more information on the tags, refer to ISIS long tags and ISIS short tags.

Finally, when the ISIS driver is no longer needed, unload the driver using L_ISISUnloadDriver.

Note:

Please note that the ISIS driver must be obtained from the scanner manufacturer or from Pixel Translations. The .chn or .chw file must be in your path for ISIS scanning to work.


Using TWAIN to Scan Images

For information on Scanning using TWAIN, refer to the Lttwndlln.chm file in the LEADTOOLS/HELP folder, where "LEADTOOLS" represents the folder in which you installed the toolkit.


Processing an Image

Most image processing functions act on a bitmap in memory, which means that the changes become permanent when you save the image in a file. Some low-level functions act on a buffer that you manage, for example when you process data as it is loaded.

Changing the Data Format

You can change the color resolution (bits per pixel) of an image using a number of high-level and low-level functions. For a list of these functions, refer to Doing Color Expansion or Reduction.

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 provides functions for other color-space models. You can use the high-level L_ColorSeparateBitmap and L_ColorMergeBitmap functions to create and merge color separations using a number of color-space models, including RGB, CMYK, CMY, HSV, and HLS. You can also use the low-level L_ConvertColorSpace function to convert raw data in a buffer from one color-space model to another, including RGB, YUV, CMYK, CMY, YIQ, HSV, and HLS.

Changing the Data Type (Signed / Unsigned)

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, is done by shifting the image data/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:

L_ConvertBitmapUnsignedToSigned shifts the image data based on internal aspects of the bitmap.

L_ShiftMinimumToZero provides the user with the value by which the image data was shifted. This information can be used later, after image processing, to return the image to signed data.

L_ClearNegativePixels sets all negative pixels to 0, therefore creating an unsigned image.

Once signed images have been converted to unsigned images image processing or analysis functions can be performed on the unsigned images. (Most image processing functions 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 functions, there are the following options:

L_ConvertBitmapSignedToUnsigned shifts the image data based on internal aspects of the bitmap.

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

Doing Geometric Transformations

Geometric transformations include resizing, trimming, rotating, shearing, flipping, or reversing a bitmap. Some geometric transformation functions are designed mainly for document imaging. For example, L_DeskewBitmap (Document/Medical only) and L_DeskewBitmapExt (Document/Medical only) let you automatically straighten scanned documents. For resizing any kind of bitmap, L_SizeBitmap provides the most up-to-date options, but you may also find the alternative and low-level functions useful.

LEADTOOLS also provides the L_TransformFile function 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 L_RotateBitmap, L_FlipBitmap or L_ReverseBitmap and then resaving it. It uses the TRANSFORMFILECALLBACK function for processing the file. The TRANSFORMFILECALLBACK function in turn uses the LEADMARKERCALLBACK function for writing any updated markers within the file. For more information, refer to L_TransformFile, TRANSFORMFILECALLBACK and LEADMARKERCALLBACK. The L_DisplaceMapBitmap function displaces bitmap pixels horizontally and vertically according to the values of the displacement map image. The L_PerspectiveBitmap function gives a bitmap a 3-D depth, as if it exists on a flat plane and has been skewed into a different shape.

For a list of functions in this group, refer to Raster Image Functions: Doing Geometric Transformations. For information about memory allocation when a bitmap gets bigger, refer to Resizing Considerations.

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

Adding Another Image to a Bitmap

The L_CombineBitmap function 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 regions in either or both of the bitmaps, and if you do, the function affects only the intersection of the regions. The L_CombineBitmapExt extends the capabilities of the L_CombineBitmap function by letting the user combine bitmaps of different bits per pixel and specify which color planes to use when combining the bitmaps. For information about regions, refer to Defining and Using a Bitmap Region.

Source and destination bitmaps may be combined by warping all or part of a source bitmap into part of a destination bitmap. To combine images in this manner, use L_CombineBitmapWarp.

The L_UnderlayBitmap function 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.

LEADTOOLS provides several functions for picturizing an image. The L_PicturizeBitmap function replaces an image with a new image created by combining images present in a specific directory. L_PicturizeBitmapList replaces an image with a new image created by combining images present in a bitmap list. The L_PicturizeBitmapSingle function picturizes an image using various versions of a single image.

Two bitmaps can also be blended by combining the images with an opacity value. The L_AlphaBlendBitmap function combines two bitmaps with a fixed opacity value to create a new blended image. The L_FeatherAlphaBlendBitmap function combines two bitmaps with feathering by using a variable opacity that depends on a fade mask. A fade mask bitmap can be created using the L_CreateFadedMask function.

Borders and frames may be added to a bitmap using the L_AddBorder and L_AddFrame functions.

The L_BumpMapBitmap function lets you combine a bitmap with a bump image to create a three-dimensional texture pattern.

The L_CanvasBitmap function applies an image as an overlay for another image.

A number of other functions let you get and put pixel data. For example, you can fill a bitmap with a color, and you can get and put individual pixel values. For a list of functions, refer to Getting and Setting Pixel Values.

Treating the bitmap as a device context opens up many possibilities. The L_CreateLeadDC function lets you get the device context. You can then use Windows GDI functions to draw lines, text, or images on the bitmap. You can also use the LEADTOOLS special effects functions to add three-dimensional shapes or text, or to combine images in interesting ways. For details, refer to Implementing Special Effects.

L_TextureAlphaBlendBitmap combines image data from pBitmapMask and pBitmapUnderlay with an underlay effect. The result is used as a fade mask that will be used to combine pBitmapSrc and pBitmapDst with variable opacity. The result is combined again with pBitmapDst using a constant opacity (using nOpacity). The L_BricksTextureBitmap function creates a brick texture that makes the image look like it has been drawn on a brick wall.

The L_DigitalSubtractBitmap function does not combine images, but subtracts the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps.

Comparing Images

Two bitmaps or parts of two bitmaps can be compared using the L_CorrelationBItmap function. This function 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 L_CorrelationListBitmap function compares the images in hCorList with all the areas of the same dimensions in pBitmap and finds those portions that match according to the measure of correlation.

Extracting Bitmaps From A Series

The L_SliceBitmap function is designed to extract the individual slices from radiographic scanned film.


Resizing Considerations

Resizing a bitmap physically changes its width and height, and changes the number of bytes required to store the image. This is different from zooming, which mathematically changes the displayed size of the image, without affecting the stored data.

When resizing an image to enlarge it, LEADTOOLS must find enough room to hold the resulting image. If necessary, LEADTOOLS uses virtual memory (disk space treated as memory). On a 32-bit system, it uses the system's virtual memory.

On a 16-bit system, it looks for memory as follows:

1. | First it checks the Windows system resources (including 386 Enhanced virtual memory).
2. | If the Windows system resources are insufficient, it checks the available space on the disk specified for temporary files (defined using the TEMP or TMP environment variable).

If there is not enough memory or virtual memory to hold the resulting image, the function returns an error code.


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 L_SetPaintIntensity, L_SetPaintContrast, and L_SetPaintGamma functions. These functions 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 functions can be more useful than the image processing functions 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 L_ChangeBitmapIntensity, L_ChangeBitmapContrast, and L_GammaCorrectBitmap or L_GammaCorrectBitmapExt. If you use these functions, the changes become permanent when you save the bitmap in a file.

The L_AddBitmaps function can be used to improve the brightness of an image by adding bitmaps within a bitmap list. The bitmaps in the list consist of several "versions" of the same view or image.

The L_AddWeightedBitmaps function can be used to improve the brightness of an image by adding bitmaps within a bitmap list. Typically, you would call this function for a series of images taken for the same object at short intervals. This function can also be used to obtain an image as the sum of several weighted images.

The L_MultiplyBitmap function 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.

The L_AdaptiveContrastBitmap function performs adaptive contrast enhancement (ACE) to areas that are originally low in contrast.

The L_ColorIntensityBalance function changes the distribution of the red, green, or blue channels.

The L_ContBrightIntBitmap function applies brightness, contrast and intensity adjustments to enhance the image tonal range.

The L_ChangeHueSatIntBitmap function can be used to change the hue, saturation and brightness of all or specified colors in the image. This function combines the functionality found in the L_ChangeBitmapHue, L_ChangeBitmapSaturation, and L_ChangeBitmapIntensity functions 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 L_MathFunctionBitmap function 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.

When working with DICOM files, you can remap pixel values using a lookup table, or by applying a linear transformation using L_ApplyModalityLUT or L_ApplyLinearModalityLUT, respectively. You can also set up window leveling options for a bitmap using a lookup table or a linear transformation using L_ApplyVOILUT or L_ApplyLinearVOILUT, respectively.

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 L_HistoContrastBitmap function is similar to the ordinary L_ChangeBitmapContrast function, except that it uses a bitmap-specific middle value. The ordinary contrast function raises all intensity values above 128 and lowers all values below 128. The L_HistoContrastBitmap function 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 functions, you pass a parameter to indicate how much to increase the contrast.

The L_StretchBitmapIntensity function improves the contrast of a flat image, while preserving the original number of different intensity values. Other contrast functions, where you specify the increase, can lose values at the top and bottom of the scale. This function, 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 function has no effect.

The L_LocalHistoEqualizeBitmap function 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.

The L_HistoEqualizeBitmap function is often the most effective function for bringing out hidden details through contrast improvement. Like the L_StretchBitmapIntensity function, 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 L_LightControlBitmap lightens or darkens all or part of a bitmap by remapping the pixel values. This function remaps the pixel values of the bitmap across the full range of available pixel values, in order to achieve the new average values passed in puLowerAvr, puAverage and puUpperAvr.

The L_AutoColorLevelBitmap function darkens dark values and lightens light values, enhancing shadows and brightening the image automatically.

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

To create your own histogram-based function, you can use the L_GetBitmapHistogram function to get a bitmap's histogram. You can then manipulate the histogram to create a lookup table and call the L_RemapBitmapIntensity function to change the bitmap's intensities through the lookup table. The L_GetFunctionalLookupTable and L_GetUserLookupTable functions provide a means of programmatically updating lookup tables before calling L_RemapBitmapIntensity.

To get the histogram for a 12 or 16-bit grayscale image, call L_GetBitmapHistogram. Please note that support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

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 functions automatically change the values of all planes, but if you create your own function, the decision is up to you. With the L_GetBitmapHistogram and L_RemapBitmapIntensity functions, you can manipulate an individual color plane, or you can manipulate all color planes by specifying the master channel.

With color images, you can preserve more natural colors by first using the L_ColorSeparateBitmap function to do an HSV separation. You can then manipulate the value plane and recombine the color planes with the L_ColorMergeBitmap function.

In HSV color space, a color is represented by a hue, a saturation (amount of white) and a value (amount of darkness). These can be remapped using the L_RemapBitmapHue function. To convert between the HSV and RGB color space, use the L_HSVtoRGB and the L_RGBtoHSV functions.

Special Functions

The L_DynamicBinaryBitmap function 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 L_MultiScaleEnhancementBitmap function wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).

The L_SubtractBackgroundBitmap is useful, especially with medical images and grayscale bitmaps, in correcting nonuniform brightness. This function 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 function includes the functionality similar to that of the L_MultiplyBitmap in order to include the capability for increasing the brightness of the final image.


Removing Noise

[Document/Medical only] The L_DespeckleBitmap function is designed specifically for removing specks from 1-bit images, such as FAX transmissions or scanned documents.

L_MedianFilterBitmap is an effective general function for removing salt-and-pepper noise from any kind of image. You control the strength of the function by specifying the size of the neighborhood (the surrounding pixels used for calculating the median value). This function causes minimal blurring of the image.

The L_AverageFilterBitmap function can be used to remove uniform and Gaussian noise, but there is more blurring of the image than with the median filter. You control the strength of the function by specifying the size of the neighborhood (the surrounding pixels used for calculating the arithmetic mean).

The L_AddBitmaps function can be used to average the bitmaps in a list, eliminating random noise contained in the images.

The L_AddWeightedBitmaps function can be used to average the bitmaps in a list, eliminating random noise contained in the images. Typically, you would call this function for a series of images taken for the same object at short intervals. This function can eliminate random noise by performing a weighted average.

The L_HighPassFilterBitmap function removes low frequency details in a bitmap, resulting in a sharpened image. The effect is opposite to that of the Gaussian Blur filter (L_GaussianFilterBitmap). Unlike the L_UnsharpMaskBitmap function, when using this function image noise is not increased.

The L_GaussianFilterBitmap function smooths 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 function.

[Document/Medical only] The binary filters (for erosion and dilation of black objects) can be used for noise removal. The L_BinaryFilterBitmap function applies directional binary filters. The L_MaxFilterBitmap and L_MinFilterBitmap functions 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 L_CombineBitmap with the CB_OP_AVG (averaging) flag.

[Document/Medical only] The L_AutoBinaryBitmap function 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 L_DeinterlaceBitmap function deinterlaces video source images by removing the black lines. It proceeds by merging lines in the image together and/or blending them together.

The L_SmoothEdgesBitmap function smoothes the edges of a bitmap.

The L_DynamicBinaryBitmap function converts a bitmap into a black and white image without changing its bits per pixel.

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:

L_AllocFTArray | Allocates a FTARRAY structure large enough to hold Fourier Transform coefficients
L_DFTBitmap | Computes the Discrete Fourier Transform of an image or the Inverse Discrete Fourier Transform, whichever is specified.
L_FFTBitmap | Computes the Fast Fourier Transform of an image or the Inverse Fast Fourier Transform, whichever is specified.
L_FreeFTArray | Frees the 2D storage array that was allocated by L_AllocFTArray.
L_FTDisplayBitmap | Converts the frequency harmonics amplitude or phase to a bitmap. It allows displaying the results of FFT and DFT as a bitmap.
L_FrqFilterBitmap | Filters the frequency harmonics according to the range rectangle.
L_FrqFilterMaskBitmap | Creates a mask filter for use in removing specific frequency components from a bitmap.


Detecting and Enhancing Edges and Lines

The L_SharpenBitmap function is designed specifically to emphasize the edges (shifts in intensity) in a bitmap. It is a high-level function that can be used alone for the desired effect.

The L_SpatialFilterBitmap function provides several predefined filters for detecting edges or lines. (It also lets you define your own filter.) 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 predefined 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 L_CombineBitmap function 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.

The L_DiffuseGlowBitmap function adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow.

The L_EdgeDetectorBitmap function can be used to apply a specific edge filter to a specific bitmap. The available edge filters include: Sobel vertical, Sobel horizontal, Sobel all, Laplacian vertical and horizontal, Laplacian diagonal, Gradient North, Gradient South, and many others. L_EdgeDetectEffectBitmap can be used to detect the edges in a bitmap and then replace the values of the edges with calculated values.

The L_EdgeDetectStatisticalBitmap function 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 L_GlowFilterBitmap function can be used to make the colored edges in a bitmap shine with a neon-like glow.

The L_ColoredPencilBitmap function applies a colored pencil effect to a bitmap. This function brightens the bitmap and enhances its edges.

The L_HighPassFilterBitmap function removes low frequency details in a bitmap, resulting in a sharpened image. The effect is opposite to that of the Gaussian Blur filter (L_GaussianFilterBitmap). Unlike the L_UnsharpMaskBitmap function, when using this function image noise is not increased.

The L_MaskConvolutionBitmap function multiplies the pixels of an image by a mask, resulting in one of several 3D edge effects being applied to the image.

The L_SmoothEdgesBitmap function can be used to smooth the rough edges in a bitmap.

The L_SkeletonBitmap function 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 L_IntensityDetectBitmap function 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 L_UnsharpMaskBitmap sharpens an image by first creating a blurred version of the image. For each pixel in the bitmap, the difference between the original pixel value and the blurred pixel value is determined. If the difference in pixel values exceeds a threshold value, the original pixel value is modified, sharpening the image.

The L_DirectionEdgeStatisticalBitmap function can be used to detect the variation of colors in the specified direction using statistical indices. It is similar to L_EdgeDetectStatisticalBitmap, but this function allows you to specify the direction angle.


Applying Artistic Effects

The following functions are designed specifically for artistic effects:

Function | Purpose
L_AddBitmapNoise | Adds random pixels to a bitmap, letting you specify the percentage of coverage and the color plane.
L_AddShadowBitmap | 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.
L_AgingBitmap | Adds effects that simulate random color changes, scratches, dust and pits, making a bitmap look like it was made from an old film.
L_BendingBitmap | Wraps the bitmap along the inside or outside of an arc pattern.
L_BricksTextureBitmap | Creates a brick texture that makes the image look like it has been drawn on a brick wall.
L_CanvasBitmap | Applies an image as an overlay for another image.
L_CloudsBitmap | Generates different cloud patterns.
L_ColoredBallsBitmap | Adds colored balls to the bitmap. Various parameters control the color and appearance of the balls.
L_ColoredPencilBitmap | Applies a colored pencil effect to a bitmap. This function brightens the bitmap and enhances its edges.
L_CylindricalBitmap | Warps the bitmap to a cylindrical shape.
L_DiceEffectBitmap | 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.
L_DiffuseGlowBitmap | Adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow.
L_DisplaceMapBitmap | Displaces bitmap pixels horizontally and vertically according to the values of the displacement map image.
L_EmbossBitmap | Applies an emboss effect to a bitmap, letting you specify the depth and direction of the effect.
L_FragmentBitmap | Averages a bitmap with its shifted copies.
L_FreeHandShearBitmap | Shears the bitmap by the wave drawn using amplitude values obtained from L_GetCurvePoints.
L_FreeHandWaveBitmap | Distorts the bitmap by the wave drawn using amplitude values obtained from L_GetCurvePoints and a specified angle.
L_FunctionalLightBitmap | 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.
L_HalfTonePatternBitmap | Creates a halftone screen effect for an image while keeping its continuous range of tones.
L_ImpressionistBitmap | Makes a bitmap look like it was painted by an impressionist painter.
L_MaskConvolutionBitmap | Multiplies the pixels of an image by a kernel, resulting in one of several 3D edge effects being applied to the image.
L_MosaicBitmap | Imposes 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.
L_MosaicTilesBitmap | Divides an image into rectangular or arc-shaped cells with irregular boundaries. This function 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.
L_MotionBlurBitmap | Applies a filter, which creates the illusion of movement in an image.
L_OffsetBitmap | Shifts the bitmap pixels horizontally and vertically.
L_OilifyBitmap | Applies an oil-painting effect to a bitmap.
L_PerlinBitmap | Uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture.
L_PerspectiveBitmap | Gives a bitmap a 3-D depth, as if it exists on a flat plane and has been skewed into a different shape.
L_PixelateBitmap | 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.
L_PlasmaFilterBitmap | Applies color patterns that blend into each other like plasma.
L_PointillistBitmap | 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. This filter creates a similar effect.
L_PolarBitmap | Converts the bitmap from rectangular to polar coordinates and vice versa.
L_PosterizeBitmap | Imposes a poster effect on a 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.
L_PunchBitmap | Warps the bitmap by pinching it toward the center or expanding the bitmap away from its center.
L_PuzzleEffectBitmap | Splits the image into square blocks and randomizes these blocks inside the image.
L_RingEffectBitmap | 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.
L_RadialBlurBitmap | Rotates the bitmap pixels around a center point.
L_RadWaveBitmap | Distorts a bitmap using a wave radiating from the specified center.
L_RevEffectBitmap | Adds a pseudo-3D wave effect to the bitmap by drawing horizontal lines across the bitmap and basing each line’s height at each point on its brightness at that point.
L_RemoveRedeyeBitmap | Replaces the red component of the pixels with the specified color. To replace only the red component for those pixels in the eyes of the bitmap, select a small region around the eye(s).
L_RippleBitmap | Warps the image in concentric rings.
L_RomanMosaicBitmap | Divides the bitmap into rectangular or rounded rectangular cells and then fills each cell with a color chosen randomly from the colors of each tile’s pixels.
L_SegmentBitmap | Divides the bitmap into segments where each segment’s pixels have approximately the same color (homogenous color).
L_SpherizeBitmap | Warps the image around a 3D spherical shape.
L_SwirlBitmap | Produces a swirl pattern by rotating the bitmap the specified number of degrees about the specified point.
L_SolarizeBitmap | Applies an effect that mimics the accidental exposure of photographic film to light.
L_TextureAlphaBlendBitmap | Combines image data from pBitmapMask and pBitmapUnderlay with an underlay effect. The result is used as a fade mask that will be used to combine pBitmapSrc and pBitmapDst with variable opacity. The result is combined again with pBitmapDst using a constant opacity (using nOpacity).
L_UnderlayBitmap | Combines two bitmaps so that one appears to be an underlying texture for the other.
L_VignetteBitmap | Draws a specified shape and feathers it to the bitmap.
L_WaveBitmap | Distorts the bitmap with two perpendicular waves at the specified angle and with the specified wave type.
L_WindBitmap | Creates thin lines, directed along the specified angle, on the specified bitmap.
L_ZigZagBitmap | Radially distorts the bitmap by creating waves that twist the image around a specified center.
L_ZoomBlurBitmap | Blurs the bitmap along radial lines starting from the specified center point.
L_ZoomWaveBitmap | Distorts the bitmap with a wave zoomed from the specified center.

With any of these functions, except L_UnderlayBitmap, you can limit the effect to a specified region of interest. For information about regions, refer to Defining and Using a Bitmap Region.

Treating the bitmap as a device context opens up many possibilities for artistic effects. The L_CreateLeadDC function lets you get the device context. You can then use the LEADTOOLS special effects functions to combine images in interesting ways. For example, when painting one image on top of another, you could specify a multi-pass paint with a brush effect; then quit before finishing all of the passes. The result would be a blending of the two images. For details, refer to Implementing Special Effects.


Correcting Colors

The following functions are designed specifically for adjusting colors in an image:

Function | Purpose
L_AdjustBitmapTint | Adjusts the bitmap tint by changing the colors in an image using two separate color wheel rotations.
L_AntiAliasBitmap | Applies an anti-aliasing filter to a specific bitmap.
L_ApplyMathLogicBitmap | Performs specific Mathematical or logical operations on the colors of a bitmap.
L_AutoColorLevelBitmap | Makes dark values darker and light values lighter to automatically enhance shadows and brighten the image.
L_BalanceColors | Linearizes the number of pixels in a bitmap across RGB, YUV or Gray color space.
L_BumpMapBitmap | Adds a three-dimensional texture pattern by applying the bump image to the destination image.
L_ChangeBitmapHue | Changes the hue of colors in a bitmap by rotating the color wheel.
L_ChangeBitmapSaturation | Increases or decreases the saturation of colors in a bitmap.
L_ChannelMix | Rebalances the colors in a bitmap in order to make color adjustments and to correct images which have more color than others.
L_ChangeHueSatIntBitmap | Changes the hue, saturation and brightness of all or specified colors in the image. This function combines the functionality found in the L_ChangeBitmapHue, L_ChangeBitmapSaturation, and L_ChangeBitmapIntensity functions 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.
L_ColorHalfToneBitmap | Creates an enlarged halftone screen for each image channel.
L_ColorReplaceBitmap | Replaces specified colors by adjusting values of hue, saturation and brightness.
L_ColorThresholdBitmap | Using any one of eight color spaces, resets those bitmap’s pixel component values that fall inside or outside of a specified range.
L_ColorIntensityBalance | Changes the distribution of the red, green, or blue channels.
L_ColorizeGrayBitmap | 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.
L_ColorLevelBitmap | Applies color leveling to an image. It changes the image shadows, midtones and highlights.
L_CubismBitmap | Remaps the bitmap into a collection of rotated rectangles (cubic faces), in the Cubist style.
L_DrawStarBitmap | Draws a star on the bitmap.
L_DryBitmap | Simulates painting an image with the watercolor dry brush technique.
L_FreePlaneBendBitmap | Wraps the bitmap onto a 3D plane shaped by pnCurve.
L_FreeRadBendBitmap | Wraps the bitmap along its radius on a 3D surface shaped by pnCurve.
L_GlassEffectBitmap | Divides the image into cells and makes it look as if it is being viewed through glass blocks.
L_GlowFilterBitmap | Makes colored edges shine with a neon-like glow.
L_InvertBitmap | Inverts the colors in the specified bitmap, making it like a photographic negative.
L_LensFlareBitmap | Simulates the secondary reflections caused when bright lights are facing the camera lens.
L_LightBitmap | Adds many spots of directed light sources to the bitmap.
L_LightControlBitmap | Lightens or darkens all or part of a bitmap by remapping the pixel values.
L_OceanBitmap | Reflects the bitmap on an ocean surface.
L_SampleTargetBitmap | Corrects color values by shifting the sample colors to the target colors.
L_PlaneBendBitmap | Places the bitmap on parallel planes along the Z-axis bent towards a center point.
L_PlaneBitmap | Places the bitmap on parallel planes along the Z-axis.
L_SampleTargetBitmap | Corrects color values by shifting the sample colors to the target colors.
L_SelectiveColorBitmap | Changes the color of a bitmap by altering the definitions of one or more colors used by the bitmap.
L_SmoothEdgesBitmap | Smoothes the rough edges in the bitmap.
L_SelectBitmapData | 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.
L_ShiftBitmapData | 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.
L_SwapColors | Swaps colors channels in a bitmap.
L_RemoveRedeyeBitmap | Replaces the red component of the pixels with the specified color. To replace only the red component for those pixels in the eyes of the bitmap, select a small region around the eye(s).
L_TunnelBitmap | Places the bitmap inside a tunnel along the Z-axis.


Grayscale Images

LEADTOOLS provides a number of functions for working with grayscale images. Many of these functions 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 L_GrayScaleBitmap function. The L_GrayScaleBitmapExt function 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 L_ConvertToColoredGray function 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 L_ColorizeGrayBitmap.

The L_GrayScaleToDuotone function converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with new colors.

The L_GrayScaleToMultitone 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 L_GetBitmapAlpha function creates a grayscale image from the alpha channel information of an image.

The L_DesaturateBitmap function converts the image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

(Medical only) The L_ShiftBitmapData function 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 L_SelectBitmapData function 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.

Changing the Highlight pen and Cursor Style (Document/Medical only)

When working with grayscale images containing many midrange grays, it may be difficult to see the highlight pen and the cursor. In such cases, the user should call L_AnnSetAutoHilightPen and L_AnnSetAutoCursor. These two functions let the user set both 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 functions for getting information about grayscale images. The L_GetMinMaxBits provides information on the minimum and maximum bit set in a 12 or 16 - bit grayscale image. The L_GetMinMaxVal function 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 get a full histogram of a 12 or 16-bit grayscale image, call L_GetBitmapHistogramGray.

To determine the kind of grayscale palette associated with a bitmap, if any, call L_IsGrayScaleBitmap.

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. Two functions are provided for window leveling. L_WindowLevel provides "on demand" window leveling for the paint functions and does not alter the image, and L_WindowLevelBitmap converts the image to a window leveled 8 or 24 bit RGB bitmap. The bit range is passed to the functions through nLowBit and nHighBit parameters and the user defined color map is passed through the pLUT parameter. To help set up a bit range and a color map, use L_GetMinMaxBits and L_GetMinMaxVal. L_GetMinMaxBits gets the minimum and maximum bits of the values present in a 12 or 16-bit grayscale image. L_GetMinMaxVal gets the minimum and maximum intensity values of the image. L_WindowLevelFillLUT fills the user-allocated LUT with a color gradient based on the specified values. For more information, refer to the individual entries for the functions. Window leveling applied with the L_WindowLevel function can be saved to TIF or DICOM formats without changing the bitmap data. For more information, refer to Saving Window-Leveled Bitmaps.


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 functions that will improve the appearance of scanned documents by removing dots, blobs, lines, borders, hole punches, inverted text, bumps and nicks. These functions are listed below:

L_SmoothBitmap

L_LineRemoveBitmap

L_DotRemoveBitmap

L_HolePunchRemoveBitmap

L_InvertedTextBitmap

L_BorderRemoveBitmap

Each of these functions takes as a parameter a specialized structure that controls the performance of the corresponding removal process. Included in the structure 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. The following callback functions allow you to provide customized region processing, as well as create your own composite of the removed regions. These callbacks are given below:

SMOOTHCALLBACK

LINEREMOVECALLBACK

DOTREMOVECALLBACK

HOLEPUNCHREMOVECALLBACK

BORDERREMOVECALLBACK

INVERTEDTEXTCALLBACK


Converting and Changing EMFs and WMFs

LEADTOOLS provides a number of functions that let you convert bitmaps to EMFs or WMFs and convert EMFs or WMFs to bitmaps. Upon completion of the functions listed below, there are two copies of the image in memory. The conversion functions are as follows:

L_ConvertFromEMF

L_ConvertToEMF

L_ConvertFromWMF

L_ConvertToWMF

If you don’t want two copies of the images in memory, you can change a bitmap into an EMF or WMF, or you can change an EMF or WMF into a bitmap. The change functions are as follows:

L_ChangeFromEMF

L_ChangeToEMF

L_ChangeFromWMF

L_ChangeToWMF


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 the 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 uWidth, uHeight, uMaxScale, and uMinScale. Use the L_IsRegMarkBitmap function to ensure the selected mark is a valid registration mark.

Currently, to be used with the registration marks functions a document image must consist of white objects on a black background.

To use the registration functions, 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 functions 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 functions 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 (5 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 a SEARCHMARKS structure and contains the following information:

Member | Value
uType = | RGS_T
uWidth | Registration mark’s width, in pixels.
uHeight | Registration mark’s height, in pixels.
uMinScale | Minimum registration mark percentage scaling to be detected.(for example, 90,85, or 75 …etc)
uMaxScale | Maximum registration mark percentage scaling to be detected. (for example, 110,120, or 125 …etc)
rcRect | Rectangular area to be searched for registration marks. Note that if you select too small of a search area, you run the risk the mark will not be detected because of shift, rotation or scaling. However, the larger the area, the more time that is consumed in the search.
uMarkSearchCount | Number of expected registration marks inside the search area. Set this to 1. (Since there must be one registration mark inside each area.)
pMarkDetectedPoints = | (POINT L_FAR *) malloc(uNumOfMarks * sizeof(POINT)). This will be updated by L_SearchRegMarksBitmap function.
uMarkDetectedCount | Count of detected marks. Set this to 0. This will be updated by L_SearchRegMarksBitmap function.

With this information you can use the L_GetMarksCenterMassBitmap function to compute the center of mass for each of these marks. Save these points to an array.

Now you can scan forms and correct their orientation and size. The following 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 L_SearchRegMarksBitmap function on the scanned image to find the registration marks. If all of the registration marks were detected (the uMarkDetectedCount parameter in each SEARCHMARKS structure equals 1), then use the L_GetMarksCenterMassBitmap function to compute the center of mass for each registration mark, and save those to an array of points.

The next step is to determine the shifting, scaling and rotation necessary to re-orient the scanned image. To do this, pass the array of reference points as well as the array of transformed points to the L_GetTransformationParameters function.

To re-orient and resize the scanned image so it is like the reference image, use the values from the L_GetTransformationParameters function in the L_ApplyTransformationParameters function. This is equivalent to shifting the image using L_CombineBitmapExt, rotating the image using L_RotateBitmap (without resizing), and scaling the image using either L_SizeBitmap or L_ResizeBitmap. (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:

A demo has been prepared to illustrate the use of these functions. For a tutorial, refer to How to Use the Registration Marks Demo.


How to use the Registration Marks Demo

1. | Start the demo by:
 | Selecting "Start" ? "Programs" ? "LEADTOOLS Document Imaging Suite 14.0" ? "Raster" ? "Document" ? "Document Imaging " "API" and click on the desired demo, as shown below. (Please note that your exact path may vary, depending on the toolkit you have installed.)
 | Or
 | Double clicking on the RGSMRK.exe file in the LEAD/BIN directory, where LEAD represents the directory in which you installed the LEADTOOLS toolkit. (If you used the default settings when you installed the toolkit, that path would be "C:\Program Files\LEAD Technologies, Inc\LEADTOOLS\Bin".)
 | The steps of using the registration marks detection functions are:
2. | Select the reference document or image (we will refer to it as REF). REF will be considered as a reference to which we will compare the other documents in order to detect any shift, rotation, or scaling of the scanned documents. REF is used to determine the shape of the registration marks (T-shaped in this version), their number (three in this version) and where they are in the document. The reference document must be a black and white document bitmap (black background and white text) containing at least three registration marks (T shape). In the demo we have included a Ref.cmp file for use as this reference. In the main window of the Registration Marks Demo, select File ? Open.
3. | In the Open File dialog, you can either set the path to the LEAD/Images directory in the "File name" edit box or browse to this directory using the "Look in" drop box. (Please note that in the LEAD/Images directory mentioned above, "LEAD" represents the directory in which you installed the LEADTOOLS toolkit.) Select the Ref.cmp file and click Open.
 | Scan or open REF.
4. | From within the REF file, indicate the locations of the registration marks by doing the following:
 | In the main window of the demo, select Image ? New Reference Data. The Select Reference Data dialog will appear, as shown in the following figure:
 | Currently there is one Registration mark type available, the T Shape. Enter the smallest size you think the registration mark could be reduced to, in percent, in the "Min size ratio" text edit box. Enter the largest size you think the registration mark could be zoomed to, in percent, in the "Max size ratio" text edit box. Enter the width of the registration mark, in pixels, in the "Width" text edit box. Enter the height of the registration mark, in pixels, in the "Height" text edit box. Click the Next button. The Registration Marks dialog will appear, as shown in the following figure:
 | Click the Add Point button, and select three registration marks on the image by clicking on them. When you click on a point, its coordinates will appear in the list, and the Search Rgn button becomes available. You can delete a point by selecting its coordinates in the list and then clicking the Delete button.
 | For each point, select a search region around each registration mark to designate where on the document the registration marks may appear after an acceptable rotation, shifting or scaling. With a point selected in the list, click the Search Rgn button and use the mouse to rubberband an area by clicking the left mouse button at one corner of the rectangle of the desired area and holding the button down while dragging the mouse pointer down to the opposite diagonal corner, and releasing the left mouse button. The selection of regions is important: small regions make the detection process faster, but run the risk the mark will not be detected because of shift, rotation or scaling. After you select an area around the registration mark, an asterisk (‘*’) appears before the point in the list. If you forget where a point is, click on it in the list and look on the image for a cross. Click OK when you are done. You can now detect the Registration marks on a new document.
5. | In the main window of the Registration Marks Demo, select File ? Open. Open a scanned document file. In the demo we have included a Test1.cmp file for use as a scanned image. Select the Test1.cmp file and click Open.
6. | Select Image ? Detect Registration Marks. If all registration marks are detected, the "Success" message appears and the Transform Param option on the Image menu enables. If the "Error" message appears, usually the problem is that either there is something wrong with the image (it is not the correct form, or was incorrectly oriented when scanned in or there was a misfeed and the image is incomplete or deformed) or the search areas around the registration marks were not large enough. See the note on Verification of Reference Data.
7. | If the "Success" message appears select OK to close the message box and then in the main window select Image ? Get Transformation Parameters. Another "Success" message appears, displaying the parameters needed (rotation, scaling and translation values) to properly transform the scanned image. These results must be divided by 100 to get the actual values.
8. | Click OK to close this message box, and the Apply Transformation option on the Image menu enables. To correct the image, select Image ? Apply Transformations.
 | Note: Verification of Reference Data. You can verify that you have performed these steps correctly by following steps 5 through 8 using the Ref.cmp file instead of the Test1.cmp file. All marks should be detected with zero variations.
 | After completing steps 1 –4 you can save the results to use them later without re-obtaining the reference data. To save the reference data, select Reference Data ? Save. The data is stored in the file RefData.txt, in the same directory as the demo. To use stored reference data, select the Reference Data ? Load. menu item, then work on the new documents.


Using the Image Warping Demo

1. | The demo exe name is MFCWarp.exe. To start this demo, double click the exe in the LEADTOOLS\BIN directory.
2. | Click the "Load Master" button to load a master image.
3. | Click the "Load Slave" button to load a slave image.
4. | Once the master is loaded, a red polygon appears. Select the polygon by moving the cursor over the polygon and clicking.
5. | Move the polygon by selecting the polygon, and dragging.
6. | The individual points can be moved by placing the cursor over a point and dragging the point.
7. | The polygon can be rotated by SHIFT-CLICKING a point and dragging the mouse.
8. | Move and resize the red polygon over the destination image to specify where the slave will be transferred. If the image is large, click the "View Normal Size" radio button to see the entire image. Once you have the polygon in the approximate location, click the "Zoom In" button to accurately move the polygon points.
9. | Click the "Transfer Slave Into Master" to transfer the image.
10. | If you want to use bilinear interpolation, check the "Bilinear Interpolation" check box and then click the "Transfer Slave Into Master" button. The bilinear interpolation option usually gives a better result.
11. | After the transfer, you can uncheck the "Show Polygon Outline" button so see how the final image looks.

Important:

Note that this demo uses the LEAD Annotation capabilities. There is a red polygon that is used to specify the shape and location of the image warp that will be placed in the master image. This polygon is implemented using LEAD’s Annotations feature, which is part of the Document Imaging toolkit and is not part of the regular Raster Imaging toolkit. The annotation capability is in no way a requirement for the CombineBitmapWarp feature to work.

The compiled version of the demo will work with your LEAD libraries. If you recompile the demo, you will need to use the "nag" LTKRN14n.dll (displays a message when loaded) that is included. The "nag" LTKRN14n.dll is for development only, and is not to be redistributed.


Dithering Methods

The following are constants for the dithering methods:

Constant | Meaning
CRF_NODITHERING | [0x00000000] Use nearest color matching.
CRF_FLOYDSTEINDITHERING | [0x00010000] Use Floyd-Steinberg dithering.
CRF_STUCKIDITHERING | [0x00020000] Use Stucki dithering.
CRF_BURKESDITHERING | [0x00030000] Use Burkes dithering.
CRF_SIERRADITHERING | [0x00040000] Use Sierra dithering.
CRF_STEVENSONARCEDITHERING | [0x00050000] Use Stevenson Arce dithering.
CRF_JARVISDITHERING | [0x00060000] Use Jarvis dithering.
CRF_ORDEREDDITHERING | [0x00070000] Use ordered dithering, which is faster but less accurate than other dithering methods.

For general information about dithering, refer to Color Resolution and Dithering.


Flags for the L_ApplyMathLogicBitmap Function

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 nFactor:

Value | Meaning
AML_OP_AND | [0x00000000] Combine each pixel component value and nFactor using a bitwise AND (&).
 | (pixel = pixel & nFactor)
AML_OP_OR | [0x00000100] Combine each pixel component value and nFactor using a bitwise OR (|).
 | (pixel = pixel | nFactor)
AML_OP_XOR | [0x00000200] Combine each pixel component value and nFactor using a bitwise XOR (^).
 | (pixel = pixel ^ nFactor)
AML_OP_ADD | [0x00000300] Add pixel component value to the nFactor clamping the result to the maximum allowed pixel value.
 | (pixel = min(pixel + nFactor, MAX_PIXEL_VALUE) )
AML_OP_SUBFACT | [0x00000400] Subtract each pixel component value from the nFactor, clamping the result to the allowed pixel range.
 | (pixel = min(max(nFactor - pixel, MIN_PIXEL_VALUE), MAX_PIXEL_VALUE) )
AML_OP_SUBVALUE | [0x00000500] Subtract nFactor from each pixel component value, clamping the result to the allowed pixel range
 | (pixel = min(max(pixel – nFactor), MIN_PIXEL_VALUE, MAX_PIXEL_VALUE) )
AML_OP_ABSDIF | [0x00000600] Calculate the absolute difference between nFactor and each pixel component value.
 | (pixel = abs(pixel – nFactor))
AML_OP_MUL | [0x00000700] Multiply each pixel component value by nFactor/100.
 | (pixel = pixel * nFactor / 100)
AML_OP_DIVFACT | [0x00000800] Divide each pixel component value by nFactor/100. An error will be returned if nFactor = 0.
 | (pixel = pixel * 100 / nFactor)
AML_OP_DIVVALUE | [0x00000900] Divide nFactor by each pixel values. If the pixel values are 0, the result set to maximum allowed pixel value. (pixel = pixel ? min(nFactor / pixel, MAX_PIXEL_VALUE) : MAX_PIXEL_VALUE)
AML_OP_AVG | [0x00000A00] Use the average of the each pixel component value and nFactor. (pixel = (pixel+nFactor) / 2).
AML_OP_MIN | [0x00000B00] Use the lesser of the pixel component values and nFactor:
 | (pixel = min(pixel, nFactor) )
AML_OP_MAX | [0x00000C00] Use the greater of the pixel component values and nFactor:
 | (pixel = max(pixel, nFactor) )

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 uFlags 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 nFactor 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 nFactor is:

From 2 * MIN_PIXEL_VALUE to 2 * MAX_PIXEL_VALUE.


Flags for the L_CombineBitmap Function

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 | [0x00000000] No change.
CB_SRC_NOT | [0x00000001] Invert the color, resulting in its complement.
CB_SRC_0 | [0x00000002] Change all bits to 0.
CB_SRC_1 | [0x00000003] Change all bits to 1.

The following are the flags that define treatment of the destination rectangle:

Value | Meaning
CB_DST_NOP | [0x00000000] No change.
CB_DST_NOT | [0x00000010] Invert the color, resulting in its complement.
CB_DST_0 | [0x00000020] Change all bits to 0.
CB_DST_1 | [0x00000030] 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 | [0x00000000] Combine each set of bytes using a bitwise AND (&).
CB_OP_OR | [0x00000100] Combine each set of bytes using a bitwise OR ( | ).
CB_OP_XOR | [0x00000200] Combine each set of bytes using a bitwise exclusive OR (^).
CB_OP_ADD | [0x00000300] Add the byte values, allowing a maximum of 255.
CB_OP_SUBSRC | [0x00000400] Subtract the source from the destination, allowing a minimum of 0.
CB_OP_SUBDST | [0x00000500] Subtract the destination from the source, allowing a minimum of 0.
CB_OP_MUL | [0x00000600] Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * dest) / 255.
CB_OP_DIVSRC | [0x00000700] 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 | [0x00000800] 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 | [0x00000900] Use the average of the two values.
CB_OP_MIN | [0x00000A00] Use the lesser of the two values.
CB_OP_MAX | [0x00000B00] 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 | [0x00000000] No change.
CB_RES_NOT | [0x00001000] Invert the color, resulting in its complement.
CB_RES_0 | [0x00002000] Change all bits to 0.
CB_RES_1 | [0x00003000] Change all bits to 1.


Flags for the L_CombineBitmapExt Function

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 | [0x00000000] No change.
CB_SRC_NOT | [0x00000001] Invert the color, resulting in its complement.
CB_SRC_0 | [0x00000002] Change all bits to 0.
CB_SRC_1 | [0x00000003] Change all bits to 1.

The following are the flags that define treatment of the destination rectangle:

Value | Meaning
CB_DST_NOP | [0x00000000] No change.
CB_DST_NOT | [0x00000010] Invert the color, resulting in its complement.
CB_DST_0 | [0x00000020] Change all bits to 0.
CB_DST_1 | [0x00000030] 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 | [0x00000000] Combine each set of bytes using a bitwise AND (&).
CB_OP_OR | [0x00000100] Combine each set of bytes using a bitwise OR ( | ).
CB_OP_XOR | [0x00000200] Combine each set of bytes using a bitwise exclusive OR (^).
CB_OP_ADD | [0x00000300] Add the byte values, allowing a maximum of 255.
CB_OP_SUBSRC | [0x00000400] Subtract the source from the destination, allowing a minimum of 0.
CB_OP_SUBDST | [0x00000500] Subtract the destination from the source, allowing a minimum of 0.
CB_OP_MUL | [0x00000600] Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * dest) / 255.
CB_OP_DIVSRC | [0x00000700] 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 | [0x00000800] 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 | [0x00000900] Use the average of the two values.
CB_OP_MIN | [0x00000A00] Use the lesser of the two values.
CB_OP_MAX | [0x00000B00] Use the greater of the two values.
CB_OP_ABSDIF | [0x00000C00] 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 | [0x00000000] No change.
CB_RES_NOT | [0x00001000] Invert the color, resulting in its complement.
CB_RES_0 | [0x00002000] Change all bits to 0.
CB_RES_1 | [0x00003000] Change all bits to 1.

The following are the flags that define the channel of the source image rectangle:

Value | Meaning
CB_SRC_MASTER | [0x00000000] perform operation on all Channels.
CB_SRC_RED | [0x00010000] perform operation on Red Channel.
CB_SRC_GREEN | [0x00020000] perform operation on Green Channel.
CB_SRC_BLUE | [0x00030000] perform operation on Blue Channel.

The following are the flags that define the channel of the destination image rectangle:

Value | Meaning
CB_DST_MASTER | [0x00000000] perform operation on all Channels.
CB_DST_RED | [0x00100000] perform operation on Red Channel.
CB_DST_GREEN | [0x00200000] perform operation on Green Channel.
CB_DST_BLUE | [0x00300000] perform operation on Blue Channel.

The following are the flags that define the channel of the resulting image rectangle:

Value | Meaning
CB_RES_MASTER | [0x00000000] perform operation on all Channels.
CB_RES_RED | [0x01000000] perform operation on Red Channel.
CB_RES_GREEN | [0x02000000] perform operation on Green Channel.
CB_RES_BLUE | [0x03000000] perform operation on Blue Channel.


Flags for the L_SetDisplayMode Function

The following are the possible values for the L_SetDisplayMode function:

Value | Meaning
DISPLAYMODE_ORDEREDDITHER | [0x00000001] Enables or disables ordered dithering when painting. Ordered dithering is faster than the default dithering method, which uses error diffusion, but the quality of the image is not as good.
DISPLAYMODE_FASTPAINT | [0x00000002] Enables or disables fast painting. Fast painting should be performed only if the current video driver is good, and the image does not need to be dithered or resized to paint. No safety check for a faulty driver is performed.
DISPLAYMODE_INDEXEDPAINT | [0x00000004] Enables or disables painting that is mapped directly to the selected palette. This is enabled by default; you can set this flag to disable it and let Windows do color matching between the paint palette and the selected palette. Indexed painting uses the colors from the currently selected palette. It is not used if the image is not palettized.
DISPLAYMODE_DITHEREDPAINT | [0x00000008] Enables or disables dithered painting. This is enabled by default, but you can set this flag to false to disable it. When enabled, Floyd-Steinberg dithering is used to dither true color or high color images on devices that are 8 bits per pixel or less. When disabled, the device is responsible for color reduction. If this flag is set, LEADTOOLS handles the dithering. If this flag is not set, the display driver or the printer driver handles the dithering.
DISPLAYMODE_SCALETOGRAY | [0x00000010] (Document/Medical only) 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. If you enable grayscaling, you must call L_CreatePaintPalette, then select and realize the palette before painting an image.
DISPLAYMODE_HALFTONEPRINT | [0x00000020] Enables use of the printing halftone (rather than the viewing halftone) when painting to a 1-bit device. This is useful if you are using the L_PaintDC function for printing.
DISPLAYMODE_FAVORBLACK | [0x00000040] (Document/Medical only) 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.
DISPLAYMODE_FIXEDPALETTE | [0x00000080] Forces the use of a fixed palette when painting to a device that supports 256 colors or less. When this flag is off, the bitmap handle controls palette usage. When this flag is on, the default is the LEAD fixed palette, but on 256-color devices, the Netscape palette is used if the DISPLAYMODE_NETSCAPEPALETTE flag is also set.
DISPLAYMODE_NETSCAPEPALETTE | [0x00000100] Sets the Netscape fixed palette as the preferred fixed palette when painting to a device that supports 256 colors. This fixed palette is employed by both Netscape Navigator and Microsoft Internet Explorer.
DISPLAYMODE_RESAMPLE | [0x00000200] Use bilinear interpolation (resample) if the paint process needs to resize the image. (slower than regular resize)
DISPLAYMODE_BICUBIC | [0x00000400] Use bicubic interpolation if the paint process needs to resize the image. (slower than DISPLAYMODE_RESAMPLE)
DISPLAYMODE_RESETPOSITIONS | [0xFFFFFFFF] (Used only in the uFlagPos parameter) Applies the function to all flags.


Using the L_CreateFadedMask Function

When using the L_CreateFadedMask function, the general process is as follows:

1. | Open any bitmap.
2. | Select any region.
3. | Create a Fade Mask. The images below show various fade masks resulting from the use of various flags. For these images, the following values were also used:

Region type: rounded rectangle.

nLength = 50;
nFadeRate = 15;
nStepSize = 3;
nMaxGray = 255;
crTransparent = RGB(255, 0, 0);

First: without using FADE_OUTER

1) No Flag

transparency

2) FADE_WHITETOBLACK

3) FADE_DUMPFILL

4) FADE_DUMPFILL | FADE_WHITETOBLACK

5) FADE_DUMPFILL | FADE_FILLCOLOR_START

6) FADE_DUMPFILL | FADE_FILLCOLOR_START | FADE_WHITETOBLACK

7) FADE_DUMPFILL | FADE_NOTRANSPARENCY

8) FADE_DUMPFILL | FADE_NOTRANSPARENCY | FADE_TRANSPARENCY_ DUMPCOLOR

plus many other possibilities.

Second: using FADE_OUTER:

Region type:

rounded rectangle smaller than the above region, nInflate = 60

1) FADE_OUTER

2) FADE_OUTER | FADE_WHITETOBLACK

3) FADE_OUTER | FADE_DUMPFILL

4) FADE_OUTER | FADE_DUMPFILL | FADE_WHITETOBLACK

5) FADE_OUTER | FADE_DUMPFILL | FADE_WHITETOBLACK| FADE_NOTRANSPARENCY

and so on………..


Using The L_PerlinBitmap Function

The Perlin noise function was developed in the 1980s by Ken Perlin, who was working with procedural textures. He wanted to create a function 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 L_PerlinBitmap function 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 L_PerlinBitmap function, the general process is as follows:

1. | Open any bitmap.
2. | Use the L_PerlinBitmap function 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:

uSeed = 0;
uFrequency = 16;
uIteration = 8;
uOpacity = 75;
crBClr = RGB(0, 0, 0);
crFClr = RGB(255, 0, 0);
nxCircle = image.Width / 2;
nyCircle = image.Height / 2;
nFreqLayout = 100;
nDenLayout = 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 L_CloudsBitmap function also makes use of Perlin noise.


List of Spatial Filters

The following is a list of the predefined spatial filters that can be applied using the L_SpatialFilterBitmap function:

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 | [#define] 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 | [#define] 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 | [#define] 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 | [#define] 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 | [#define] 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 | [#define] 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 | [#define] 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.


How Weights are Applied in a Spatial Filter


Converting Curves

LEADTOOLS provides the L_CurveToBezier for converting curve points to Bezier points. The array of Bezier points that results from calling this function may be used with the Windows API PolyBezier and PolyBezierTo functions.


Image Optimization

LEADTOOLS provides functionality to optimize certain images 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 L_OptOptimizeBuffer function.

To optimize an entire directory of images and save the optimized images to another directory, use the L_OptOptimizeDir function.

Both L_OptOptimizeBuffer and L_OptOptimizeDir, require optimization options for optimizing images. The user can get the default options by calling the L_OptGetDefaultOptions function.


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 L_LoadFileCMYKArray. Alpha channel information can be loaded or ignored as follows:

to ignore alpha information, create an array of 4 BITMAPHANDLE structures.

Or :

to load alpha information, create an array of 5 BITMAPHANDLE structures. (The alpha channel will be stored in the 5th element of the array).

If the source file is not in the TIFF CMYK format, load the bitmap normally with L_LoadBitmap, L_LoadBitmapMemory, L_LoadBitmapResize, L_LoadFile, L_LoadFileOffset, or L_LoadMemory and then obtain the CMYK planes by calling L_ColorSeparateBitmap.

Paint the bitmaps using L_PaintDCCMYKArray.

To save the bitmap as TIFF CMYK, call L_SaveFileCMYKArray. To save as another format, create a BGR bitmap using L_ColorMergeBitmap and then save the image with L_SaveBitmap or L_SaveFile.

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.


Color Halftone and Halftone Images

Halftoning is taking an image that uses continuous tones and creating one suitable for printing using one color of ink (grayscale) or four colors of ink (color printing using the Cyan, Magenta, Yellow and Black process colors). In the CMYK colored print process four separations (also called screens) are made, one for each process color. Different sizes of the dots of ink are used to produce the different levels of color. These dots are not large enough to be seen without magnification. After different adjustments are made to the separations, the article being printed goes through a process where each color gets printed in succession, one on top of the other. To prevent moiré patterns, each screen is set to a different angle.

In digital printing, generally the dot size remains constant (instead of varying). Instead the dots are broken up into small halftone cells, and the different color values are created by varying the number of the small halftone cells that take color.

LEADTOOLS provides a number of functions for working with color images and changing them so they are suitable for printing using halftoning techniques.

Color Images

Use the L_ColorSeparateBitmap function to separate the specified bitmap by color plane to produce one grayscale image per plane. Note that in addition to the CYMK color space used by CYMK process printing, this function also supports the RGB, CMY, HSV, and HLS color-space models.

As an example, if you use the following figure:

and you call the L_ColorSeparateBitmap function using the following values:

Parameter | Value
uFlags | COLORSEP_CMYK

The following figures result:

Use the L_ColorMergeBitmap function to create a color bitmap by merging grayscale bitmaps that were created as color separations. You can use this to recombine the bitmaps that the L_ColorSeparateBitmap function creates.

Use the L_ColorHalfToneBitmap function to divide the image into rectangles and replace 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 which it is replacing. Note that with this function, the circles are large enough to be individually seen.

As an example, if you use the following figure:

and you call the L_ColorHalfToneBitmap function using the following values:

Parameter | Value
uMaxRad | 8
nCyanAngle | 108
nMagentaAngle | 163
nYellowAngle | 90
nBlackAngle | 45

The following figure results:

Halftones

Use the L_DesaturateBitmap to convert an image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

Use the L_HalfToneBitmap function to convert a 1-, 4-, 8-, 16-, 24-, or 32-bit bitmap to a halftoned bitmap, with a specified pattern rotation.

As an example, if you use the following figure:

and you call the L_HalfToneBitmap function using the following values:

Parameter | Value
uType | HT_PRINT
nAngle | 6
uDim | na
hList | na

The following figure results:

Use the L_HalfTonePatternBitmap function to create a halftone screen effect for an image while keeping its continuous range of tones.

As an example, if you use the following image:

And you were to call the L_HalfTonePatternBitmap function using the following settings:

Parameter | Value
uContrast | 100
uRipple | 10000
uAngleContrast | na
uAngleRipple | na
uAngleOffset | na
crForeGround | Black
crBackGround | White
uFlag | HTPATTERN_DOT

The following figure results:

As another example, if you were to use the same original bitmap but call the L_HalfTonePatternBitmap function using the following settings:

Parameter | Value
uContrast | 75
uRipple | 20000
uAngleContrast | 85
uAngleRipple | 4
uAngleOffset | 54
crForeGround | White
crBackGround | Brown
uFlag | HTPATTERN_CRICLE

The following figure results:

Getting Information About Images

Use the L_GetBitmapStatisticsInfo function to obtain statistical information about the bitmap. This includes such information as the mean, median, standard deviation, maximum, minimum, pixel count values. Use the L_GetBitmapHistogram function to obtain an array that charts how many times each intensity level occurs in a bitmap. This function can chart red, green, and blue separately or together. It is used for all resolutions, including 12 and 16-bit grayscale. Use the L_GetBitmapColorCount function to get the number of unique colors in an image. Use the L_GetBitmapColors function to load your palette with selected colors from a bitmap handle's palette. Use the L_GetMinMaxBits function to obtain the low and high bits of the values present in a 12 or 16-bit grayscale and 48 and 64-bit image. Use the L_GetMinMaxVal function to obtain the minimum and maximum intensity values present in a 12 or 16-bit grayscale and 48 and 64-bit image. Please note that support for 12 and 16-bit grayscale images is only available in Document/Medical toolkits.

Grayscale Images

LEADTOOLS provides a number of functions designed specifically for use with grayscale images, either creating a grayscale image, getting information about a grayscale image, or window leveling. For more information about these functions, refer to Grayscale Images.


Using ICC Profile Functions

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.

Creating an ICC Profile

To create an ICC profile, start by calling L_InitICCProfileExt to initialize an ICC profile structure (ICCPROFILEEXT). This must be called before creating a new profile or loading an existing profile. Within the ICCPROFILEEXT structure is an ICCHEADER structure that contains header information for the profile. Once the ICCPROFILEEXT structure has been initialized, the header must be initialized by calling L_InitICCHeader. This sets the members of the ICCHEADER structure to their default values. The following functions can be used to change the ICCHEADER values from default values to custom values:

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent

Tags

The ICC Profile can also include tags. Tags can be inserted in an ICC profile, created but not inserted, or deleted. To insert a tag in an ICC profile, do the following:

Define a structure of the same "type" as the tag to be created.

Fill the structure with the required data.

Call the L_SetICCTagData function to insert the tag into the ICC profile.

To create a tag without inserting it into an ICC profile, call L_CreateICCTagData. When that tag is no longer needed, free it by calling L_FreeICCTagType.

At anytime the user can get a tag from an ICC profile by calling the L_GetICCTagData function. The user can delete a tag by calling the L_DeleteICCTag function.

Tags are of various types. These types have a signature associated with them to identify them. Tags also have signatures associated with them. One or both of these signatures may be used when creating, inserting or deleting tags. To get the signature of a specific tag type, call the L_GetICCTagTypeSig function. For more information on tags, types and signatures, please refer to the documentation available through www.color.org.

When working with ICC profiles, it may be necessary to convert values from one form to another. Variables of the type L_IccS15Fixed16Number, or L_IccU16Fixed16Number require data in a 2 bytes fixed, 2 bytes fraction form. The L_DoubleTo2bFixed2bNumber function converts a double value into a 2 bytes fixed, 2 bytes fraction form, allowing the user to set these variables. The L_2bFixed2bNumberToDouble function converts a 2 bytes fixed, 2 bytes fraction value into a double value, allowing the user to get data from these variables.

The pData pointer of the ICCPROFILEEXT structure points to a block of memory that contains the ICC profile as a whole. This pointer does not generate automatically after each new tag added or deleted. Therefore, to regenerate a pointer to the updated profile, call the L_GenerateICCPointer function. Please note however, that both the L_GenerateICCFile and L_SaveICCProfile function do regenerate the pointer to the updated ICC profile before saving the profile data to the respective files. Therefore, it is not necessary to call L_GenerateICCPointer before calling either L_GenerateICCFile or L_SaveICCProfile.

Loading an ICC Profile

ICC profiles can be saved to ICC files or embedded in image files and loaded at a later date. Before loading an existing ICC profile from a saved file, the L_InitICCProfileExt function must be called to initialize the ICC profile structure.

To load an ICC profile from an image file, call L_LoadICCProfileExt. This function loads the pData member of the ICCPROFILEEXT structure with a pointer to one block of memory that contains the entire ICC profile. It also loads the uDataSize member with the size of the profile. Once this information has been loaded, call L_FillICCProfileStructure to extract the ICC profile information from the memory block and fill the appropriate members of the ICCPROFILEEXT structure.

A profile structure can also be loaded directly from an ICC profile file, using the L_FillICCProfileFromICCFile function.

Saving an ICC Profile

An ICC profile can be saved, or embedded, in a TIFF, GIF or JPEG image file by calling L_SaveICCProfile. To save an ICC profile to an ICC profile file, call L_GenerateICCFile.

Freeing an ICC Profile

When an ICC profile structure is no longer needed, free the structure by calling L_FreeICCProfileExt.


Defining 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. The following topics describe how to create and use a bitmap region:

Creating a Bitmap Region

Translating Coordinates for a Bitmap Region

Working with the Existing Bitmap Region

Saving a Region


Creating 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 functions that modify the pixel values (for example L_PosterizeBitmap) act on the region, rather than the whole bitmap. For a list of these functions, refer to Functions Where the Region Preempts the Bitmap.

In addition, the LEADTOOLS functions 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 functions, refer to Functions that Transform the Region and the Bitmap.

By default, a bitmap does not have a region. You create a bitmap region by calling one or more of the creation functions listed in Creating and Using a Region. Each time you call one of these functions, 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 | [0] 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 | [1] 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 | [6] 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 | [2] 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 | [3] 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 | [4] 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 | [5] 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.

LEADTOOLS provides the L_FrameBitmapRgn function for outlining a region, but does not provide any functions for responding to the user's mouse clicks and movements one-by-one. For that purpose, you should use Windows GDI functions to draw lines or shapes in the device context while the user is designing the region. You can then call the appropriate LEADTOOLS function to create the bitmap region, and call the L_FrameBitmapRgn function to outline it. For information about using the WIN32 GDI functions, refer to the WIN32 SDK online help, and from the Overviews section, select Graphics Device Interface.

Use L_SetBitmapRgnMagicWand to set a region based on the color of a specified point.

Use L_SetKaufmannRgnBitmap to create a Kaufmann region. The Kauffman region is created to better define a specific area of an image. Since noise affects region creation, this function enhances the image to improve the region growing process. Regions created using this function can be used to determine the Kaufmann ratio, which is the size of the corpus callosum / the size of the brain sphere.

To create a region based on the color of a specified point and a range of tolerance values, use L_SetBitmapRgnBorder.

To create a new curve region, or update an existing region with a curve region, use L_SetBitmapRgnCurve.

Related topics:

Translating Coordinates for a Bitmap Region

Working with the Existing Bitmap Region

Functions Where the Region Preempts the Bitmap

Functions that Transform the Region and the Bitmap

Saving a Region


Translating Coordinates for a Bitmap Region

Several of the LEADTOOLS functions for creating and working with a bitmap region use coordinates from an external representation of the region, such as a shape drawn in a device context.

To compensate for possible differences in view perspective, scaling, and display offsets, these LEADTOOLS functions require that you provide translation information in an RGNXFORM structure. (For details on how information is translated, refer to the structure description.)

In most cases, the external representation of a bitmap region is scaled and positioned relative to the display coordinates of a LEADTOOLS painting function. Therefore, the following table describes the fields to set in the RGNXFORM structure, based on the parameters of the L_PaintDC function:

Sample Field Name | Description
XForm.uViewPerspective | The view perspective of the external representation. With LEADTOOLS painting functions, the view perspective is always TOP_LEFT.
XForm.nXScalarNum | The numerator for the X scaling factor.
 | When translating information from the bitmap, you can use the width of the painting function's destination rectangle for this value. Functions that translate in this direction are L_FrameBitmapRgn, L_GetBitmapRgnBounds, and L_GetBitmapRgnHandle.
 | When translating information to the bitmap, you can use the width of the painting function's source rectangle for this value. (By default, it is the bitmap width.) Functions that translate in this direction are L_SetBitmapRgnEllipse, L_SetBitmapRgnHandle, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, and L_SetBitmapRgnRoundRect.
XForm.nXScalarDen | The denominator for the X scaling factor.
 | When translating information from the bitmap, you can use the width of the painting function's source rectangle for this value. (By default, it is the bitmap width.)
 | When translating information to the bitmap, you can use the width of the painting function's destination rectangle for this value.
 | Refer to the nXScalarNum field to see which functions translate which direction.
XForm.nYScalarNum | The denominator for the Y scaling factor.
 | When translating information from the bitmap, you can use the height of the painting function's destination rectangle for this value.
 | When translating information to the bitmap, you can use the height of the painting function's source rectangle for this value. (By default, it is the bitmap height.)
 | Refer to the nXScalarNum field to see which functions translate which direction.
XForm.nYScalarDen | The denominator for the Y scaling factor.
 | When translating information from the bitmap, you can use the height of the painting function's source rectangle for this value. (By default, it is the bitmap height.)
 | When translating information to the bitmap, you can use the height of the painting function's destination rectangle for this value.
 | Refer to the nXScalarNum field to see which functions translate which direction.
XForm.nXOffset | The X offset of the external representation.
 | When translating information from the bitmap, you can use the left value of the painting function's destination rectangle.
 | When translating information to the bitmap, you can negate the left value of the painting function's destination rectangle (-left).
 | Refer to the nXScalarNum field to see which functions translate which direction.
XForm.nYOffset | The Y offset of the external representation.
 | When translating information from the bitmap, you can use the top value of the painting function's destination rectangle.
 | When translating information to the bitmap, you can negate the top value of the painting function's destination rectangle (-top).
 | Refer to the nXScalarNum field to see which functions translate which direction.

All region functions accept a NULL pointer for this structure. In that case, no transformation occurs. The scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.

Related topics:

Creating a Bitmap Region

Working with the Existing Bitmap Region

Functions Where the Region Preempts the Bitmap

Functions that Transform the Region and the Bitmap

Saving a Region


Working with the Existing Bitmap Region

You can save a region in the alpha channel of a 16- or 32-bit file. For an example, refer to L_SetBitmapAlpha.

You can use the L_BitmapHasRgn function to see if a bitmap has a region. If the bitmap has a region, you can do the following with it:

Use L_FrameBitmapRgn to outline the region.

Display the region using functions described in Displaying a Region.

Use L_GetBitmapRgnHandle to create a Windows region that is a snapshot of the bitmap region.

Use L_OffsetBitmapRgn to move the region.

Use L_GetBitmapRgnArea, L_GetBitmapRgnBounds, and L_IsPtInBitmapRgn to get information about the region's size and location.

Use L_ColorBitmapRgn to display a filled, color representation of a region.

Use L_FreeBitmapRgn to free the region.

Determine the number of maximum number of segments present in any row in the region by calling L_GetBitmapClipSegmentsMax. Once this is known, a buffer can be allocated and the segments can be retrieved using the L_GetBitmapClipSegments function.

To create a new region, or update an existing region, based on either an HSV range or an RGB range, use L_SetBitmapRgnColorHSVRange or L_SetBitmapRgnColorRGBRange. To convert between HSV and RGB color space, use the L_HSVtoRGB and the L_RGBtoHSV functions.

To create a new curve region, or update an existing region with a curve region, use L_SetBitmapRgnCurve.

To resize a bitmap region a specific number of pixels, use the L_ResizeBitmapRgn function.

Use L_HolesRemovalBitmapRgn to remove holes from a bitmap region.

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 L_CreateMaskFromBitmapRgn function 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 L_SetBitmapRgnFromMask function.

Save it to the alpha information in a 16/32-bit image. You would convert the region to a 1-bit mask using the L_CreateMaskFromBitmapRgn function, after which you would set the mask to the alpha channel using the L_SetBitmapAlpha function. During load, you would get the alpha bitmap with the L_GetBitmapAlpha function, convert it to 1-bit if necessary and then set the region with the L_SetBitmapRgnFromMask function.

Related topics:

Creating a Bitmap Region

Defining and Using a Bitmap Region

Translating Coordinates for a Bitmap Region

Working with the Existing Bitmap Region

Functions Where the Region Preempts the Bitmap

Functions that Transform the Region and the Bitmap


Implementing Annotations

Note:

This topic is for Document/Medical only.

Annotations are based on vectored drawing functions and are associated with bitmaps as an overlay of the displayed image. LEADTOOLS supports a number of annotation types, including lines, rectangles, audio clips, hotspots, redact objects, polygons, and containers. A container is a specialized annotation object that lets you position and group other annotation objects, including other container objects. For a full list of available annotation types, refer to Types of Annotations.

LEADTOOLS maintains annotations separately from bitmaps. 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 functions supported by LEADTOOLS let you create automated annotations or non-automated annotations, depending on your application’s requirements.

Automated Annotations

Automated annotations require an automation object to be associated with the top-level container, also known as the root container. This automation object lets you maintain default properties for all objects in the root container. For example, you can use it to set the default font and the default line width. Keep in mind, however, that scaling factors affect the appearance of these default measurements. The values are set based on the scaling factors that are in effect at the time you create the object. Features associated with automated annotations are:

Automated annotation menus appear when you right click in design mode. These menus may or may not include the hyperlink menu item.

Automated drawing lets you use the left mouse button to draw annotations in design mode.

The annotation toolbar lets you select the annotation tool to draw.

LEADTOOLS handles the activation of audio annotations and hyperlinks.

You can undo a number of user actions, executed using the automated annotations functions.

You can implement the automation using only a few supporting functions.

First, use the following function to create the root container:

L_AnnCreateContainer

Then, use the following functions to create and maintain an automation object:

L_AnnCreate

L_AnnCreateItem

L_AnnGetAutoBackColor

L_AnnGetAutoContainer

L_AnnGetDpiX

L_AnnGetDpiY

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetOptions

L_AnnGetRect

L_AnnGetShowFlags

L_AnnGetTextOptions

L_AnnGetTool

L_AnnInsert

L_AnnSetAutoBackColor

L_AnnSetAutoContainer

L_AnnSetAutoDefaults

L_AnnSetDpiX

L_AnnSetDpiY

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetOptions

L_AnnSetRect

L_AnnSetShowFlags

L_AnnSetTextOptions

L_AnnSetTool

The following functions provide selection capabilities:

L_AnnGetSelected

L_AnnRemove

L_AnnSelectPoint

L_AnnSelectRect

L_AnnGetSelectRect

L_AnnGetContainer

L_AnnGetTopContainer

L_AnnCutToClipboard

L_AnnHitTestExt

L_AnnGetType

L_AnnShowLockedIcon

L_AnnGetSelectCount

L_AnnSetSelected

L_AnnInsert

You can modify and enhance the automated features using other annotation functions and the WM_LTANNEVENT message.

Note: | In automation mode, the undo feature can cause the values of object handles to change. Therefore, if your application needs to identify the object that is activated or deactivated, you should use the tag property. The L_AnnSetTag function sets the tag, and L_AnnGetTag gets the current value.
Note: | The annotation example program that ships with LEADTOOLS is implemented using high-level automated features. For more information about the annotation demo, and to see an example of the automated user interface, refer to Automated User Interface for Annotations.

For information on creating an automated annotation program, refer to Implementing an Automated Annotation Program and Using Automated Annotations in Run Mode.

Non-automated Annotations

Non-automated annotations allow you to customize the creation of and interaction with annotations to suit your own needs. Any LEADTOOLS annotation function, except those requiring an automation object, can be used when working with non-automated annotations. When programming non-automated annotations, it is important to remember:

You must provide any menus or dialogs you wish to use for entering annotation data.

You must also provide your own means of drawing and interacting with the annotations.

No hyperlink activation is provided for non-automated annotations. In addition to providing the code for entering hyperlink type and associated parameters, you must also provide the code for accessing the default web browser and calling any programs to be run through a hyperlink.

For information on creating a non-automated annotation program, refer to Implementing a Non-automated Annotation Program and Using Non-automated Annotations in Run Mode.

For a list of functions pertaining to various aspects of implementing annotations, refer to:

Annotation Functions: Implementing Automation.

Annotation Functions: Working with the Toolbar.

Annotation Functions: Input and Output

Annotation Functions: Creation, Deletion and Copying

Annotation Functions: Global Properties

Annotation Functions: Size, Position and Shape

Annotation Functions: Object Properties

Annotation Functions: Display and Printing

Annotation Functions: Realizing to a Bitmap

For more information on annotations, refer to:

Automated User Interface for Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Implementing Annotation Security

Implementing Annotation Hyperlinks

Annotation Objects - Default Values

Annotation Objects - Automated Features

Grouping and Ungrouping Annotation Objects

Displaying and Manipulating Annotation Objects

Creating, Deleting, and Copying Annotation Objects

Encryption and Decrytion Annotation Objects

Obtaining Annotation Object Information

Altering Annotation Object Settings


Implementing Custom Annotations

Functionality being added with Version 14 now makes it possible for you to create custom annotations that look and behave in almost any way imaginable. Custom annotations can be made to respond to almost any key sequence: the annotation DLL sends the WM_LTANNEVENT messages LTANNEVENT_LBUTTONDOWN, LTANNEVENT-MOUSEMOVE, and the LTANNEVENT_LBUTTONUP; and the WM_LTANNEVENT IParam points to an ANNMOUSEPOS structure that contains detailed information about the mouse’s position and status.

The following functions are used when creating custom annotations:

L_AnnAddUserHandle

L_AnnAdjustPoint

L_AnnChangeUserHandle

L_AnnConvert

L_AnnCreateItem

L_AnnCreate

L_AnnDefine2

L_AnnDefine

L_AnnDeleteUserHandle

L_AnnEnumerateHandles

L_AnnGetOptions

L_AnnGetRestrictToContainer

L_AnnGetUserHandle

L_AnnGetUserHandles

L_AnnHitTestExt

L_AnnHitTest

L_AnnRestrictCursor

L_AnnSetOptions

L_AnnSetRestrictToContainer

In addition, several messages have been added to the WM_LTANNEVENT event in order to implement the functionality for creating custom annotations.

There are 5 steps involved in creating a custom annotation:

1. | Break the custom annotation into components.
2. | Decide on the location and behavior of the annotation object handles.
3. | Define the functions for creating the annotation.
4. | Define the functions for the user handles.
5. | Define any Miscellaneous functions that may be necessary.

For more information refer to the WM_LTANNEVENT event and ANNMOUSEPOS structure documentation.

In the LEAD toolkit, there is no L_AnnDefine capability for moving and resizing a line simultaneously. The following example creates a custom object that demonstrates this capability. More specifically, this custom object creates a rectangle that has a line in the middle of it, and that line continues to stay in the middle whenever you resize and/or rotate the rectangle as shown in the figure below. For compelete sample code, refer to Example1 in your C:\Program Files\LEAD Technologies, Inc\LEADTOOLS\Examples\DLL\ANNOTATE directory.

{bmcAnn14Doc_3.bmp}

This object being created has 4 nodes. The line bisecting the rectangle has a yellow node at the top end and a gray node at the bottom end. The two sides have a node in the middle: a black node on the left and a red node on the right.

When the object is selected, you can click and drag the object to another location by clicking on a point that is not a node.

If you click on one of the two side nodes, you can adjust the width of the rectangle, and as the rectangle is redrawn, the line in the middle adjusts so it stays in the middle.

If you click on the top or bottom node, the opposite node becomes an anchor point and you can simultaneously adjust the height and rotate the rectangle as much as 90 degrees about the anchor point in either the clockwise or counterclockwise direction. The line in the middle continuously adjusts so it remains parallel to the two sides, anchored to the top and bottom, and bisects the rectangle.

To create this object, perform the following steps:

1. | Break the custom annotation into components. At this point, it is easiest to make a copy of example1.h and example1.c, and replace each occurrence of "example1" with the name of your custom annotation object.
 | (The custom annotation object Example1 consists of a rectangle and a square. We will create the custom object by grouping together a line and a rectangle.)
2. | Decide on the location and behavior of the annotation object handles (Example1 has four handles—one on each side, one on the top, and one on the bottom).

Create defines for the handles, assigning each a unique ID.

(The defines for Example1 are:

#define HANDLE_ID_HORIZONTAL_TOP 100
#define HANDLE_ID_HORIZONTAL_BOTTOM 101
#define HANDLE_ID_VERTICAL_LEFT 102
#define HANDLE_ID_VERTICAL_RIGHT 103

)

Decide on their behavior.

(The behavior for the handles for Example1 are:

HANDLE_ID_VERTICAL_LEFT --horizontal resize
HANDLE_ID_VERTICAL_RIGHT --horizontal resize
HANDLE_ID_HORIZONTAL_TOP -- rotate around ANDLE_ID_HORIZONTAL_BOTTOM
HANDLE_ID_HORIZONTAL_BOTTOM -- vertical resize

)

3.

Define the functions for creating the annotation. Create functions are called (via the WM_LBUTTONDOWN message) when creating the custom annotation using automation and the annotation menu.

Using L_AnnDefine functions, create the object(s) that will be displayed when drawing your annotation. An outline of the object(s) will be drawn when moving the mouse during object creation.

Create each of the component annotation objects using L_AnnCreateItem(). It is useful to create a structure (EXAMPLE1) and add this to the LPCHILDDATA structure. The EXAMPLE1 structure contains fields for everything required to create the custom annotation.

Then call L_AnnDefine(ANNDEFINE_BEGINSET) to begin definition of the object.

(For illustration of this in Example1, refer to the code beginning with:

L_VOID Example1_LButtonDown(HWND hWnd, LPCHILDDATA pData);

)

Call L_AnnDefine(ANNDEFINE_APPEND) for each of the component objects.

(For illustration of this in Example1, refer to the code beginning with:

L_VOID Example1_MouseMove(LPCHILDDATA pData);

The Example1 object has a vertical line that is moved and resized as the rectangle grows. There is no L_AnnDefine state to do this, so it is necessary to process the LTANNEVENT_HIGHLIGHT message. This message allows you to customize the hilighting behavior).

Finish defining all of the component objects (In Example1, the components are a line and a rectangle). For each of the components, set a tag that identifies component as part of a single custom object, and also identifies the part of the custom object. This is accomplished by calling AnnSetID().

Hide the default handles for the component objects using HideDefaultHandles().

Select the component objects using L_AnnSetSelected, give them their default automation values using L_AnnSetAutoDefaults, and finally group them together using L_AnnGroup. Grouping the component objects places them all in a new annotation container, which is part of the root annotation container.

Finally, add user handles to the custom object. There are several ways to add user handles. The handles can all be added to one of the component objects, or the handles can be added to one or more of the component objects. The best choice depends on the particular custom object. (Look at the function Example1_AddUserHandles to get an idea how to add user handles.)

(For illustration of this in Example1, refer to the code beginning with:

L_VOID Example1_LButtonUp(LPCHILDDATA pData, L_UINT uTool);

)

In some cases, it may be necessary to destroy and recreate an object. ( Vertical lines normally exist as independent objects and do not maintain their orientation and length with reference to other objects. These behaviors are required for the vertical line in Example1 and so the vertical line behavior must be customized. To create the illusion that the vertical line is moving you destroy the "dummy" line and recreate it where you want it—in the center of the rectangle.)

4.

Define functions for the user handles. ** Update Handle functions are called (via the LTANNEVENT_LBUTTONDOWN message) when the mouse drags a user handle.

In Example1 there are three functions, and these completely define the behavior of each user handle. Each of these functions does the following:

1. | Calls AnnGetNeighborObjects--The user handle can be on any of the component annotation objects. AnnGetNeighborObjects gets an array of ALL the corresponding objects that make up the custom annotation.
2. | Calls AnnSortNeighborObjects--This sorts the component objects according to the component number. Recall that when you create the component objects, AnnSetID(HANNOBJECT hObject, L_INT nMainID, L_INT nPartID) was called for each component.
 | The first component has a nPartID of 0, the next has nPartID of 1, and so on. After sorting
 | the objects, pData->AnnObjectNeighbors[n] now contains the nth component of the custom object.
3. | Does a switch statement on (pData->nUserHandleID) to determine which user handle is being dragged, and uses the corresponding L_AnnDefine and L_AnnDefine2 statements to accomplish the desired behavior.
4. | Restricts the mouse cursor. This can easily be done in two ways:
 | i) | Calling L_AnnRestrictCursor(pData->hContainer, &rcClip, NULL, NULL, FALSE); (See the function BoxSide custom object for an example.)
 | Or |
 | ii) | Setting pMousePos->pt (in the pANNMOUSEPOS structure) to the adjusted point. Set pMousePos->fUpdatePos = TRUE. The function L_AnnAdjustPoint can be helpful, especially when working with rotated objects. For details, see the documentation for WM_LTANNEVENT.

(For illustration of the first needed function in Example1, refer to the code beginning with:

L_VOID Example1_Handle_LButtonDown(LPCHILDDATA pData, pANNMOUSEPOS pMousePos);

If dragging handles HANDLE_ID_VERTICAL_LEFT or HANDLE_ID_VERTICAL_RIGHT, we want to resize the rectangle (L_AnnDefine(ANNDEFINE_BEGINRESIZE) and move the line (L_AnnDefine(ANNDEFINE_MOVE).

If dragging handle HANDLE_ID_HORIZONTAL_BOTTOM, we want to again resize the rectangle (L_AnnDefine(ANNDEFINE_BEGINRESIZE)), but with the line instead of moving it, we now want to resize it. (L_AnnDefine(ANNDEFINE_BEGINRESIZE)).

If dragging handle HANDLE_ID_HORIZONTAL_TOP, we want to rotate the rectangle around HANDLE_ID_HORIZONTAL_BOTTOM. This is accomplished by setting HANDLE_ID_HORIZONTAL_BOTTOM to be the anchor point, and doing a L_AnnDefine(ANNDEFINE_BEGINROTATE). This is done for both the line and the rectangle.

)

(For illustration of the second needed function in Example1, refer to the code beginning with:

L_VOID Example1_Handle_MouseMove(LPCHILDDATA pData, pANNMOUSEPOS pMousePos);

In this function simply update the component objects. Call L_AnnDefine(ANNDEFINE_APPEND) for each object. If you have decided to restrict the mouse cursor using L_AnnAdjustPoint(), you must call in this function.

)

(For illustration of the third needed function in Example1, refer to the code beginning with:

L_VOID Example1_Handle_LButtonUp(LPCHILDDATA pData, pANNMOUSEPOS pMousePos);

In this function, call L_AnnDefine(ANNDEFINE_END) for each component object.

Also, update the location of the user handles. The user handles move with the custom object when the entire object is moved. However, when you modify components of the entire object (by using L_AnnDefine) the handles do not move automatically. In this case, it is necessary to move the handles. The easiest way to do this is to call the utility function MoveHandle().

)

5.

Define any Miscellaneous functions that may be necessary. The example custom annotation object needs two miscellaneous functions: one that creates and sets the location of all the user handles, and another that is called whenever any component object is about to be highlighted.

(For illustration of creating user handles in Example1, refer to the code beginning with:

L_VOID Example1_AddUserHandles(HANNOBJECT hObject, pANNPOINT pAnnPoints);

This function creates the user handles for the Example1 custom object. It is also used in the Example1_Handle_LButtonUp to set the location of all the user handles. Another way to accomplish this is to use the MoveHandle() function instead in the Example1_Handle_LButtonUp function.

)

(For illustration of creating custom highlighting in Example1, refer to the code beginning with:

L_VOID Example1_Hilight(LPCHILDDATA pData, pANNHILIGHT pAnnHilight);

This function is called whenever any component object is about to be hilighted. Objects are hilighted in response to the L_AnnDefine and L_AnnDefine2 functions. The calls to hilight an object come in pairs--the first call removes the previous hilight, and the next call draws the new hilight. You can tell which type of hilight this is by checking the pAnnHilight->bRemoveHilight flag. If TRUE, the hilight is the first of the pair--it is removing a previous hilight.

This function is useful for creating custom hilighting. In the LEAD toolkit, there is no L_AnnDefine for moving and resizing a line simultaneously. By using this function, (which is called as a result of processing the WM_LTANNEVENT when lParam is LTANNEVENT_HIGHLIGHT), the behavior of the line hilight is customized by changing the pAnnHilight->ppts array.

)

See Also

WM_LTANNEVENT Message

ANNMOUSEPOS

Implementing Annotations

Automated User Interface for Annotations

Implementing an Automated Annotation Program

Implementing a Non-automated Annotations Program

Using Non automated Annotations in Run Mode


Automated User Interface for Annotations

Note:

This topic is for Document/Medical only.

The annotation example program that ships with LEADTOOLS is implemented using high-level automated features. This topic describes which parts of the example program are automated and which parts are not.

Behavior That Is Not Automated

When the main window is created, the example program creates the annotation toolbar using the L_AnnCreateToolbar function and initializes a tool-tracking variable by calling the L_AnnGetToolBarChecked function.

When a child window is created, if annotation data is present, the window is set to the container of the child window using L_AnnSetWnd. If annotation data is not present, a container is created for the child window. Next, the user mode is set using L_AnnSetUserMode. An automation object is then created, associated with the container, and activated using L_AnnCreate, L_AnnSetAutoContainer and L_AnnSetActiveState. This allows you to interact with the annotations, and is required to create the automated mode for annotations. Finally, parameters are set to control the translation of annotations added to the container, undo depth, and the hyperlink menu item.

When a child window is closed, the program disables and destroys the annotation objects using the L_AnnSetActiveState and L_AnnDestroy functions.

The pull-down menus in the example program let you control the automation, but the menu items, themselves, are not automated. (Only the pop-up menus, invoked with the right mouse button, are automated.) The pull-down menu options that affect annotations do the following:

File > Open lets you load an image file. If the image file has an associated annotation file (with the same file name, but with a file extension of ANN), this menu option also loads the annotation file using the L_AnnLoad function. If there is no associated annotation file, the program creates an annotation container that is the same size as the bitmap. This is done with the L_AnnCreateContainer function. The program also creates and assigns an automation object using the L_AnnCreate and L_AnnSetAutoContainer functions. (The automation object lets you control the default properties.)

File > Save lets you save the image file as you normally would, but it also saves an annotation file, giving it the same name as the image file, but with a file extension of ANN.

File > Print lets you print the image as you normally would, but it also prints the annotations using the L_AnnPrint function.

Edit > User Mode sets the automated user mode to design mode or run mode using the L_AnnSetUserMode function.

Edit > Tool changes the selected tool in the toolbar using the L_AnnSetToolBarChecked function.

View > Normal, Zoom, and Fit Image to Window change the display rectangle for painting the image, then change the scaling factors of the root annotation container to match the displayed image. The program uses the L_AnnSetScalarX and L_AnnSetScalarY functions to do this. (To handle scrolling, the program uses the L_AnnSetOffsetX and L_AnnSetOffsetY functions.)

Behavior That Is Automated

The toolbar created by the L_AnnCreateToolbar function appears as follows:

In design mode, you can select tools from the toolbar and draw them 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. The pop-up menu appears 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:

User Interface for Container and Automation Objects

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

Video Tool

PushPin Tool

Protractor Tool

Cross product Tool

Freehand Hot Spot Tool

Point Tool

Rubber Stamp Tool

Curve Tool

Closed Curve Tool

RTF Tool

PolyRuler Tool

Encrypt Tool

Text Pointer Tool


User Interface for Container and Automation Objects

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. When you change the default properties, you are, in fact, changing the properties of the automation object that is associated with the container. 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 and 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 Annotations.

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.

Use the L_AnnSetOptions function and the L_AnnGetOptions function 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.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the L_AnnGetTextOptions and the L_AnnSetTextOptions functions 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 functions 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 L_AnnSetOptions function.

Use the L_AnnSetFillMode and L_AnnGetFillMode functions to manage the fill mode used by annotation objects. The L_AnnSetFillModeExt and the L_AnnGetFillModeExt extends the original functions to support the ANNMODE_ALPHA fill mode. Before calling these two functions, enable the alpha background fill mode by calling the L_AnnSetOptions function.

Grouping and Ungrouping Annotation Objects.

When using Automated annotations, if the UserMode is set to ANNUSER_DESIGN, selecting or un-selecting an object that belongs to a container which is not the root container, makes all objects from that container to be selected or unselected. This allows all objects in a sub-container to be treated as a group.

To group objects, create a container and insert the new container into the root container specifying fStripContainer = FALSE in the call to L_AnnInsert. Then, you can insert items into the sub-container to create a group. Any object that is inside the root container will be treated as an individual object when using Automated annotations. This is done automatically for you when using Automated annotations and the user selects Group or Ungroup from the automation menu.

Disabling Automation Menu Items

When you call L_AnnSetAutoText, if you pass an empty string, the menu item defined by uItem will be disabled and removed from the automation menu. To re-enable the menu item, you must call L_AnnSetAutoText and pass a valid string.

For low-level implementation details, refer to Container Annotation Object and Annotation Automation Object.


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. | Set the root container's coordinates as follows: 0, 0, bitmap width -1, bitmap height -1.
2. | Set the X and Y scaling factors of the root container 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 the L_PaintDC function.
3. | Set the X and Y offsets of the root container 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, update the scaling factors and offsets of the root container, and redraw annotation objects 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:

L_AnnSetScalarX

L_AnnSetScalarY

L_AnnGetScalarX

L_AnnGetScalarY

Offsets:

L_AnnSetOffsetX

L_AnnSetOffsetY

L_AnnGetOffsetX

L_AnnGetOffsetY

Related topics:

Implementing Annotations

Types of Annotations

Annotation Objects - Automated Features


Implementing Annotation Security

Note:

This topic is for Document/Medical only.

LEADTOOLS provides annotation security through a number of functions. L_AnnLock and L_AnnUnlock let you lock and unlock annotations using a specific case sensitive key. L_AnnShowLockedIcon provides you the option of having a padlock icon drawn on top of all locked objects. L_AnnGetLocked also lets you determine whether an object is locked or unlocked.

Related topics:

Redaction Annotation Object

Encrypt Annotation Object


Implementing Annotation Hyperlinks

Note:

This topic is for Document/Medical only.

LEADTOOLS provides several functions 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 are set using L_AnnSetHyperlink. To determine the type of hyperlink associated with an annotation, use L_AnnGetHyperlink. This function also provides you with other information about the hyperlink. If a 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. To retrieve this information you must first call L_AnnGetHyperlinkLen to determine the length of the string containing this information and allocate a buffer in which to store the string. When working with automated annotations, L_AnnSetHyperlinkMenuEnable lets you enable or disable the displaying of the hyperlink menu item when you click on the right mouse button in design mode. To determine whether the menu item is enabled or disabled, use L_AnnGetHyperlinkMenuEnable.

When implementing automated annotation hyperlinks, (refer to Implementing an Automated Annotation Program), setting L_AnnSetHyperlinkMenuEnable only provides the hyperlink menu item that is seen when you right click on an annotation, while in design mode. You must provide the code for obtaining the hyperlink type, URL, program name and any other required information. Once this information has been obtained, LEADTOOLS will call the default browser or the appropriate program. The Annotate demo provides code for obtaining the required data.

If you are programming non-automated annotations, (refer to Implementing a Non-automated Annotation Program), you must also provide the code for accessing the default browser and calling any executables.


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 functions 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:

L_AnnLoad

L_AnnLoadMemory

L_AnnLoadOffset

Each annotation file contains information about the annotations stored in that file. This information can be obtained using the following functions:

L_AnnFileInfo

L_AnnFileInfoMemory

L_AnnFileInfoOffset

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 functions:

L_AnnDeletePage

L_AnnDeletePageMemory

L_AnnDeletePageOffset

Annotation files may be saved to disk, to memory, or embedded within another file, using the following functions:

L_AnnSave

L_AnnSaveMemory

L_AnnSaveOffset

When working with TIFF format files, L_AnnSaveTag can be called to save the annotation objects in a Wang compatible TIFF tag when the file is saved.


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:

L_AnnSetAutoText(hAutomation, ANNAUTOTEXT_XXX, "Translated String");

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.
L_AnnSetAutoDialogFontSize(hAutomation, 9);

//Change the font name.
L_AnnSetAutoText(hAutomation, ANNAUTOTEXT_DIALOG_FONT, TEXT("Japanese Font Name"));

2.

Change all the automation strings as follows:

L_AnnSetAutoText(hAutomation, ANNAUTOTEXT_XXX, TEXT("New Japanese String."));

3.

Change the default font to be used for all annotation objects (except buttons) created with this automation object.

L_AnnSetFontName(hAutomation, TEXT("Japanese Font Name"));


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:

Container Annotation Object

Annotation Automation Object

Line Annotation Object

Rectangle Annotation Object

Ellipse Annotation Object

Polyline Annotation Object

Polygon Annotation Object

Pointer Annotation Object

Freehand Line Annotation Object

Highlight Annotation Object

Redaction Annotation Object

Text Annotation Object

Note Annotation Object

Stamp Annotation Object

Hot Spot Annotation Object

Button Annotation Object

Audio Clip Annotation Object

Ruler Annotation Object

Video Annotation Object

PushPin Annotation Object

Protractor Annotation Object

Cross product Annotation Object

Freehand Hot Spot Annotation Object

Point Annotation Object

Rubber Stamp 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

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

Video Tool

PushPin Tool

Protractor Tool

Cross product Tool

Freehand Hot Spot Tool

Point Tool

Rubber Stamp Tool

Curve Tool

Closed Curve Tool

RTF Tool

PolyRuler Tool

Encrypt Tool

Text Pointer Tool


Displaying and Manipulating Annotation Objects

Note:

This topic is for Document/Medical only.

L_AnnDraw can be used to display a specific annotation object. If the annotation object is within a container, call L_AnnBringToFront or L_AnnSendToBack to alter the object’s display order within the container.

The L_AnnSetAutoDrawEnable function enables or disables the default use of the left mouse button to draw an annotation object in design mode. To implement the automated design mode for annotations, this function must be set to TRUE, and the L_AnnSetUserMode function must be set to ANNUSERMODE_DESIGN.

To apply an annotation object to the bitmap itself, call L_AnnRealize. This application is permanent, except when realizing a redact object. Realized redact objects store the background behind them within the object. Call L_AnnUnrealize to restore the background hidden by the redact object.

Call the L_AnnSetVisible function to make an object visible. When an object is not visible, it cannot be displayed. Some objects (notably containers) may be transparent, but if their visible-object property is set to TRUE, a user can select them with a mouse. Call the L_AnnGetVisible function to determine whether the specified object is visible.

The following functions may be used to work with containers and the objects they contain:

L_AnnBringToFront

L_AnnCopyFromClipboard

L_AnnConvert

L_AnnCreateContainer

L_AnnCreateItem

L_AnnCutToClipboard

L_AnnDraw

L_AnnGetAutoContainer

L_AnnGetContainer

L_AnnGetItem

L_AnnGetRestrictToContainer

L_AnnGetSelectCount

L_AnnGetSelectRect

L_AnnGetTopContainer

L_AnnGroup

L_AnnInsert

L_AnnRemove

L_AnnSendToBack

L_AnnSetAutoContainer

L_AnnSetGrouping

L_AnnSetRestrictToContainer

L_AnnUngroup

The following functions may be used to select the annotation object(s) to manipulate

L_AnnCutToClipboard

L_AnnGetContainer

L_AnnGetSelectCount

L_AnnGetSelected

L_AnnGetSelectItems

L_AnnGetSelectRect

L_AnnGetTopContainer

L_AnnGetType

L_AnnHitTestExt

L_AnnHitTest

L_AnnInsert

L_AnnRemove

L_AnnSelectPoint

L_AnnSelectRect

L_AnnSetSelected

L_AnnShowLockedIcon

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:

L_AnnGetTransparent

L_AnnSetTransparent

L_AnnGetTransparentColor

L_AnnSetTransparentColor

Use the L_AnnSetOptionsfunction and the L_AnnGetOptions function 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.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the L_AnnGetTextOptions and the L_AnnSetTextOptions functions 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 functions 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 L_AnnSetOptions function.

Use the L_AnnSetFillMode and L_AnnGetFillMode functions to manage the fill mode used by annotation objects. The L_AnnSetFillModeExt and the L_AnnGetFillModeExt extends the original functions to support the ANNMODE_ALPHA fill mode. Before calling these two functions, enable the alpha background fill mode by calling the L_AnnSetOptions function.

Set the color display options of any annotation object by calling the following functions:

L_AnnGetROP2

L_AnnSetROP2

The user can perform geometric transformations on an annotation object by calling the following functions:

L_AnnDefine

L_AnnBringToFront

L_AnnFlip

L_AnnMove

L_AnnResize

L_AnnReverse

L_AnnRotate

L_AnnSendToBack

L_AnnDefine2

Automation Cursor Snap Behavior

Use the L_AnnSetAutoSnapCursor function to set 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. Use the L_AnnGetAutoSnapCursor function to get a value that indicates whether snapping is enabled.


Creating, Deleting, and Copying Annotation Objects

Note:

This topic is for Document/Medical only.

L_AnnCreate creates a new annotation object of a specified type. To create a new annotation object that is a container, call L_AnnCreateContainer. New items can then be added within a container by calling L_AnnCreateItem.

Insert an annotation object into a container by calling L_AnnInsert. Remove an annotation object from a container by calling L_AnnRemove.

Call L_AnnCopy to create a duplicate of an existing annotation object.

To copy an annotation object from an annotation container to the Windows clipboard, call L_AnnCopyToClipboard. Similarly, call L_AnnCutToClipboard to cut a selected annotation object from an annotation container to the clipboard.

Before pasting an annotation object from the Windows clipboard to an annotation container, call L_AnnClipboardReady to ensure that the clipboard contains a pasteable annotation object. If L_AnnClipboardReady returns TRUE, then call L_AnnCopyFromClipboard to paste the annotation object into the annotation container


Encryption and Decrytion Annotation Objects

Encryption and Decryption Annotation Objects

Note:

This topic is for Document/Medical only.

The encrypt annotation object (ANNOBJECT_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 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.

Call L_AnnEncryptApply 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 L_AnnEncryptApply 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 L_ScrambleBitmap function to scramble all or a portion of a Bitmap. Scrambling a rectangular area means that the pixels in that area are shuffled around into a pseudo-random location within the area.

The L_ScrambleBitmap function can be used directly on a bitmap, and does not depend on annotations in any way.

Use the L_AnnGetEncryptOptions function to get the encrypt options of an encrypt or a decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnSetEncryptOptions function to set the encrypt options of an encrypt or a decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnGetSecondaryMetafile function to retrieve the current metafile for an encrypt object in a ‘decryptor’ state.

Use the L_AnnGetMetafile function to retrieve the current metafile for an encrypt object in an ‘encryptor’ state.

Use the L_AnnSetMetafile function to change the metafile for an encrypt or decrypt object.


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.

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

L_AnnGetBackColor

L_AnnGetBoundingRect

L_AnnGetContainer

L_AnnGetDpiX

L_AnnGetDpiY

L_AnnGetFillMode

L_AnnGetFillPattern

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontNameLen

L_AnnGetFontSize

L_AnnGetFontStrikeThrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetItem

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetObjectFromTag

L_AnnGetOffsetX

L_AnnGetOffsetY

L_AnnGetPredefinedBitmap

L_AnnGetPredefinedMetafile

L_AnnGetRect

L_AnnGetRestrictToContainer

L_AnnGetROP2

L_AnnGetRotateOptions

L_AnnGetSecondaryBitmap

L_AnnGetSecondaryMetafile

L_AnnGetSelectCount

L_AnnGetSelected

L_AnnGetSelectItems

L_AnnGetSelectRect

L_AnnGetTag

L_AnnGetText

L_AnnGetTextLen

L_AnnGetTool

L_AnnGetToolBarButtons

L_AnnGetToolBarButtonVisible

L_AnnGetToolBarChecked

L_AnnGetToolBarInfo

L_AnnGetTopContainer

L_AnnGetType

L_AnnGetUnit

L_AnnGetUnitLen

L_AnnGetUserData

L_AnnGetUserHandle

L_AnnGetUserHandles

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

This next set of functions is more specialized, applying only to certain annotation objects. For more information, refer to the individual function's documentation.

L_AnnGetActiveState

L_AnnGetAngle

L_AnnGetBitmap

L_AnnGetBitmapDpiX

L_AnnGetBitmapDpiY

L_AnnGetDistance

L_AnnGetDistance2

L_AnnGetEncryptOptions

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetGaugeLength

L_AnnGetMetafile

L_AnnGetNodes

L_AnnGetOptions

L_AnnGetPointCount

L_AnnGetPointOptions

L_AnnGetPoints

L_AnnGetPolyFillMode

L_AnnGetProtractorOptions

L_AnnGetRgnHandle

L_AnnGetRotateAngle

L_AnnGetSecondaryMetafile

L_AnnGetShowFlags

L_AnnGetTextAlign

L_AnnGetTextOptions

L_AnnGetTextPointerFixed

L_AnnGetTextRotate

L_AnnGetTextRTF

L_AnnGetTicMarkLength

L_AnnGetTransparent

L_AnnGetTransparentColor

This final set of functions applies only to automation annotation objects.

L_AnnGetAutoCursor

L_AnnGetAutoBackColor

L_AnnGetAutoDialogFontSize

L_AnnGetAutoDrawEnable

L_AnnGetAutoMenuEnable

L_AnnGetAutoMenuItemEnable

L_AnnGetAutoMenuState

L_AnnGetAutoOptions

L_AnnGetAutoSnapCursor

L_AnnGetAutoText

L_AnnGetAutoTextLen

L_AnnGetAutoUndoEnable


Altering Annotation Object Settings

Note:

This topic is for Document/Medical only.

LEADTOOLS provides many functions for altering the settings of annotation objects. Each of these annotation functions has a corresponding function that retrieves information about a specific annotation object.

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.

L_AnnSetBackColor

L_AnnSetDpiX

L_AnnSetDpiY

L_AnnSetFillMode

L_AnnSetFillPattern

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikeThrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOffsetX

L_AnnSetOffsetY

L_AnnSetPredefinedBitmap

L_AnnSetPredefinedMetafile

L_AnnSetRect

L_AnnSetRestrictToContainer

L_AnnSetRotateOptions

L_AnnSetSecondaryBitmap

L_AnnSetSelected

L_AnnSetTag

L_AnnSetText

L_AnnSetTool

L_AnnSetToolBarButtons

L_AnnSetToolBarButtonVisible

L_AnnSetToolBarChecked

L_AnnSetUnit

L_AnnSetUserData

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd

This next set of functions is more specialized in terms of which annotation objects they apply to. For more information, refer to the individual function's documentation.

L_AnnSetActiveState

L_AnnSetBitmap

L_AnnSetBitmapDpiX

L_AnnSetBitmapDpiY

L_AnnSetEncryptOptions

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetGaugeLength

L_AnnSetMetafile

L_AnnSetNodes

L_AnnSetOptions

L_AnnSetPointOptions

L_AnnSetPoints

L_AnnSetPolyFillMode

L_AnnSetProtractorOptions

L_AnnSetShowFlags

L_AnnSetTextAlign

L_AnnSetTextOptions

L_AnnSetTextPointerFixed

L_AnnSetTextRotate

L_AnnSetTextRTF

L_AnnSetTicMarkLength

L_AnnSetTransparent

L_AnnSetTransparentColor

This final set of functions applies only to automation annotation objects.

L_AnnSetAutoCursor

L_AnnSetAutoDialogFontSize

L_AnnSetAutoDrawEnable

L_AnnSetAutoHilightPen

L_AnnSetAutoMenuEnable

L_AnnSetAutoMenuItemEnable

L_AnnSetAutoMenuState

L_AnnSetAutoOptions

L_AnnSetAutoSnapCursor

L_AnnSetAutoText

L_AnnSetAutoUndoEnable


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" property, which determines whether the objects contained in that container are treated as a group by the automation. If the "Grouping" property is TRUE, then all the objects in the container should be treated as a group. If the "Grouping" property is FALSE, then the objects in the container can be selected and changed independently. The "Grouping" property of a container can be set using the L_AnnSetGrouping function. To determine the status of the "Grouping" property of a container, call L_AnnGetGrouping.

L_AnnGroup does the following:

creates a sub-container

moves the objects to this sub-container

sets the Grouping property for the sub-container to TRUE

Setting the Grouping property to FALSE by calling L_AnnSetGrouping with bAutoGroup set to FALSE is similar to calling L_AnnUngroup).

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 property 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 intercept the WM_LTANNEVENT message and 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).


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 L_AnnSetBackColor for that automation object. However, the Note, Push-pin, Redact and Hilite objects cannot be changed using this function 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 L_AnnSetAutoBackColor. This lets you 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 L_AnnGetAutoBackColor.


Undoing Automation Operations:

The LEADTOOLS API features include an Undo/Redo 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 functions for handling the undo capabilities.

To determine the current undo level of the automation handle, call L_AnnGetUndoDepth. To set a new undo depth for the automation handle, call L_AnnSetUndoDepth.

L_AnnUndo undoes the last automation operation performed.

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 L_AnnUndo undoes the whole group of operations and not just the last operation performed. This can be accomplished by:

1. | Call L_AnnSetUndoDepth to set the number of undo actions that can take place.
2. | Call L_AnnAddUndoNode to add an undo node to the automation object.
3. | Disable the undo feature by calling L_AnnSetAutoUndoEnable (FALSE).
4. | Perform the operations to be combined into one undo.
5. | Re-enable the undo feature by calling L_AnnSetAutoUndoEnable (TRUE).

Now, all three operations can be undone with one call to L_AnnUndo instead of three calls to L_AnnUndo.


Annotation Tutorials

Implementing an Automated Annotation Program

Implementing a Non-automated Annotation Program

Using Automated Annotations in Run Mode

Using Non-automated Annotations in Run Mode


Annotation Toolbar Buttons

The following are constants for the available Annotation Toolbar Buttons.

Value | Meaning
ANNTOOL_SELECT | [0] Selection Pointer Tool
ANNTOOL_LINE | [1] Line Tool
ANNTOOL_RECT | [2] Rectangle Tool
ANNTOOL_ELLIPSE | [3] Ellipse Tool
ANNTOOL_POLYLINE | [4] Polyline Tool
ANNTOOL_POLYGON | [5] Polygon Tool
ANNTOOL_POINTER | [6] Pointer Tool
ANNTOOL_FREEHAND | [7] Freehand Line Tool
ANNTOOL_HILITE | [8] Highlight Tool
ANNTOOL_REDACT | [9] Redaction Tool
ANNTOOL_TEXT | [10] Text Tool
ANNTOOL_NOTE | [11] Note Tool
ANNTOOL_STAMP | [12] Stamp Tool
ANNTOOL_BUTTON | [13] Button Tool
ANNTOOL_HOTSPOT | [14] Hot spot Tool
ANNTOOL_AUDIO | [15] Audio Clip Tool
ANNTOOL_RULER | [16] Ruler Tool
ANNTOOL_CROSSPRODUCT | [17] Cross product Tool
ANNTOOL_POINT | [18] Point Tool
ANNTOOL_PROTRACTOR | [19] Protractor Tool
ANNTOOL_VIDEO | [20] Video Tool
ANNTOOL_PUSHPIN | [21] PushPin Tool
ANNTOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot Tool
ANNTOOL_CURVE | [23] Curve Tool
ANNTOOL_CURVECLOSED | [24] Closed Curve Tool
ANNTOOL_ENCRYPT | [25] Encrypt Tool
ANNTOOL_TEXTPOINTER | [26] Text Pointer Tool
ANNTOOL_POLYRULER | [27] Polyruler Tool
ANNTOOL_RTF | [28] Rich Text Tool
ANNTOOL_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]
ANNTOOL_USER | [0x0100] First user defined tool // first user defined tool
ANNTOOL_USERLAST | [0x0200] Last allowed user defined tools// last allowed user tools


Loading and Pasting Automated Annotations

There are two examples for loading annotations and copying annotations from the clipboard in an automated annotation program.

1. In the Annotate example, when annotations are loaded from a file, or pasted from the clipboard, a child window is created. If annotation data is present, that data becomes the container for the child window and the window handle is set for the container. An automation object is then created and associated with the container. This allows full automated interaction with the newly added annotations. For more information on this, refer to ANNOTATE.C in the Annotate example.

2. In the documentation, the test functions in the sample code are designed to work with the tutorials Implementing an Automated Annotation Program and Using Automated Annotations in Run Mode. In the test functions for L_AnnLoad, L_AnnLoadMemory, L_AnnLoadOffset, and L_AnnClipboardReady, a local HANNOBJECT variable (TmpContainer) is updated with the handle of the incoming annotations. This HANNOBJECT is then inserted into hContainer, the root container. Since hContainer already has a window handle set and an automation object associated with it, full automated interaction with the newly added annotations is provided.


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:

L_AnnSetScalarX

L_AnnSetScalarY

L_AnnGetScalarX

L_AnnGetScalarY

Offsets:

L_AnnSetOffsetX

L_AnnSetOffsetY

L_AnnGetOffsetX

L_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. (Note that for performance reasons, fixed annotations should be used in conjunction with double buffering. For more information, see the documentation for Minimizing Flicker With Double Buffering.) 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 functions:

L_AnnGetFixed

L_AnnSetFixed

L_AnnPushFixedState

L_AnnPopFixedState

L_AnnIsFixedInRect

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:

ANNOBJECT_CONTAINER

ANNOBJECT_REDACT

ANNOBJECT_ENCRYPT


The Annotation Text Token Table

This feature applies to the text annotation objects that support tokens, namely the following:

ANNOBJECT_AUTOMATION,

ANNOBJECT_BUTTON,

ANNOBJECT_NOTE,

ANNOBJECT_TEXT,

ANNOBJECT_TEXTPOINTER,

ANNOBJECT_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:

L_AnnClearTextTokenTable

L_AnnDeleteTextTokenTable

L_AnnEnumerateTextTokenTable

L_AnnGetTextExpandTokens

L_AnnInsertTextTokenTable

L_AnnSetTextExpandTokens

Use L_AnnClearTextTokenTable to remove all tokens from the text token table.

Use L_AnnDeleteTextTokenTable to delete a text token from the annotation text token table.

Use L_AnnEnumerateTextTokenTable to examine the contents of the annotation text token table.

Use L_AnnGetTextExpandTokens to get the text expand token property of an annotation.

Use L_AnnInsertTextTokenTable to insert a text token into the text token table.

Use L_AnnSetTextExpandTokens 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.


Changing the Annotation Automation Pen Highlight Color

The default highlight pen has a COLORREF 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 L_AnnSetAutoHilightPen for that automation object. Each automation object can have its own highlight pen color. To change the default highlight pen for newly created automation objects, call L_AnnSetAutoHilightPen and pass NULL for the hAutomation parameter.

To change the highlight color back to the default color after changing the highlight color, you must call L_AnnSetAutoHilightPen and use a COLORREF value of 0xFFFFFF.


Using Rulers in Annotation Objects

Note:

This topic is for Document/Medical only.

The following annotation objects utilize one or more rulers as part of the annotation:

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_POLYRULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_RULER

In addition, the Automation object (ANNOBJECT_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 L_AnnGetUnit function. 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 L_AnnSetUnit function 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 functions that can be used to get the length of a ruler: the L_AnnGetDistance function and the L_AnnGetDistance2 function. The L_AnnGetDistance function can be used with up to 2 rulers, whereas the L_AnnGetDistance2 function can be used on any of the ruler objects. Call the L_AnnGetDistance2 function to get the length of all the rulers in an ANNOBJECT_POLYRULER object. If the annotation object is type ANNOBJECT_CROSSPRODUCT, ANNOBJECT_PROTRACTOR or ANNOBJECT_POLYRULER, the L_AnnGetDistance2 function 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 L_AnnGetDistance2 function is meant to replace the L_AnnGetDistance function, which is being phased out.

At each end of the ruler is a perpendicular line called a gauge. Use the L_AnnSetGaugeLength function 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 L_AnnGetGaugeLength function 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 L_AnnSetTicMarkLength function The length of the tic mark is expressed in pixels, not in points. Call the L_AnnGetShowFlags function to determine how the rulers are being displayed. Call the L_AnnSetShowFlags function 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 L_AnnSetBitmapDpiY function and set the vertical Bitmap DPI value to the bitmap's Y resolution. Likewise, call the L_AnnSetBitmapDpiX function 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.


Using Annotation Bitmap Objects

Note:

This topic is for Document/Medical only.

The following annotation objects utilize bitmaps or metafiles as part of the annotation:

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_POINT

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

In addition, the Automation object (ANNOBJECT_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:

L_AnnSetBitmap - Use this function with the ANNOBJECT_STAMP, ANNOBJECT_POINT, and ANNOBJECT_PUSHPIN objects to set the bitmap for the object. The ANNOBJECT_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 ANNOBJECT_STAMP displays text. In automation, there are different Rubber Stamp tools available: these are ANNOBJECT_STAMP objects set up to use the different metafiles for each rubber stamp selection (instead of text). The ANNOBJECT_PUSHPIN object displays a bitmap in design mode and a secondary bitmap in run mode.

L_AnnGetBitmap - Use this function with the ANNOBJECT_STAMP, ANNOBJECT_POINT, and ANNOBJECT_PUSHPIN objects to get the handle for bitmap being used for the object. The ANNOBJECT_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 ANNOBJECT_STAMP displays text. In automation, there are different Rubber Stamp tools available, which are ANNOBJECT_STAMP objects set up to use the different metafiles for each rubber stamp selection (instead of text). The ANNOBJECT_PUSHPIN object displays a bitmap in design mode and a secondary bitmap in run mode.

L_AnnSetMetafile – Use this function with the ANNOBJECT_STAMP (including the Rubber Stamp tools), ANNOBJECT_HOTSPOT, ANNOBJECT_FREEHANDHOTSPOT, and ANNOBJECT_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 L_AnnSetPredefinedMetafile function and pass NULL to hMetafile.

L_AnnGetMetafile – Use this function with the ANNOBJECT_STAMP, ANNOBJECT_HOTSPOT, ANNOBJECT_FREEHANDHOTSPOT, and ANNOBJECT_ENCRYPT objects and the Rubber Stamp tools to retrieve the metafile for the selected objects.

L_AnnSetSecondaryBitmap - Sets the secondary bitmap used by the specified annotation object. Only PushPin objects (ANNOBJECT_POINT) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the L_AnnSetBitmap and L_AnnGetBitmap functions) which displays whenever the text is shown, and a secondary bitmap, changed using the L_AnnSetSecondaryBitmap function. 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 ANNOBJECT_PUSHPIN object shows the text and displays the primary bitmap. In the run mode the object shows or hides the text when clicked.

L_AnnGetSecondaryBitmap - Gets the secondary bitmap used by the specified annotation object. Only PushPin objects (ANNOBJECT_POINT) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the L_AnnSetBitmap and L_AnnGetBitmap functions) which displays whenever the text is shown, and a secondary bitmap, changed using the L_AnnSetSecondaryBitmap function. 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 ANNOBJECT_PUSHPIN object shows the text and displays the primary bitmap. In the run mode the object shows or hides the text when clicked.

L_AnnGetPredefinedBitmap - Gets a copy of the specified predefined bitmap, used for the annotation Point object (ANNOBJECT_POINT).

L_AnnSetPredefinedBitmap – Changes or resets the predefined bitmap, used for the annotation Point object (ANNOBJECT_POINT).

L_AnnGetSecondaryMetafile - Gets the metafile handle associated with an ANNOBJECT_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.

L_AnnSetPredefinedMetafile - Sets the default metafiles used by the following object types:

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_STAMP (including the Rubber Stamp tools)

L_AnnGetPredefinedMetafile – Gets the default metafiles used by the following object types:

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_STAMP

Rubber Stamp tools


Flipping, Reversing and Rotating Annotation Objects

Note:

This topic is for Document/Medical only.

LEADTOOLS provides several functions for manipulating annotation objects so they are flipped, reversed, or rotated.

Use the L_AnnFlip function 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 L_AnnReverse function 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 L_AnnRotate function 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.

Flipping and Reversing:

All annotation objects flip or reverse with the following notes:

ANNOBJECT_AUDIO - metafile does not flip/reverse

ANNOBJECT_BUTTON - text itself does not flip/reverse

ANNOBJECT_ENCRYPT - metafile does not flip/reverse

ANNOBJECT_FREEHANDHOTSPOT -- metafile does not flip/reverse

ANNOBJECT_HOTSPOT - metafile does not flip/reverse

ANNOBJECT_NOTE - text itself does not flip/reverse

ANNOBJECT_POINT - if the point uses an image, the image does not flip/reverse

ANNOBJECT_PUSHPIN - text itself does not flip/reverse

ANNOBJECT_RTF - text itself does not flip/reverse

ANNOBJECT_STAMP – the text flips/reverses, but the image and metafile do not flip/reverse

ANNOBJECT_TEXT - text itself does not flip/reverse

ANNOBJECT_TEXTPOINTER - the tail flips, but the text does not flip/reverse

ANNOBJECT_VIDEO - metafile does not flip/reverse

Rotating:

All objects rotate EXCEPT for the following objects:

ANNOBJECT_AUDIO

ANNOBJECT_BUTTON

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT – the object rotates, but not the metafile

ANNOBJECT_HOTSPOT

ANNOBJECT_NOTE

ANNOBJECT_POINT

ANNOBJECT_PUSHPIN

ANNOBJECT_RTF

ANNOBJECT_TEXTPOINTER

ANNOBJECT_VIDEO

See Also

Displaying and Manipulating Annotation Objects


Calibrating Annotation Ruler Objects

Calibrating a ruler means assigning it to a specific length. 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 calibrating 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 function L_AnnCalibrateRuler to calibrate ruler objects.

In automated mode, calibration is accomplished as follows:

1. | Draw an ANNOBJECT_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 that you want the ruler to be assigned to.
6. | In the Measurement Units combo box, select the corresponding unit.
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, check the corresponding check box. If you check 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, check 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.


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 L_AnnSetOptions functions. 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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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 ANNBUTTON and the functions L_AnnFreeToolBarButtons, L_AnnGetToolBarButtons, L_AnnSetToolBarButtons

The new XP-style annotation toolbar can be enabled using the following code snippet:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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 L_AnnGetFillModeExt and L_AnnSetFillModeExt.

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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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 L_AnnSetAutoCursor and L_AnnGetAutoCursor functions.

The new annotation cursors can be enabled using the following code snippet:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | 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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | OPTIONS_NEW_ ESC_CANCEL);
}

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:

ANNOBJECT_RULER

ANNOBJECT_POLYRULER

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_PROTRACTOR

Any of these objects can be calibrated. To calibrate a ruler:

1. | Load desired image
2. | Draw an ANNOBJECT_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 ANNOBJECT_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:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | OPTIONS_NEW_CALIBRATE_RULER);
}

For more information on calibrating rulers, see the documentation for L_AnnCalibrateRuler, 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.

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | OPTIONS_NEW_DOT_DASH_LINES);
}

New XML Format

Prior to version 14.5, annotations could be saved in one of two formats:

ANNFMT_NATIVE – a text based file format for storing annotations

ANNFMT_ENCODED – a binary file format for storing annotations

In version 14.5, there is a new text-based format for annotations – ANNFMT_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 ANNFMT_XML format:

Unlike the ANNFMT_NATIVE, ANNFMT_XML is both forward and backward compatible.

It is human readable

Files using the ANNFMT_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 L_AnnSetOptions. To use this feature, simply pass the flag ANNFMT_XML to the annotation save functions. For more information, see the documentation for L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnLoad, L_AnnLoadOffset and L_AnnLoadMemory.

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.

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

ANNOBJECT_STAMP

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

For the following text based annotations, you can now optionally show or hide the border.

ANNOBJECT_TEXT

ANNOBJECT_STAMP

These properties can also be set for the following annotation objects for purposes of recursion:

ANNOBJECT_CONTAINER

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

To see these new features:

1. | Draw an ANNOBJECT_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.

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | OPTIONS_NEW_TEXT_OPTIONS);
}

For more information, see the documentation for the L_AnnSetTextOptions and L_AnnGetTextOptions functions.


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, click and drag to specify the rectangle in the current window. Then, specify the WAV file in the dialog box. Holding down the Shift key while drawing the audio clip will make the audio clip annotation square. In run mode, clicking on the icon plays the WAV file.

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.

Bring the object to the front or send it to the back.

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

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, click and drag to specify the size of the button in the current window. Holding down the Shift key while drawing the button will make the button annotation square. A dialog box then lets the user enter the text for the button. Clicking on the button sends a WM_LTANNEVENT message that indicates an activation event. The user 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.

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

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.


Closed Curve Tool

Note: This topic is for Document/Medical only.

The closed curve annotation object (ANNOBJECT_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.

Flip the object.

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

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.


Crossproduct Tool

Note:

This topic is for Document/Medical only.

The CrossProduct annotation object (ANNOBJECT_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. 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 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 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.

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.


Curve Tool

Note: This topic is for Document/Medical only.

The curve annotation object (ANNOBJECT_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.

Flip the object.

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

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.

Flip the object.

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

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 (ANNOBJECT_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 L_AnnEncryptApply 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 L_AnnSetMetafile function. The default image is shown in the figure below:

The decryptor metafile is changed with the Secondary Metafile option (in automation) or the L_AnnSetMetafile function. 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 L_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 L_AnnEncryptApply on the decryptor with the appropriate arguments. If successful, the decryptor state changes to encryptor. An Encrypt object in that encryptor 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 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 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.


Freehand Hot Spot Tool

Note:

This topic is for Document/Medical only.

The freehand hot spot annotation object (ANNOBJECT_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. Clicking on the button sends a WM_LTANNEVENT message that indicates an activation 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. 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 Hotspot 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 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.

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

Note:

This topic is for Document/Medical only.

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

(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, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the highlight 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 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 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.

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 hot spot 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 hotspot 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. Clicking on the hot spot sends a WM_LTANNEVENT message that indicates an activation event. Code can be added 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 Stamp 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 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.

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.

Flip the object.

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

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

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 point annotation object (ANNOBJECT_POINT) is a single point. With the automated functions, in design mode, each point is formed with a mouse click 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.

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.

Flip the object.

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

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

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

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.


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

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

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.


Protractor Tool

Note:

This topic is for Document/Medical only.

The Protractor annotation object (ANNOBJECT_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 and the fill pattern. 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 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.

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.


Push Pin Tool

Note:

This topic is for Document/Medical only.

The PushPin annotation object (ANNOBJECT_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 displays the hidden note.

A PushPin object has a primary bitmap, (manipulated using L_AnnSetBitmap/L_AnnGetBitmap) when the text is shown, and a secondary bitmap, changed using L_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 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.

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

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.

Lock and unlock annotation objects. See Password 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.

Bring the object to the front or send it to the back.

Change the line width and style properties. See Line 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 ROP2 code. See ROP2 Dialog Box for Annotations

Change the fixed properties. See Fixed Dialog Box for Annotations.

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

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.


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

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

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.


Rubber Stamp Tool

Note:

This topic is for Document/Medical only.

The rubber stamp annotation object (ANNOBJECT_STAMP_XXX) is a stamp object that has a metafile. For more information about the stamp tool, refer to Stamp Tool.

In design mode, click on the object with the right mouse button to do the following:

Change the fixed properties. See Fixed Dialog Box for Annotations.

For each Rubber Stamp, there is a corresponding tool that can be set using L_AnnSetTool. The Rubber Stamp tools are ANNTOOL_STAMP_XXX.


Ruler Tool

Note:

This topic is for Document/Medical only.

The ruler annotation object is a line that can be used to measure the distance between two points of the original image.

Holding down the Shift key while drawing the ruler will draw the ruler 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 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 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 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.

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 (ANNOBJECT_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 ANNOBJECT_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 frame's 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 Stamp 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 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.

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 Pointer Tool

Note:

This topic is for Document/Medical only.

The text pointer annotation object (ANNOBJECT_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 L_AnnTextEdit.

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

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.


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

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

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.


Video Tool

Note:

This topic is for Document/Medical only.

The video annotation object (ANNOBJECT_VIDEO) is a rectangle containing a scaled image that can be activated to play an AVI file or capture a multimedia file. 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 rectangle will make the video annotation square. A dialog box then lets the user specify the preferred options. In run mode, clicking on the icon plays the AVI file.

For playing the video, DirectX must be installed.

To capture an AVI file from a video card, LTCAP14n.dll is required.

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.

Lock and unlock annotation objects. See Password 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.

Bring the object to the front or send it to the back.

Change the name. 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.

Set the video file. See Video File Dialog Box for Annotations.

Perform a capture. See Capture Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

For low-level implementation details, refer to Video Annotation Object.


Types of Annotations

Note:

This topic is for Document/Medical only.

LEADTOOLS supports the following types of annotation objects:

Constant | Meaning
ANNOBJECT_CONTAINER | [0] Container Annotation Object
ANNOBJECT_TEXT | [15] Text Annotation Object
ANNOBJECT_NOTE | [9] Note Annotation Object
ANNOBJECT_LINE | [8] Line Annotation Object
ANNOBJECT_POLYLINE | [11] Polyline Annotation Object
ANNOBJECT_FREEHAND | [5] Freehand Line Annotation Object
ANNOBJECT_RECT | [12] Rectangle Annotation Object
ANNOBJECT_ELLIPSE | [4] Ellipse Annotation Object
ANNOBJECT_POLYGON | [10] Polygon Annotation Object
ANNOBJECT_POINTER | [1] Pointer Annotation Object
ANNOBJECT_BUTTON | [3] Button Annotation Object
ANNOBJECT_STAMP | [14] Stamp Annotation Object
ANNOBJECT_HILITE | [6] Highlight Annotation Object
ANNOBJECT_REDACT | [13] Redaction Annotation Object
ANNOBJECT_AUDIO | [2] Audio Clip Annotation Object
ANNOBJECT_HOTSPOT | [7] Hot Spot Annotation Object
ANNOBJECT_AUTOMATION | [16] Annotation Automation Object
ANNOBJECT_RULER | [17] Ruler Annotation Object
ANNOBJECT_CROSSPRODUCT | [18] Cross Product Annotation Object
ANNOBJECT_POINT | [19] Point Annotation Object
ANNOBJECT_PROTRACTOR | [20] Protractor Annotation Object
ANNOBJECT_VIDEO | [21] Video Annotation Object
ANNOBJECT_PUSHPIN | [22] PushPin Annotation Object
ANNOBJECT_FREEHANDHOTSPOT | [23] Freehand Hotspot Annotation Object
ANNOBJECT_CURVE | [24] Curve Annotation Object
ANNOBJECT_CURVECLOSED | [25] Closed Curve Annotation Object
ANNOBJECT_ENCRYPT | [26] Encrypt Annotation Object
ANNOBJECT_TEXTPOINTER | [27] Text Pointer Annotation Object
ANNOBJECT_POLYRULER | [28] Polyruler Annotation Object
ANNOBJECT_RTF | [29] Rich Text Annotation Object


Annotation Automation Object

Note:

This topic is for Document/Medical only.

The annotation automation object (ANNOBJECT_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 using the L_AnnSetAutoContainer function.

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 L_AnnSetTool function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the L_AnnSetTransparent function.
Transparent Color | Defaults to White. It can be changed using the L_AnnSetTransparentColor function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the L_AnnSetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Note Background Color | Defaults to yellow. It can be changed using the L_AnnSetAutoBackColor function.
Redact Background Color | Defaults to black. It can be changed using the L_AnnSetAutoBackColor function.
Hilite Background Color | Defaults to yellow. It can be changed using the L_AnnSetAutoBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
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 L_AnnSetPredefinedMetafile function.
Encrypt Metafile | Defaults to an image of a black skeleton key. It can be changed using the L_AnnSetPredefinedMetafile function.
Decrypt Metafile | Defaults to an image of a red skeleton key. It can be changed using the L_AnnSetPredefinedMetafile function.
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 L_AnnSetShowFlags function, the L_AnnSetGaugeLength function, and the L_AnnSetUnit function.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
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 L_AnnSetProtractorOptions and the L_AnnSetShowFlags function.
Point | Defaults to using a bitmap and not using transparent color. These options can be changed using the L_AnnSetTransparent function, L_AnnSetTransparentColor function, the L_AnnSetPredefinedBitmap function, and the L_AnnSetBitmap function.
Encrypt | Defaults to Encryptor. Set encryption options using the L_AnnSetEncryptOptions function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Menus enabled | Defaults to TRUE. It can be changed using the L_AnnSetAutoMenuEnable function.
Automation text strings | Default to hard-coded strings for menus and dialog boxes. Strings can be changed using the L_AnnSetAutoText function.
Highlight Pen Color | Defaults to white. It can be changed using the L_AnnSetAutoHilightPen function.

Additional automation properties can be set with the following functions. For details, see the corresponding documentation.

L_AnnSetTextExpandTokens

L_AnnSetActiveState

L_AnnSetAutoContainer

L_AnnSetAutoDrawEnable

L_AnnSetAutoMenuEnable

L_AnnSetAutoText

L_AnnSetBackColor

L_AnnSetBitmapDpiX

L_AnnSetBitmapDpiY

L_AnnSetDpiX

L_AnnSetDpiY

L_AnnSetFillMode

L_AnnSetFillPattern

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikeThrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetGaugeLength

L_AnnSetTicMarkLength

L_AnnSetHyperlink

L_AnnSetHyperlinkMenuEnable

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetOffsetX

L_AnnSetOffsetY

L_AnnSetPoints

L_AnnSetPolyFillMode

L_AnnSetROP2

L_AnnSetRect

L_AnnSetSelected

L_AnnSetScalarX

L_AnnSetScalarY

L_AnnSetTag

L_AnnSetText

L_AnnSetTextAlign

L_AnnSetTextRotate

L_AnnSetTextPointerFixed

L_AnnSetTool

L_AnnSetToolBarButtonVisible

L_AnnSetToolBarChecked

L_AnnSetTransparent

L_AnnSetUndoDepth

L_AnnSetUnit

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd

L_AnnSetNodes

L_AnnSetProtractorOptions

L_AnnSetNameOptions

L_AnnSetShowFlags

L_AnnSetMetafile

L_AnnSetPredefinedMetafile

L_AnnSetSecondaryBitmap

L_AnnSetAutoMenuItemEnable

L_AnnSetAutoMenuState

L_AnnSetUser

L_AnnSetAutoDefaults

L_AnnSetTransparentColor

L_AnnSetAutoOptions

L_AnnSetAutoDialogFontSize

L_AnnSetGrouping

L_AnnSetAutoBackColor

L_AnnSetAutoUndoEnable

L_AnnSetEncryptOptions

L_AnnSetPredefinedBitmap

L_AnnSetPointOptions

L_AnnSetRestrictToContainer

L_AnnSetFixed

L_AnnSetAutoCursor

L_AnnSetUserData

L_AnnSetTextRTF

Use the L_AnnSetOptions function and the L_AnnGetOptions function 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

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the L_AnnGetTextOptions and the L_AnnSetTextOptions functions 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 functions 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 L_AnnSetOptions function.

Use the L_AnnSetFillMode and L_AnnGetFillMode functions to manage the fill mode used by annotation objects. The L_AnnSetFillModeExt and the L_AnnGetFillModeExt extends the original functions to support the ANNMODE_ALPHA fill mode. Before calling these two functions, enable the alpha background fill mode by calling the L_AnnSetOptions function.

Related topics:

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 (ANNOBJECT_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.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

When you save this type of annotation, the WAV file is not saved. Only its path, specified in the text property, is saved.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Active state | Defaults to disabled. It can be changed using L_AnnSetActiveState.
Visible | Defaults to FALSE. It can be changed using L_AnnSetVisible.
Selected | Defaults to FALSE. It can be changed using L_AnnSetSelected.
Text | Defaults to an empty string. It can be changed to the path of the WAV file using L_AnnSetText.
Tag (identifier) | Defaults to 0. It can be changed using L_AnnSetTag.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using L_AnnSetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using L_AnnSetUserMode.
Fixed State | Defaults to not fixed. It can be changed using L_AnnSetFixed.
Name | Defaults to empty string. It can be changed using L_AnnSetNameOptions.

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 (ANNOBJECT_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 sends a WM_LTANNEVENT message that indicates an activation 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:

Active state | Defaults to disabled. It can be changed using the L_AnnSetActiveState function.
Visible | Defaults to FALSE. It can be changed using the L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Font | Defaults to a regular MS Sans Serif red font at 10 points. It can be changed using the L_AnnSetFontSize function, the L_AnnSetFontUnderline function, the L_AnnSetFontStrikeThrough function, the L_AnnSetFontItalic function, the L_AnnSetFontBold function, and the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the L_AnnSetTextExpandTokens function.
Name | Defaults to an empty string. It can be changed using L_AnnSetNameOptions.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

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 (ANNOBJECT_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.

You can change the points using the L_AnnGetPoints and the L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the L_AnnSetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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 L_AnnSetVisible.
Selected | Defaults to FALSE. It can be changed using L_AnnSetSelected.
Foreground color | Defaults to black. It can be changed using L_AnnSetForeColor.
Background color | Defaults to white. It can be changed using L_AnnSetBackColor.
Line width | Defaults to 1. It can be changed using L_AnnSetLineWidth. (Values equate to a minimum of 1 pixel when displayed.)
Line style | Defaults to NULL. It can be changed using L_AnnSetLineStyle.
Fill pattern | Defaults to solid. It can be changed using L_AnnSetFillPattern.
Fill mode | Defaults to transparent. It can be changed using L_AnnSetFillMode.
Tag (identifier) | Defaults to 0. It can be changed using L_AnnSetTag.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using L_AnnSetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using L_AnnSetUserMode.
Fixed State | Defaults to not fixed. It can be changed using L_AnnSetFixed.
Name | Defaults to empty string. It can be changed using L_AnnSetNameOptions.

Use the L_AnnSetOptions function and the L_AnnGetOptions function 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.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the L_AnnGetTextOptions and the L_AnnSetTextOptions functions 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 functions 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 L_AnnSetOptions function.

Use the L_AnnSetFillMode and L_AnnGetFillMode functions to manage the fill mode used by annotation objects. The L_AnnSetFillModeExt and the L_AnnGetFillModeExt extends the original functions to support the ANNMODE_ALPHA fill mode. Before calling these two functions, enable the alpha background fill mode by calling the L_AnnSetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Crossproduct Annotation Object

Note:

This topic is for Document/Medical only.

The CrossProduct annotation object (ANNOBJECT_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, you must define the points by calling the L_AnnSetPoints function. 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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Ruler show flags | Defaults to ANNSHOW_LENGTH + ANNSHOW_TICMARKS, 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 L_AnnSetShowFlags function, the L_AnnSetGaugeLength function, and the L_AnnSetUnit function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects

New Annotation Features of Version 14.5


Curve Annotation Object

The Curve annotation object (ANNOBJECT_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.

You can change the points using the L_AnnGetPoints and the L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Encrypt Annotation Object

The Encrypt annotation object (ANNOBJECT_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 L_AnnEncryptApply function 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 L_AnnEncryptApply 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 c 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 L_ScrambleBitmap function to scramble all or a portion of a Bitmap. Scrambling a rectangular area means that the pixels in that area are shuffled around into a pseudo-random location within the area.

The L_ScrambleBitmap function can be used directly on a bitmap, and does not depend on annotations in any way.

Use the L_AnnGetEncryptOptions function to get the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnSetEncryptOptions function to set the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the L_AnnGetSecondaryMetafile function to retrieve the current metafile for an Encrypt object in a ‘decryptor’ state.

Use the L_AnnGetMetafile function to retrieve the current metafile for an Encrypt object in an ‘encryptor’ state.

Use the L_AnnSetMetafile function 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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Metafile | Defaults to a black skeleton key. It can be changed using the L_AnnSetMetafile function.
Secondary Metafile | Defaults to a red skeleton key. It can be changed using the L_AnnSetMetafile function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

L_AnnGetEncryptOptions

L_AnnSetEncryptOptions

L_AnnEncryptApply

L_ScrambleBitmap

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 (ANNOBJECT_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. Clicking on the button sends a WM_LTANNEVENT message that indicates an activation event.

You can change the points of a Freehand Hot Spot object using the L_AnnGetPoints and L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Metafile | Defaults to a campfire graphic. It can be changed using the L_AnnSetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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.

You can change the points using L_AnnGetPoints and L_AnnSetPoints.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Background color | Defaults to Yellow – RGB (255, 255, 0). It can be changed using the L_AnnSetBackColor function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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 sends a WM_LTANNEVENT message that indicates an activation 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:

Active state | Defaults to disabled. It can be changed using the L_AnnSetActiveState function.
Visible | Defaults to FALSE. It can be changed using the L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Metafile | Defaults to a campfire graphic. It can be changed using the L_AnnSetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to yellow - RGB(255, 555, 0). It can be changed using the L_AnnSetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Text Alignment. | Defaults to left alignment. It can be changed using the L_AnnSetTextAlign function.
Text Rotate | Defaults to no rotation. It can be changed using the L_AnnSetTextRotate function.
Text Pointer | The pointer part of the text pointer does not move when the object moves. It can be changed using the L_AnnSetTextPointerFixed function.
Expand Tokens | Defaults to expand tokens. It can be changed using the L_AnnSetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

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 (ANNOBJECT_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 L_AnnSetPoints. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Transparent option | Defaults To Use Transparent Color. It can be changed using the L_AnnSetTransparent function.
Transparent Color | Defaults to White. It can be changed using the L_AnnSetTransparentColor function.
Bitmap | Defaults to Empty. It can be changed using the L_AnnSetBitmap function.
Point | Defaults to a bitmap of a cross inside a circle. It can be changed using the L_AnnSetPredefinedBitmap function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Pointer Annotation Object

Note:

This topic is for Document/Medical only.

The Pointer annotation object (ANNOBJECT_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.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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.

You can change the points using the L_AnnGetPoints and the L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the L_AnnSetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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.

You can change the points using the L_AnnGetPoints and the L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the L_AnnSetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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.

You can change the points using the L_AnnGetPoints and the L_AnnSetPoints functions.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Ruler show flags | Defaults to ANNSHOW_LENGTH + ANNSHOW_TICMARKS, 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 L_AnnSetShowFlags function, the L_AnnSetGaugeLength function, and the L_AnnSetUnit function.
Gauge length | Defaults to 30. It can be changed using the L_AnnSetGaugeLength function.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the L_AnnSetUnit function.
Unit abbreviation | Varies depending on the length shown. It can be changed using the L_AnnSetUnit function.
Precision | Defaults to 2. It can be changed using the L_AnnSetUnit function.
Tic Marks | Defaults to Show Tic Marks. It can be changed using the L_AnnSetUnit function.
Tic Mark Length | Defaults to 30. Can be changed using the L_AnnSetTicMarkLength function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects

New Annotation Features of Version 14.5


Protractor Annotation Object

Note:

This topic is for Document/Medical only.

The protractor annotation object (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Ruler show flags | Defaults to ANNSHOW_LENGTH + ANNSHOW_TICMARKS, 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 L_AnnSetShowFlags function, the L_AnnSetGaugeLength function, and the L_AnnSetUnit function.
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 L_AnnSetProtractorOptions function. To retrieve the current values, use the L_AnnGetProtractorOptions function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects

New Annotation Features of Version 14.5


PushPin Annotation Object

Note:

This topic is for Document/Medical only.

The PushPin annotation object (ANNOBJECT_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 displays the hidden note.

A PushPin object has a primary bitmap, (manipulated using the L_AnnSetBitmap and the L_AnnGetBitmap functions) when the text is shown, and a secondary bitmap, changed using the L_AnnSetSecondaryBitmap function. 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 (manipulated using the L_AnnSetActiveState and the L_AnnGetActiveState functions). 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.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to yellow. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Bitmap | Defaults to NULL. It can be changed using the L_AnnSetBitmap function.
SecondaryBitmap | Defaults to a PushPin bitmap. It can be changed using the L_AnnSetSecondaryBitmap function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Rectangle Annotation Object

Note:

This topic is for Document/Medical only.

The rectangle annotation object (ANNOBJECT_RECT) is a simple rectangle. With the automated functions, the user clicks and drags to specify the rectangle in the current window.

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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. The default does not affect highlight, redaction, or note objects.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

For information on flipping, reversing or rotating annotation objects, refer to Flipping, Reversing and Rotating Annotation Objects.

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 (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Background color | Defaults to Black. It can be changed using the L_AnnSetBackColor function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

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 L_AnnSetTool function. The Rubber Stamp tools use the L_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 (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Ruler show flags | Defaults to ANNSHOW_LENGTH + ANNSHOW_TICMARKS., 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 L_AnnSetShowFlags function, the L_AnnSetGaugeLength function, and the L_AnnSetUnit function.
Gauge length | Defaults to 30. It can be changed using the L_AnnSetGaugeLength function.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the L_AnnSetUnit function.
Unit abbreviation | Varies depending on the length shown. It can be changed using the L_AnnSetUnit function.
Precision | Defaults to 2. It can be changed using the L_AnnSetUnit function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects

New Annotation Features of Version 14.5


Stamp Annotation Object

Note:

This topic is for Document/Medical only.

The stamp annotation object (ANNOBJECT_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 ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the L_AnnSetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the L_AnnSetTransparent function.
Transparent Color | Defaults to White. It can be changed using the L_AnnSetTransparentColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using L_AnnSetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the L_AnnSetTextExpandTokens function.
Bitmap | Defaults to Empty. It can be changed using the L_AnnSetBitmap function.
Metafile | Defaults to Empty. It can be changed using the L_AnnSetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Text Annotation Object

Note:

This topic is for Document/Medical only.

The text annotation object (ANNOBJECT_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 L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using L_AnnSetTextOptions.
Text Alignment. | Defaults to left alignment. It can be changed using the L_AnnSetTextAlign function.
Expand Tokens | Defaults to expand tokens. It can be changed using the L_AnnSetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Text Pointer Annotation Object

Note: This topic is for Document/Medical only.

The Text Pointer annotation object (ANNOBJECT_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 L_AnnSetPoints for more details. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the L_AnnSetVisible function.
Selected | Defaults to FALSE. It can be changed using the L_AnnSetSelected function.
Name | Defaults to an empty string. It can be changed using the L_AnnSetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the L_AnnSetLineWidth function. (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 L_AnnSetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the L_AnnSetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the L_AnnSetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the L_AnnSetOptions function.
Foreground color | Defaults to red. It can be changed using the L_AnnSetForeColor function.
Background color | Defaults to white. It can be changed using the L_AnnSetBackColor function. 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 L_AnnSetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the L_AnnSetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the L_AnnSetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the L_AnnSetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the L_AnnSetFontBold function.
Font name | Defaults to "Arial". It can be changed using the L_AnnSetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the L_AnnSetText function.
Text Displayed* | Defaults to Show text. It can be changed using L_AnnSetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using L_AnnSetTextOptions.
Text Alignment | Defaults to left alignment. It can be changed using the L_AnnSetTextAlign function.
Text Rotate | Defaults to no rotation. It can be changed using the L_AnnSetTextRotate function.
Text Pointer | The pointer part of the text pointer does not move when the object moves. It can be changed using the L_AnnSetTextPointerFixed function.
Expand Tokens | Defaults to expand tokens. It can be changed using the L_AnnSetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.
Hyperlink | Defaults to None. It can be changed using the L_AnnSetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the L_AnnSetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the L_AnnSetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the L_AnnSetUserMode function.
Fixed State | Defaults to not fixed. It can be changed using the L_AnnSetFixed function.

* Note that in version 14.5, these features must be enabled using the L_AnnSetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Annotation Bitmap Objects


Video Annotation Object

Note:

This topic is for Document/Medical only.

The video annotation object (ANNOBJECT_VIDEO) is a rectangle containing a scaled image that can be activated to play an AVI file or capture a multimedia 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 preferred options. In run mode, clicking on the icon plays the AVI file.

For playing the video, you must have DirectX installed.

To capture an AVI file from a video card, LTCAP14n.dll is required.

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 L_AnnSetVisible.
Selected | Defaults to FALSE. It can be changed using L_AnnSetSelected.
Name | Defaults to show the name, with the name as the empty string. It can be changed using L_AnnSetNameOptions.
Foreground color | Defaults to black. It can be changed using L_AnnSetForeColor.
Background color | Defaults to white. It can be changed using L_AnnSetBackColor.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using L_AnnSetFontSize.
Font underline | Defaults to FALSE. It can be changed using L_AnnSetFontUnderline.
Font strikethrough | Defaults to FALSE. It can be changed using L_AnnSetFontStrikethrough.
Font italic | Defaults to FALSE. It can be changed using L_AnnSetFontItalic.
Font bold | Defaults to FALSE. It can be changed using L_AnnSetFontBold.
Font name | Defaults to "Arial". It can be changed using L_AnnSetFontName.
Fill mode | Defaults to transparent. It can be changed using L_AnnSetFillMode.
File | Defaults to the empty string. This can be changed using L_AnnSetText.
Tag (identifier) | Defaults to 0. It can be changed using L_AnnSetTag.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using L_AnnSetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using L_AnnSetUserMode.
Fixed State | Defaults to not fixed. It can be changed using L_AnnSetFixed.
Name | Defaults to empty string. It can be changed using L_AnnSetNameOptions.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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.


Capture Dialog Box for Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select Capture on the Video properties menu of a video annotation object.


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.


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.


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.


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 L_AnnSetOptions function, 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 L_AnnGetFillModeExt and L_AnnSetFillModeExt.


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 L_AnnSetOptions function, 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 L_AnnGetFillModeExt and L_AnnSetFillModeExt.

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.

Alternate

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.


Point Properties Dialog Box For Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode under the following condtions:

Right-click on an image with no objects selected, and select Point in the Default Properties menu.

Right-click on a point object and select Point in the Point Properties menu.


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


Video File Dialog Box for Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you select File on the Video properties menu of a video annotation object.


Annotation Automation Audio Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_AUDIOFILE_CAPTION | "Audio File"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
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"


Annotation Automation Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_DIALOG_FONT | "MS Sans Serif"


Annotation Automation Encrypt Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

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 Fill Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_FILL_CAPTION | "Fill"
ANNAUTOTEXT_FILL_MODE | "&Mode"
ANNAUTOTEXT_FILL_PATTERNS | "&Patterns"
ANNAUTOTEXT_FILL_POLYGON | "Pol&ygon"
ANNAUTOTEXT_FILL_OK | "OK"
ANNAUTOTEXT_FILL_CANCEL | "Cancel"
ANNAUTOTEXT_FILL_APPLY | "Apply"
ANNAUTOTEXT_FILL_TRANSPARENT | "Transparent"
ANNAUTOTEXT_FILL_TRANSLUCENT | "Translucent"
ANNAUTOTEXT_FILL_OPAQUE | "Opaque"
ANNAUTOTEXT_FILL_SOLID | "Solid"
ANNAUTOTEXT_FILL_BACKWARDDIAGONAL | "Backward Diagonal"
ANNAUTOTEXT_FILL_CROSS | "Cross"
ANNAUTOTEXT_FILL_DIAGONALCROSS | "Diagonal Cross"
ANNAUTOTEXT_FILL_FORWARDDIAGONAL | "Forward Diagonal"
ANNAUTOTEXT_FILL_HORIZONTAL | "Horizontal"
ANNAUTOTEXT_FILL_VERTICAL | "Vertical"
ANNAUTOTEXT_FILL_WINDING | "Winding"
ANNAUTOTEXT_FILL_ALTERNATE | "Alternate"


Annotation Automation Fixed Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

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 Line Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_LINE_CAPTION | "Line"
ANNAUTOTEXT_LINE_WIDTH | "&Width (points)"
ANNAUTOTEXT_LINE_STYLE | "&Style"
ANNAUTOTEXT_LINE_OK | "OK"
ANNAUTOTEXT_LINE_CANCEL | "Cancel"
ANNAUTOTEXT_LINE_APPLY | "Apply"
ANNAUTOTEXT_LINE_SOLID | "Solid"
ANNAUTOTEXT_LINE_DASH | "Dash"
ANNAUTOTEXT_LINE_DOT | "Dot"
ANNAUTOTEXT_LINE_DASHDOT | "Dash-Dot"
ANNAUTOTEXT_LINE_DASHDOTDOT | "Dash-Dot-Dot"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_LOCK_CAPTION | "Password"
ANNAUTOTEXT_LOCK_TEXT | "&Password"
ANNAUTOTEXT_LOCK_OK | "OK"
ANNAUTOTEXT_LOCK_CANCEL | "Cancel"
ANNAUTOTEXT_UNLOCK_CAPTION | "Password"
ANNAUTOTEXT_UNLOCK_TEXT | "&Password"
ANNAUTOTEXT_UNLOCK_OK | "OK"
ANNAUTOTEXT_UNLOCK_CANCEL | "Cancel"


Annotation Automation Menu Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_MENU_UNDO | "&Undo"
ANNAUTOTEXT_MENU_CUT | "Cu&t"
ANNAUTOTEXT_MENU_COPY | "&Copy"
ANNAUTOTEXT_MENU_PASTE | "&Paste"
ANNAUTOTEXT_MENU_DELETE | "&Delete"
ANNAUTOTEXT_MENU_SELECTALL | "Select &All"
ANNAUTOTEXT_MENU_BRINGTOFRONT | "Bring to &Front"
ANNAUTOTEXT_MENU_SENDTOBACK | "Send to &Back"
ANNAUTOTEXT_MENU_DEFAULTPROPERTIES | "Default Pr&operties"
ANNAUTOTEXT_MENU_SELECTEDPROPERTIES | "Selected Pr&operties"
ANNAUTOTEXT_MENU_CONTAINERPROPERTIES | "Container Pr&operties"
ANNAUTOTEXT_MENU_POINTERPROPERTIES | "Pointer Pr&operties"
ANNAUTOTEXT_MENU_AUDIOPROPERTIES | "Audio Pr&operties"
ANNAUTOTEXT_MENU_BUTTONPROPERTIES | "Button Pr&operties"
ANNAUTOTEXT_MENU_ELLIPSEPROPERTIES | "Ellipse Pr&operties"
ANNAUTOTEXT_MENU_FREEHANDPROPERTIES | "Freehand Pr&operties"
ANNAUTOTEXT_MENU_HILITEPROPERTIES | "Hilite Pr&operties"
ANNAUTOTEXT_MENU_HOTSPOTPROPERTIES | "Hotspot Pr&operties"
ANNAUTOTEXT_MENU_LINEPROPERTIES | "Line Pr&operties"
ANNAUTOTEXT_MENU_NOTEPROPERTIES | "Note Pr&operties"
ANNAUTOTEXT_MENU_POLYGONPROPERTIES | "Polygon Pr&operties"
ANNAUTOTEXT_MENU_POLYLINEPROPERTIES | "Polyline Pr&operties"
ANNAUTOTEXT_MENU_RECTANGLEPROPERTIES | "Rectangle Pr&operties"
ANNAUTOTEXT_MENU_REDACTPROPERTIES | "Redact Pr&operties"
ANNAUTOTEXT_MENU_STAMPPROPERTIES | "Stamp Pr&operties"
ANNAUTOTEXT_MENU_TEXTPROPERTIES | "Text Pr&operties"
ANNAUTOTEXT_MENU_AUTOMATIONPROPERTIES | "Automation Pr&operties"
ANNAUTOTEXT_MENU_RULERPROPERTIES | "Ruler Pr&operties"
ANNAUTOTEXT_MENU_CROSSPRODUCTPROPERTIES | "Cross-Product Pr&operties"
ANNAUTOTEXT_MENU_POINTPROPERTIES | "Point Pr&operties"
ANNAUTOTEXT_MENU_PROTRACTORPROPERTIES | "Protractor Pr&operties"
ANNAUTOTEXT_MENU_VIDEOPROPERTIES | "Video Pr&operties"
ANNAUTOTEXT_MENU_PUSHPINPROPERTIES | "PushPin Pr&operties"
ANNAUTOTEXT_MENU_FREEHANDHOSPOTPROPERTIES | "Freehand Hotspot Pr&operties"
ANNAUTOTEXT_MENU_CURVEPROPERTIES | "Curve Pr&operties"
ANNAUTOTEXT_MENU_CURVECLOSEDPROPERTIES | "Closed Curve Pr&operties"
ANNAUTOTEXT_MENU_ENCRYPTPROPERTIES | "Encrypt Pr&operties"
ANNAUTOTEXT_MENU_TEXTPOINTERPROPERTIES | "Text Pointer Pr&operties"
ANNAUTOTEXT_MENU_POLYRULERPROPERTIES | "Polyruler Pr&operties"
ANNAUTOTEXT_MENU_RTFPROPERTIES | "Rich Text Pr&operties"
ANNAUTOTEXT_MENU_LINE | "&Line..."
ANNAUTOTEXT_MENU_FILL | "&Fill..."
ANNAUTOTEXT_MENU_FOREGROUNDCOLOR | "F&oreground Color..."
ANNAUTOTEXT_MENU_BACKGROUNDCOLOR | "&Background Color..."
ANNAUTOTEXT_MENU_FONT | "Fo&nt..."
ANNAUTOTEXT_MENU_BITMAP | "&Bitmap..."
ANNAUTOTEXT_MENU_TEXT | "&Text..."
ANNAUTOTEXT_MENU_FILE | "F&ile..."
ANNAUTOTEXT_MENU_ROP2 | "ROP&2..."
ANNAUTOTEXT_MENU_TRANSPARENT | "Tr&ansparent"
ANNAUTOTEXT_MENU_LOCK | "&Lock..."
ANNAUTOTEXT_MENU_UNLOCK | "&Unlock..."
ANNAUTOTEXT_MENU_LOCKALL | "&Lock All..."
ANNAUTOTEXT_MENU_UNLOCKALL | "&Unlock All..."
ANNAUTOTEXT_MENU_HYPERLINK | "&Hyperlink..."
ANNAUTOTEXT_MENU_NOTEBACKGROUNDCOLOR | "No&te Background Color..."
ANNAUTOTEXT_MENU_REDACTBACKGROUNDCOLOR | "&Redact Background Color..."
ANNAUTOTEXT_MENU_HILITEBACKGROUNDCOLOR | "&Hilite Background Color..."
ANNAUTOTEXT_MENU_HOTSPOTMETAFILE | "&Hotspot Metafile...
ANNAUTOTEXT_MENU_ENCRYPTMETAFILE | "Encrypt Metafile..."
ANNAUTOTEXT_MENU_DECRYPTMETAFILE | "Decrypt Metafile..."
ANNAUTOTEXT_MENU_RULER | "&Ruler... "
ANNAUTOTEXT_MENU_RULERPROPERTIES | "Ruler Pr&operties"
ANNAUTOTEXT_MENU_BUTTONFONT | "B&utton Font"
ANNAUTOTEXT_MENU_GROUP | "&Group"
ANNAUTOTEXT_MENU_UNGROUP | "U&ngroup"
ANNAUTOTEXT_MENU_NODES | "No&des..."
ANNAUTOTEXT_MENU_PROTRACTOR | "&Protractor …"
ANNAUTOTEXT_MENU_NAME | "Name…"
ANNAUTOTEXT_MENU_ENCRYPT | "Encrypt..."
ANNAUTOTEXT_MENU_POINT | "Point..."
ANNAUTOTEXT_MENU_METAFILE | "&Metafile..."
ANNAUTOTEXT_MENU_SECONDARYMETAFILE | "S&econdary Metafile..."
ANNAUTOTEXT_MENU_SECONDARYFILE | "&Secondary Bitmap..."
ANNAUTOTEXT_MENU_TRANSPARENTCOLOR | "&Transparent Color..."
ANNAUTOTEXT_MENU_DELETENODE | "D&elete node"
ANNAUTOTEXT_MENU_ADDNODE | "Add &node"
ANNAUTOTEXT_MENU_CAPTURE | "Capture..."
ANNAUTOTEXT_MENU_FIXED | "Fi&xed..."
ANNAUTOTEXT_MENU_STAMP_APPROVED | "Approved"
ANNAUTOTEXT_MENU_STAMP_ASSIGNED | "Assigned"
ANNAUTOTEXT_MENU_STAMP_CHECKED | "Checked"
ANNAUTOTEXT_MENU_STAMP_CLATPRV | "Client Attorney Privilege"
ANNAUTOTEXT_MENU_STAMP_COPY | "Copy"
ANNAUTOTEXT_MENU_STAMP_DRAFT | "Draft"
ANNAUTOTEXT_MENU_STAMP_EXTENDED | "Extended"
ANNAUTOTEXT_MENU_STAMP_FAX | "Fax"
ANNAUTOTEXT_MENU_STAMP_FAXED | "Faxed"
ANNAUTOTEXT_MENU_STAMP_IMPORTANT | "Important"
ANNAUTOTEXT_MENU_STAMP_INVOICE | "Invoice"
ANNAUTOTEXT_MENU_STAMP_NOTICE | "Notice"
ANNAUTOTEXT_MENU_STAMP_OFFICIAL | "Official"
ANNAUTOTEXT_MENU_STAMP_ONFILE | "On File"
ANNAUTOTEXT_MENU_STAMP_PAID | "Paid"
ANNAUTOTEXT_MENU_STAMP_PASSED | "Passed"
ANNAUTOTEXT_MENU_STAMP_PENDING | "Pending"
ANNAUTOTEXT_MENU_STAMP_PROCESSED | "Processed"
ANNAUTOTEXT_MENU_STAMP_RECEIVED | "Received"
ANNAUTOTEXT_MENU_STAMP_REJECTED | "Rejected"
ANNAUTOTEXT_MENU_STAMP_RELEASE | "Release"
ANNAUTOTEXT_MENU_STAMP_SENT | "Sent"
ANNAUTOTEXT_MENU_STAMP_SHIPPED | "Shipped"
ANNAUTOTEXT_MENU_STAMP_TOPSECRET | "Top Secret"
ANNAUTOTEXT_MENU_STAMP_URGENT | "Urgent"
ANNAUTOTEXT_MENU_STAMP_VOID | "Void"


Annotation Automation Miscellaneous Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_ITEM_DEFAULTTEXT | "AaBbYyZz"
ANNAUTOTEXT_ITEM_DEFAULTNAME | ""


Annotation Automation Name Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_NAME_CAPTION | "Name"
ANNAUTOTEXT_NAME_SHOW | "&Show Name"
ANNAUTOTEXT_NAME_OFFSET | "Name &Offset"
ANNAUTOTEXT_NAME_OFFSET_X | "X"
ANNAUTOTEXT_NAME_OFFSET_Y | "Y"
ANNAUTOTEXT_NAME_RESTRICT | "Name &Restrict"
ANNAUTOTEXT_NAME_OK | "OK"
ANNAUTOTEXT_NAME_CANCEL | "Cancel"
ANNAUTOTEXT_NAME_APPLY | "Apply"


Annotation Automation Nodes Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_NODES_CAPTION | "Nodes"
ANNAUTOTEXT_NODES_DISPLAYNODES | "&Display Nodes"
ANNAUTOTEXT_NODES_GAP | "&Gap between nodes:"
ANNAUTOTEXT_NODES_OK | "OK"
ANNAUTOTEXT_NODES_CANCEL | "Cancel"
ANNAUTOTEXT_NODES_APPLY | "Apply"


Annotation Automation Play Video Dialog Strings

For playing the video, you must have DirectX installed.

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_PLAYVIDEO_CAPTION | "Play video"
ANNAUTOTEXT_PLAYVIDEO_BALANCE | "Balance"
ANNAUTOTEXT_PLAYVIDEO_VOLUME | "Volume"
ANNAUTOTEXT_PLAYVIDEO_SPEED | "Speed"
ANNAUTOTEXT_PLAYVIDEO_TIP_PLAY | "Play"
ANNAUTOTEXT_PLAYVIDEO_TIP_PAUSE | "Pause"
ANNAUTOTEXT_PLAYVIDEO_TIP_STOP | "Stop"
ANNAUTOTEXT_PLAYVIDEO_TIP_REWIND | "Rewind"
ANNAUTOTEXT_PLAYVIDEO_TIP_FORWARD | "Forward"
ANNAUTOTEXT_PLAYVIDEO_TIP_PREVMARK | "Go to start of selection"
ANNAUTOTEXT_PLAYVIDEO_TIP_NEXTMARK | "Go to end of selection"
ANNAUTOTEXT_PLAYVIDEO_TIP_NEXTFRAME | "Next Frame"
ANNAUTOTEXT_PLAYVIDEO_TIP_PREVFRAME | "Previous Frame"
ANNAUTOTEXT_PLAYVIDEO_TIP_STARTSEL | "Set start of selection"
ANNAUTOTEXT_PLAYVIDEO_TIP_ENDSEL | "Set end of selection"


Annotation Automation Point Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_POINTFILE_CAPTION | "Point File"
ANNAUTOTEXT_POINTFILE_FILTER | "All Files (*.*)|*.*|"
ANNAUTOTEXT_POINT_CAPTION | "Point"
ANNAUTOTEXT_POINT_USE_BITMAP | "&Use Bitmap"
ANNAUTOTEXT_POINT_NO_BITMAP | "&No Bitmap"
ANNAUTOTEXT_POINT_BITMAP | "&Bitmap..."
ANNAUTOTEXT_POINT_TRANSPARENT_COLOR | "&Transparent Color"
ANNAUTOTEXT_POINT_RADIUS | "&Radius"
ANNAUTOTEXT_POINT_BORDER_COLOR | "Bor&der Color"
ANNAUTOTEXT_POINT_FILL_COLOR | "&Fill Color"
ANNAUTOTEXT_POINT_TRANSPARENT | "Trans&parent"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_PROTRACTOR_CAPTION | "Protractor"
ANNAUTOTEXT_PROTRACTOR_ACUTE | "&Acute"
ANNAUTOTEXT_PROTRACTOR_UNITS | "&Measurement Units"
ANNAUTOTEXT_PROTRACTOR_ABBREV | "&Unit Abbreviation"
ANNAUTOTEXT_PROTRACTOR_PRECISION | "&Precision"
ANNAUTOTEXT_PROTRACTOR_ARCRADIUS | "Arc &radius"
ANNAUTOTEXT_PROTRACTOR_OK | "OK"
ANNAUTOTEXT_PROTRACTOR_CANCEL | "Cancel"
ANNAUTOTEXT_PROTRACTOR_APPLY | "Apply"
ANNAUTOTEXT_PROTRACTOR_DEGREES | "Degrees"
ANNAUTOTEXT_PROTRACTOR_RADIANS | "Radians"
ANNAUTOTEXT_NAME_CAPTION | "Name"
ANNAUTOTEXT_NAME_SHOW | "&Show Name"
ANNAUTOTEXT_NAME_LOCATION | "&Location"
ANNAUTOTEXT_NAME_OFFSET | "&Name Offset"
ANNAUTOTEXT_NAME_OFFSET_X | "&X"
ANNAUTOTEXT_NAME_OFFSET_Y | "&Y"
ANNAUTOTEXT_NAME_RESTRICT | "Name &Restrict"
ANNAUTOTEXT_NAME_FONT | "Fo&nt"
ANNAUTOTEXT_NAME_SAMPLE | "&Sample"
ANNAUTOTEXT_NAME_SAMPLE_TEXT | "AaBbZz"
ANNAUTOTEXT_NAME_COLORS | "&Colors"
ANNAUTOTEXT_NAME_FOREGROUNDCOLOR | "&Foreground Color"
ANNAUTOTEXT_NAME_BACKGROUNDCOLOR | "&Background Color"
ANNAUTOTEXT_NAME_TRANSPARENT | "&Transparent"
ANNAUTOTEXT_NAME_OK | "OK"
ANNAUTOTEXT_NAME_CANCEL | "Cancel"
ANNAUTOTEXT_NAME_APPLY | "Apply"


Annotation Automation Pushpin Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_PUSHPINFILE_CAPTION | "Pushpin File"
ANNAUTOTEXT_PUSHPINFILE_FILTER | "All Files (*.*)|*.*|"
ANNAUTOTEXT_PUSHPINSECONDARYFILE_CAPTION | "Pushpin Secondary File"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_ROP2_CAPTION | "ROP2"
ANNAUTOTEXT_ROP2_TEXT | "ROP2"
ANNAUTOTEXT_ROP2_OK | "OK"
ANNAUTOTEXT_ROP2_CANCEL | "Cancel"
ANNAUTOTEXT_ROP2_APPLY | "Apply"
ANNAUTOTEXT_ROP2_COPY | "Copy (normal)"
ANNAUTOTEXT_ROP2_AND | "And (highlight)"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_RULER_CAPTION | "Ruler"
ANNAUTOTEXT_RULER_UNITS | "&Measurement units"
ANNAUTOTEXT_RULER_ABBREV | "&Unit abbreviation"
ANNAUTOTEXT_RULER_PRECISION | "Precision"
ANNAUTOTEXT_RULER_LENGTH | "&Gauge length"
ANNAUTOTEXT_RULER_OK | "OK"
ANNAUTOTEXT_RULER_CANCEL, | "Cancel"
ANNAUTOTEXT_RULER_APPLY | "Apply"
ANNAUTOTEXT_RULER_INCHES | "inches"
ANNAUTOTEXT_RULER_FEET | "feet"
ANNAUTOTEXT_RULER_YARDS | "yards"
ANNAUTOTEXT_RULER_MICROMETERS | "micrometers"
ANNAUTOTEXT_RULER_MILLIMETERS | "millimeters"
ANNAUTOTEXT_RULER_CENTIMETERS | "centimeters"
ANNAUTOTEXT_RULER_METERS | "meters"
ANNAUTOTEXT_RULER_TWIPS | "twips"
ANNAUTOTEXT_RULER_POINTS | "points"
ANNAUTOTEXT_RULER_PIXELS | "pixels"
ANNAUTOTEXT_RULER_SMART_METRIC | "smart metric"
ANNAUTOTEXT_RULER_SMART_ENGLISH | "smart english"
ANNAUTOTEXT_RULER_SHOWLENGTH | "&Show Length"
ANNAUTOTEXT_RULER_SHOWGAUGE | "S&how Gauge"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_STAMPFILE_CAPTION | "Stamp File"
ANNAUTOTEXT_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 L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_STAMPMETAFILE_CAPTION | "Stamp Metafile"
ANNAUTOTEXT_STAMPMETAFILE_FILTER | "All metafiles (*.wmf;*.emf)|*.wmf;*.emf|WMF files (*.wmf)|*.wmf|EMF files (*.emf)|*.emf|All Files (*.*)|*.*|"


Annotation Automation Text Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_TEXT_IMPORT | "From &Text File..."
ANNAUTOTEXT_TEXT_CAPTION | "Text"
ANNAUTOTEXT_TEXT_FILE_CAPTION | "Import Text From File"
ANNAUTOTEXT_TEXT_FILE_FILTER | "Text files (*.txt|*.txt|All Files (*.*)|*.*|")
ANNAUTOTEXT_TEXT_INSERT_TOKEN | "&Insert Token >>"
ANNAUTOTEXT_TEXT_ALIGN | "&Alignment"
ANNAUTOTEXT_TEXT_ALIGN_LEFT | "&Left"
ANNAUTOTEXT_TEXT_ALIGN_CENTER | "&Center"
ANNAUTOTEXT_TEXT_ALIGN_RIGHT | "&Right"
ANNAUTOTEXT_TEXT_ROTATION | "R&otation (degrees")
ANNAUTOTEXT_TEXT_ROTATE_0 | "&None"
ANNAUTOTEXT_TEXT_ROTATE_90 | "&90 (Counter-clockwise")
ANNAUTOTEXT_TEXT_ROTATE_180 | "&180"
ANNAUTOTEXT_TEXT_ROTATE_270 | "&270 (Counter-clockwise")
ANNAUTOTEXT_TEXT_FIXED_POINTER | "&Fixed Pointer"
ANNAUTOTEXT_TEXT_EXPAND_TOKENS | "&Expand Tokens"
ANNAUTOTEXT_TEXT_OK | "OK"
ANNAUTOTEXT_TEXT_CANCEL | "Cancel"
ANNAUTOTEXT_TEXT_APPLY | "Apply"


Annotation Automation ToolTip Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
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"


Annotation Automation Transparent Color Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_TRANSPARENTCOLOR_CAPTION | "Pick transparent color"
ANNAUTOTEXT_TRANSPARENTCOLOR_COLORARRAYFRAME | "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"


Annotation Automation Video Dialog Strings

The following are constants and their default values. You can get the current value using the L_AnnGetAutoTextLen and L_AnnGetAutoText functions. You can modify the string using the L_AnnSetAutoText function.

Constant | Default String
ANNAUTOTEXT_VIDEOFILE_CAPTION | "Video File"
ANNAUTOTEXT_VIDEOFILE_FILTER | "AVI Files (*.avi)|*.avi|Wave Files (*.wav)|*.wav|All Files (*.*)|*.*|"


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.

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.

Please note that LTKRN is required for ALL API applications.

Note: All Unicode versions of LEADTOOLS require Microsoft Unicode Layer for Windows (UNICOWS.DLL) in order to function on Windows 95/98/Me/CE. 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:
LTANN | Annotation support. (Document/Medical only) The header file is LTANN.H. All functions with the L_Ann prefix are in this DLL. Also requires LTDIS, LTFIL, and LTEFX for WIN32. | DLL: LTANN14N.DLL Library: LTANN_N.LIB. | DLL: LTANN14NU.DLL Library: LTANN_NU.LIB. | DLL: LTANN14E.DLL Library: LTANN_E.LIB. | DLL: LTANN14EU.DLL Library: LTANN_EU.LIB.
LTCLR | LEADTOOLS Color Conversion. The Header File is LTCLR.H. This DLL is also required for loading JPEG CMYK images and for loading and saving JPEG LAB images. | DLL: LTCLR14N.DLL Library: LTCLR_N.LIB | DLL: LTCLR14NU.DLL Library: LTCLR_NU.LIB | DLL: LTCLR14E.DLL Library: LTCLR_E.LIB | DLL: LTCLR14EU.DLL Library: LTCLR_EU.LIB
LTDIC | (Medical Imaging editions only) DICOM file support. Note: LFDIC14N.DLL is no longer shipped. All 32-bit Dicom support is provided in the LTDIC DLL. | DLL: LTDIC14N.DLL Library: LTDIC_N.LIB | Unicode is not supported. | DLL: LTDIC14E.DLL Library: LTDIC_E.LIB | Unicode is not supported.
LTDIS | Display support, required for most applications. The header file is LTDIS.H. | DLL: LTDIS14N.DLL Library: LTDIS_N.LIB | DLL: LTDIS14NU.DLL Library: LTDIS_NU.LIB | DLL: LTDIS14E.DLL Library: LTDIS_E.LIB | DLL: LTDIS14EU.DLL Library: LTDIS_EU.LIB
LTEFX | Paint effects support. The header file is LTEFX.H. | DLL: LTEFX14N.DLL Library: LTEFX_N.LIB | DLL: LTEFX14NU.DLL Library: LTEFX_NU.LIB | DLL: LTEFX14E.DLL Library: LTEFX_E.LIB | DLL: LTEFX14EU.DLL Library: LTEFX_EU.LIB
LTFIL | File read and write support. The header file is LTFIL.H. | DLL: LTFIL14N.DLL Library: LTFIL_N.LIB | DLL: LTFIL14NU.DLL Library: LTFIL_NU.LIB | DLL: LTFIL14E.DLL Library: LTFIL_E.LIB | DLL: LTFIL14EU.DLL Library: LTFIL_EU.LIB
LTIMG | Image processing support. The header file is LTIMG.H. Also requires LTEFX, LTDIS and LTFIL for WIN32. | DLL: LTIMG14N.DLL Library: LTIMG_N.LIB | DLL: LTIMG14NU.DLL Library: LTIMG_NU.LIB | DLL: LTIMG14E.DLL Library: LTIMG_E.LIB | DLL: LTIMG14EU.DLL Library: LTIMG_EU.LIB
LTISI | ISIS support. (Document/Medical only) The header file is LTISI.H. The library file is LTISI_N.LIB. 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. | DLL: LTISI14N.DLL Library: LTISI_N.LIB | Unicode is not supported. | DLL: LTISI14E.DLL Library: LTISI_E.LIB | Unicode is not supported.
LTKRN | LEADTOOLS kernel, required for all applications. The header file is LTKRN.H. This DLL is required for all applications. For information about the "nag" message and the "no-nag" LTKRN DLL, refer to LEADTOOLS Nag Message. | DLL: LTKRN14N.DLL Library: LTKRN_N.LIB | DLL: LTKRN14NU.DLL Library: LTKRN_NU.LIB | DLL: LTKRN14E.DLL Library: LTKRN_E.LIB | DLL: LTKRN14EU.DLL Library: LTKRN_EU.LIB
LTLST | ImageList Control. Also requires LTKRN and LTDIS. | DLL: LTLST14N.DLL Library: LTLST_N.LIB | DLL: LTLST14NU.DLL Library: LTLST_NU.LIB | DLL: LTLST14E.DLL Library: LTLST_E.LIB | DLL: LTLST14EU.DLL Library: LTLST_EU.LIB
LTNET | Internet support. LTNET is the LEADTOOLS Internet Support DLL. Also requires LTKRN, LTFIL and the LEAD file format DLLs. Additional required files are installed by ws2setup.exe (Winsock 2.0). | DLL: LTNET14N.DLL Library: LTNET_N.LIB | DLL: LTNET14NU.DLL Library: LTNET_NU.LIB | DLL: LTNET14E.DLL Library: LTNET_E.LIB | DLL: LTNET14EU.DLL Library: LTNET_EU.LIB
LTSCR | Screen Capture. The header file is LTSCR.H. | DLL: LTSCR14N.DLL Library: LTSCR_N.LIB | DLL: LTSCR14NU.DLL Library: LTSCR_NU.LIB | DLL: LTSCR14E.DLL Library: LTSCR_E.LIB | DLL: LTSCR14EU.DLL Library: LTSCR_EU.LIB
LTTMB | Thumbnail Browser Control. Also requires LTKRN, LTFIL, LTDIS, and LTIMG. | DLL: LTTMB14N.DLL Library: LTTMB_N.LIB | DLL: LTTMB14NU.DLL Library: LTTMB_NU.LIB | DLL: LTTMB14E.DLL Library: LTTMB_E.LIB | DLL: LTTMB14EU.DLL Library: LTTMB_EU.LIB
LTTWN | TWAIN support. The header file is LTTWN.H. | DLL: LTTWN14N.DLL Library: LTTWN_N.LIB | DLL: LTTWN14NU.DLL Library: LTTWN_NU.LIB | DLL: LTTWN14E.DLL Library: LTTWN_E.LIB | DLL: LTTWN14EU.DLL Library: LTTWN_EU.LIB
LTWND | Windows registered class support. The header file is LTWND.H. The only function in the DLL is L_UseBitmapClass. | DLL: LTWND14N.DLL Library: LTWND_N.LIB | DLL: LTWND14NU.DLL Library: LTWND_NU.LIB | DLL: LTWND14E.DLL Library: LTWND_E.LIB | DLL: LTWND14EU.DLL Library: LTWND_EU.LIB
LTWVC LTWEN | LEADTOOLS Class Library, required for all applications. The header file is LTWRAPPR.H. LTWVC is the LEADTOOLS Class Library DLL used with Microsoft Compilers. LTWEN is the LEADTOOLS Class Library DLL used with Borland Compilers. | DLL: LTWVC14N.DLL LTWEN14N.DLL Library: LTWVC_N.LIB, LTWEN_BC.LIB | DLL: LTWVC14NU.DLL Unicode is not supported for Borland Compilers. Library: LTWVC_NU.LIB, Unicode is not supported for Borland Compilers. | DLL: LTWVC14E.DLL LTWEN14E.DLL Library: LTWVC_E.LIB, LTWEN_BE.LIB | DLL: LTWVC14EU.DLL Unicode is not supported for Borland Compilers. Library: LTWVC_EU.LIB, Unicode is not supported for Borland Compilers.
LTZMV | Zoom View support. The header file is LTZMV.H. | DLL: LTZMV14N.DLL LTDIS14N.DLL Library: LTZMV_N.LIB | DLL: LTZMV14NU.DLL LTDIS14NU.DLL Library: LTZMV_NU.LIB | DLL: LTZMV14E.DLL LTDIS14E.DLL Library: LTZMV_E.LIB | DLL: LTZMV14EU.DLL LTDIS14EU.DLL Library: LTZMV_EU.LIB
LVKRN LVDLG LVGL | LVKRN is the Vector Kernal DLL. Required for all vector functionality. LVDLG is the Vector Common Dialog DLL LVGL is the Vector DLL, required for OpenGL support. | DLL: LVKRN14N.DLL LVDLG14N.DLL LVGL14N.DLL Library: LVKRN_N.LIB LVDLG_N.LIB LVGL_N.LIB | DLL: LVKRN14NU.DLL LVDLG14NU.DLL LVGL14NU.DLL Library: LVKRN_NU.LIB LVDLG_NU.LIB LVGL_NU.LIB | DLL: LVKRN14E.DLL LVDLG14E.DLL LVGL14E.DLL Library: LVKRN_E.LIB LVDLG_E.LIB LVGL_E.LIB | DLL: LVKRN14EU.DLL LVDLG14EU.DLL LVGL14EU.DLL Library: LVKRN_EU.LIB LVDLG_EU.LIB LVGL_EU.LIB
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 | LFABC14N.DLL | LFABC14NU.DLL | LFABC14E.DLL | LFABC14EU.DLL
FILE_ABIC | ABIC Format | LFABI14N.DLL | LFABI14NU.DLL | LFABI14E.DLL | LFABI14EU.DLL
FILE_AFP | AFP File Format | LFAFP14N.DLL | LFAFP14NU.DLL | LFAFP14E.DLL | LFAFP14EU.DLL
FILE_AFPICA_IBM_MMR FILE_AFPICA_UNCOMPRESSED FILE_AFP_G3_1D FILE_AFP_G3_2D FILE_AFP_G4 | Image Object Content Architecture Format | LFICA14N.DLL | LFICA14NU.DLL | LFICA14E.DLL | LFICA14EU.DLL
FILE_ANI | Windows Animated Cursor | LFANI14N.DLL | LFANI14NU.DLL | LFANI14E.DLL | LFANI14EU.DLL
FILE_AVI | Windows AVI File Format (read only) | LFAVI14N.DLL | LFAVI14NU.DLL | LFAVI14E.DLL | LFAVI14EU.DLL
FILE_AWD | Windows FAX (AWD) Format | LFAWD14N.DLL AWVIEW32.DLL AWDENC32.DLL AWDCXC32.DLL AWCODC32.DLL AWRESX32.DLL | LFAWD14NU.DLL AWVIEW32.DLL AWDENC32.DLL AWDCXC32.DLL AWCODC32.DLL AWRESX32.DLL | LFAWD14E.DLL AWVIEW32.DLL AWDENC32.DLL AWDCXC32.DLL AWCODC32.DLL AWRESX32.DLL | LFAWD14EU.DLL AWVIEW32.DLL AWDENC32.DLL AWDCXC32.DLL AWCODC32.DLL AWRESX32.DLL
FILE_BMP FILE_BMP_RLE | Windows Bitmap Format | LFBMP14N.DLL | LFBMP14NU.DLL | LFBMP14E.DLL | LFBMP14EU.DLL
FILE_CALS FILE_CALS2 FILE_CALS3 FILE_CALS4 | CALS Raster File Format | LFCAL14N.DLL LFFAX14N.DLL | LFCAL14NU.DLL LFFAX14NU.DLL | LFCAL14E.DLL LFFAX14E.DLL | LFCAL14EU.DLL LFFAX14EU.DLL
FILE_CCITT FILE_CCITT_GROUP3_1DIM FILE_CCITT_GROUP3_2DIM FILE_CCITT_GROUP4 | TIFF Tagged Image File Format | LFTIF14N.DLL LFFAX14N.DLL | LFTIF14N.DLL LFFAX14NU.DLL | LFTIF14E.DLL LFFAX14E.DLL | LFTIF14EU.DLL LFFAX14EU.DLL
FILE_CGM | Computer Graphics Metafile | LFCGM14N.DLL LVKRN14N.DLL | LFCGM14NU.DLL LVKRN14NU.DLL | LFCGM14E.DLL LVKRN14E.DLL | LFCGM14EU.DLL LVKRN14EU.DLL
FILE_CIN | KODAK Cineon Format | LFCIN14N.DLL LVKRN14N.DLL | LFCIN14NU.DLL LVKRN14NU.DLL | LFCIN14E.DLL LVKRN14E.DLL | LFCIN14EU.DLL LVKRN14EU.DLL
FILE_CLP FILE_CLP_RLE | Windows Clipboard Format | LFCLP14N.DLL | LFCLP14NU.DLL | LFCLP14E.DLL | LFCLP14EU.DLL
FILE_CMP | LEAD CMP Format | LFCMP14N.DLL | LFCMP14NU.DLL | LFCMP14E.DLL | LFCMP14EU.DLL
FILE_CMW | LEAD Wavelet Format | LFCMW14N.DLL | LFCMW14NU.DLL | LFCMW14E.DLL | LFCMW14EU.DLL
FILE_CMX | Corel Presentation Exchange Format | LFCMX14N.DLL LVKRN14N.DLL | LFCMX14NU.DLL LVKRN14NU.DLL | LFCMX14E.DLL LVKRN14E.DLL | LFCMX14EU.DLL LVKRN14EU.DLL
FILE_CRW | Canon Raw Format | LFCRW14N.DLL LFCMP14N.DLL Canon Runtime Files Update the registry with the file "CDSDK.reg" on the target machine. | LFCRW14NU.DLL LFCMP14NU.DLL Canon Runtime Files Update the registry with the file "CDSDK.reg" on the target machine. | LFCRW14E.DLL LFCMP14E.DLL Canon Runtime Files Update the registry with the file "CDSDK.reg" on the target machine. | LFCRW14EU.DLL LFCRW14EU.DLL Canon Runtime Files Update the registry with the file "CDSDK.reg" on the target machine.
FILE_CUT | Dr. Halo Format | LFCUT14N.DLL | LFCUT14NU.DLL | LFCUT14E.DLL | LFCUT14EU.DLL
FILE_DCR | Kodak Professional Digital Camera Format | LFDCR14N.DLL DCSPROBACK.DLL DCSPRO3SLR.DLL DCSProductLook.icm sRGB Color Space.icm | LFDCR14NU.DLL DCSPROBACK.DLL DCSPRO3SLR.DLL DCSProductLook.icm sRGB Color Space.icm | LFDCR14E.DLL DCSPROBACK.DLL DCSPRO3SLR.DLL DCSProductLook.icm sRGB Color Space.icm | LFDCR14EU.DLL DCSPROBACK.DLL DCSPRO3SLR.DLL DCSProductLook.icm sRGB Color Space.icm
FILE_DCS | Kodak Professional Digital Camera Format | LFDCS14N.DLL PDC_SDK.DLL EKFPIXJPEG140.DLL ProFire.DLL | LFDCS14NU.DLL PDC_SDK.DLL EKFPIXJPEG140.DLL ProFire.DLL | LFDCS14E.DLL PDC_SDK.DLL EKFPIXJPEG140.DLL ProFire.DLL | LFDCS14EU.DLL PDC_SDK.DLL EKFPIXJPEG140.DLL ProFire.DLL
FILE_DICOM_GRAY FILE_DICOM_COLOR FILE_DICOM_RLE_GRAY FILE_DICOM_RLE_COLOR | DICOM Format | LTDIC14N.DLL | Not Supported | LTDIC14E.DLL | Not Supported
FILE_DICOM_JPEG_GRAY FILE_DICOM_JPEG_COLOR | DICOM Format | LTDIC14N.DLL LFCMP14N.DLL | Not Supported | LTDIC14E.DLL LFCMP14E.DLL | Not Supported
FILE_DICOM_J2K_GRAY FILE_DICOM_J2K_COLOR | DICOM Format | LTDIC14N.DLL LFJ2K14N.DLL | Not Supported | LTDIC14E.DLL LFJ2K14E.DLL | Not Supported
FILE_DJVU | DjVu Format | LFDJV14N.DLL | LFDJV14NU.DLL | LFDJV14E.DLL | LFDJV14EU.DLL
FILE_DRW | Micrografx Designer DRaWing | LFDRW14N.DLL LVKRN14N.DLL | LFDRW14NU.DLL LVKRN14NU.DLL | LFDRW14E.DLL LVKRN14E.DLL | LFDRW14EU.DLL LVKRN14EU.DLL
FILE_DWF FILE_DWF_TEXT_AS_POLYLINE | AutoCAD DWF Format | LFDWF14N.DLL LVKRN14N.DLL | LFDWF14NU.DLL LVKRN14NU.DLL | LFDWF14E.DLL LVKRN14E.DLL | LFDWF14EU.DLL LVKRN14EU.DLL
FILE_DWG | AutoCAD DWG Format (LFACS is required to allow DWG filters to load ACIS data embedded in this format.) | LFDWG14N.DLL LVKRN14N.DLL LFACS14N.DLL | LFDWG14NU.DLL LVKRN14NU.DLL LFACS14NU.DLL | LFDWG14E.DLL LVKRN14E.DLL LFACS14E.DLL | LFDWG14EU.DLL LVKRN14EU.DLL LFACS14EU.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.) | LFDXF14N.DLL LVKRN14N.DLL LFACS14N.DLL | LFDXF14NU.DLL LVKRN14NU.DLL LFACS14NU.DLL | LFDXF14E.DLL LVKRN14E.DLL LFACS14E.DLL | LFDXF14EU.DLL LVKRN14EU.DLL LFACS14EU.DLL
FILE_ECW | Enhanced Compressed Wavelet Format | LFECW14N.DLL NCSECW.DLL NCSECWC.DLL NCSUTIL.DLL NCSCNET.DLL | LFECW14NU.DLL NCSECW.DLL NCSECWC.DLL NCSUTIL.DLL NCSCNET.DLL | LFECW14E.DLL NCSECW.DLL NCSECWC.DLL NCSUTIL.DLL NCSCNET.DLL | LFECW14EU.DLL NCSECW.DLL NCSECWC.DLL NCSUTIL.DLL NCSCNET.DLL
FILE_EMF | Windows Enhanced Metafile | LFWMF14N.DLL LVKRN14N.DLL | LFWMF14NU.DLL LVKRN14NU.DLL | LFWMF14E.DLL LVKRN14E.DLL | LFWMF14EU.DLL LVKRN14EU.DLL
FILE_EPS | Encapsulated PostScript | LFEPS14N.DLL | LFEPS14NU.DLL | LFEPS14E.DLL | LFEPS14EU.DLL
FILE_EPSTIFF | Encapsulated PostScript | LFEPS14N.DLL LFTIF14N.DLL | LFEPS14NU.DLL LFTIF14NU.DLL | LFEPS14E.DLL LFTIF14E.DLL | LFEPS14EU.DLL LFTIF14EU.DLL
FILE_EPSWMF | Encapsulated PostScript | LFEPS14N.DLL LFWMF14N.DLL LVKRN14N.DLL | LFEPS14NU.DLL LFWMF14NU.DLL LVKRN14NU.DLL | LFEPS14E.DLL LFWMF14E.DLL LVKRN14E.DLL | LFEPS14EU.DLL LFWMF14EU.DLL LVKRN14EU.DLL
FILE_EPSPOSTSCRIPT | Encapsulated PostScript | LFEPS14N.DLL LFPDF14N.DLL PDFDLL32.DLL | LFEPS14NU.DLL LFPDF14NU.DLL PDFDLL32.DLL | LFEPS14E.DLL LFPDF14E.DLL PDFDLL32.DLL | LFEPS14EU.DLL LFPDF14EU.DLL PDFDLL32.DLL
FILE_EXIF FILE_EXIF_YCC FILE_EXIF_JPEG_411 FILE_EXIF_JPEG_422 | Exif Format | LFTIF14N.DLL LFCMP14N.DLL | LFTIF14NU.DLL LFCMP14NU.DLL | LFTIF14E.DLL LFCMP14E.DLL | LFTIF14EU.DLL LFCMP14EU.DLL
FILE_FAX_G3_1D FILE_FAX_G3_1D_NOEOL FILE_FAX_G3_2D FILE_FAX_G4 | Raw FAX Formats | LFFAX14N.DLL | LFFAX14NU.DLL | LFFAX14E.DLL | LFFAX14EU.DLL
FILE_FIT | Flexible Image Transport System Format | LFFIT14N.DLL | LFFIT14NU.DLL | LFFIT14E.DLL | LFFIT14EU.DLL
FILE_FLC FILE_FLI | Flic Animation | LFFLC14N.DLL | LFFLC14NU.DLL | LFFLC14E.DLL | LFFLC14EU.DLL
FILE_FPX FILE_FPX_SINGLE_COLOR FILE_FPX_JPEG FILE_FPX_JPEG_QFACTOR | Kodak FlashPix Format | LFFPX14N.DLL LFFPX7.DLL LFKODAK.DLL | LFFPX14NU.DLL LFFPX7.DLL LFKODAK.DLL | LFFPX14E.DLL LFFPX7.DLL LFKODAK.DLL | LFFPX14EU.DLL LFFPX7.DLL LFKODAK.DLL
FILE_GERBER | Gerber File Format | LFGBR14N.DLL LVKRN14N.DLL | LFGBR14NU.DLL LVKRN14NU.DLL | LFGBR14E.DLL LVKRN14E.DLL | LFGBR14EU.DLL LVKRN14EU.DLL
FILE_GIF | Compuserve GIF Format | LFGIF14N.DLL | LFGIF14NU.DLL | LFGIF14E.DLL | LFGIF14EU.DLL
FILE_IFF_ILBM FILE_IFF_CAT FILE_IFF_ILBM_UNCOMPRESSED FILE_IFF_CAT_UNCOMPRESSED | Interchange File Format | LFIFF14N.DLL | LFIFF14NU.DLL | LFIFF14E.DLL | LFIFF14EU.DLL
FILE_IMG | GEM Image Format | LFIMG14N.DLL | LFIMG14NU.DLL | LFIMG14E.DLL | LFIMG14EU.DLL
FILE_INTERGRAPH_RLE FILE_INTERGRAPH_CCITT_G4 | Intergraph Format | LFITG14N.DLL LFFAX14N.DLL | LFITG14NU.DLL LFFAX14NU.DLL | LFITG14E.DLL LFFAX14E.DLL | LFITG14EU.DLL LFFAX14EU.DLL
FILE_INTERGRAPH_VECTOR | Intergraph MicroStation and Interactive Graphics Design System Formats | LFDGN14N.DLL LVKRN14N.DLL | LFDGN14NU.DLL LVKRN14NU.DLL | LFDGN14E.DLL LVKRN14E.DLL | LFDGN14EU.DLL LVKRN14EU.DLL
FILE_ICA_IBM_MMR FILE_ICA_UNCOMPRESSED | Image Object Content Architecture Format | LFICA14N.DLL | LFICA14NU.DLL | LFICA14E.DLL | LFICA14EU.DLL
FILE_ICA_G3_1D FILE_ICA_G3_2D FILE_ICA_G4 | Image Object Content Architecture Format | LFICA14N.DLL LFFAX14N.DLL | LFICA14NU.DLL LFFAX14NU.DLL | LFICA14E.DLL LFFAX14E.DLL | LFICA14EU.DLL LFFAX14EU.DLL
FILE_ICA_ABIC | Image Object Content Architecture Format | LFICA14N.DLL LFABI14N.DLL | LFICA14NU.DLL LFABI14NU.DLL | LFICA14E.DLL LFABI14E.DLL | LFICA14EU.DLL LFABI14EU.DLL
FILE_J2K FILE_JP2 | JPEG File Interchange Format | LFJ2K14N.DLL | LFJ2K14NU.DLL | LFJ2K14E.DLL | LFJ2K14EU.DLL
FILE_JBIG2 | JBIG2 Format | LFJB214N.DLL | LFJB214NU.DLL | LFJB214E.DLL | LFJB214EU.DLL
FILE_JBIG | JBIG Format | LFJBG14N.DLL | LFJBG14NU.DLL | LFJBG14E.DLL | LFJBG14EU.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.) | LFCMP14N.DLL | LFCMP14NU.DLL | LFCMP14E.DLL | LFCMP14EU.DLL
FILE_KDC FILE_KDC_120 FILE_KDC_40 FILE_KDC_50 | Kodak Digital Camera Format | LFKDC14N.DLL DC120V154_32.DLL | LFKDC14NU.DLL DC120V154_32.DLL | LFKDC14E.DLL DC120V154_32.DLL | LFKDC14EU.DLL DC120V154_32.DLL
FILE_LASERDATA | LaswerView LaserData Format(read only) | LFFAX14N.DLL | LFFAX14NU.DLL | LFFAX14E.DLL | LFFAX14EU.DLL
FILE_LEAD1BITA | LEAD 1-bit Compressed Format | LFLMA14N.DLL | LFLMA14NU.DLL | LFLMA14E.DLL | LFLMA14EU.DLL
FILE_LEAD1BIT | LEAD 1-bit Compressed Format. | LFLMB14N.DLL | LFLMB14NU.DLL | LFLMB14E.DLL | LFLMB14EU.DLL
FILE_MAC | Macintosh Paint Format | LFMAC14N.DLL | LFMAC14NU.DLL | LFMAC14E.DLL | LFMAC14EU.DLL
FILE_MPEG1 FILE_MPEG2 | MPEG Video Format (read only) | LFMPG14N.DLL | LFMPG14NU.DLL | LFMPG14E.DLL | LFMPG14EU.DLL
FILE_MRC | Mixed Raster Content | LTSGM14N.DLL LFCMP14N.DLL LFFAX14N.DLL | LTSGM14NU.DLL LFCMP14NU.DLL LFFAX14NU.DLL | LTSGM14E.DLL LFCMP14E.DLL LFFAX14E.DLL | LTSGM14EU.DLL LFCMP14EU.DLL LFFAX14EU.DLL
FILE_LEAD_MRC | Mixed Raster Content | LTSGM14N.DLL LFCMP14N.DLL LFFAX14N.DLL LFJBG14N.DLL | LTSGM14NU.DLL LFCMP14NU.DLL LFFAX14NU.DLL LFJBG14NU.DLL | LTSGM14E.DLL LFCMP14E.DLL LFFAX14E.DLL LFJBG14E.DLL | LTSGM14EU.DLL LFCMP14EU.DLL LFFAX14EU.DLL LFJBG14EU.DLL
FILE_PDF_LEAD_MRC | Mixed Raster Content | LTSGM14N.DLL LCMRC14N.DLL LCPDF14N.DLL LCENC14N.DLL LCZIB.DLL LFCMP14N.DLL LFJB214N.DLL | LTSGM14NU.DLL LCMRC14NU.DLL LCPDF14NU.DLL LCENC14NU.DLL LCZIB.DLL LFCMP14NU.DLL LFJB214NU.DLL | LTSGM14E.DLL LCMRC14E.DLL LCPDF14E.DLL LCENC14E.DLL LCZIB.DLL LFCMP14E.DLL LFJB214E.DLL | LTSGM14EU.DLL LCMRC14EU.DLL LCPDF14EU.DLL LCENC14EU.DLL LCZIB.DLL LFCMP14EU.DLL LFJB214EU.DLL
FILE_MSP | Microsoft Paint Format | LFMSP14N.DLL | LFMSP14NU.DLL | LFMSP14E.DLL | LFMSP14EU.DLL
FILE_OS2 FILE_OS2_2 | OS/2 Bitmap Format | LFBMP14N.DLL | LFBMP14NU.DLL | LFBMP14E.DLL | LFBMP14EU.DLL
FILE_PBM_BINARY FILE_PBM_ASCII FILE_PGM_BINARY FILE_PGM_ASCII FILE_PPM_BINARY FILE_PPM_ASCII | Portable Bitmap Utilities Format | LFPNM14N.DLL | LFPNM14NU.DLL | LFPNM14E.DLL | LFPNM14EU.DLL
FILE_PCD | Kodak PhotoCD Format | LFPCD14N.DLL PCDLIB32.DLL PCDLIB.DLL | LFPCD14NU.DLL PCDLIB32.DLL PCDLIB.DLL | LFPCD14E.DLL PCDLIB32.DLL PCDLIB.DLL | LFPCD14EU.DLL PCDLIB32.DLL PCDLIB.DLL
FILE_PCL FILE_PCL_TEST_AS_POLYLINE FILE_PLT | Printer Command Language Format | LFPCL14N.DLL LVKRN14N.DLL | LFPCL14NU.DLL LVKRN14NU.DLL | LFPCL14E.DLL LVKRN14E.DLL | LFPCL14EU.DLL LVKRN14EU.DLL
FILE_PCT | Macintosh Pict | LFPCT14N.DLL | LFPCT14NU.DLL | LFPCT14E.DLL | LFPCT14EU.DLL
FILE_PCX | ZSoft PCX Format | LFPCX14N.DLL | LFPCX14NU.DLL | LFPCX14E.DLL | LFPCX14EU.DLL
FILE_PDF_LEAD_MRC | Mixed Raster Content | LTSGM14N.DLL LFCMP14N.DLL LFFAX14N.DLL LFJB214N.DLL LFPDF14N.DLL PDFDLL32.DLL | LTSGM14NU.DLL LFCMP14NU.DLL LFFAX14NU.DLL LFJB214NU.DLL LFPDF14NU.DLL PDFDLL32.DLL | LTSGM14E.DLL LFCMP14E.DLL LFFAX14E.DLL LFJB214E.DLL LFPDF14E.DLL PDFDLL32.DLL | LTSGM14EU.DLL LFCMP14EU.DLL LFFAX14EU.DLL LFJB214EU.DLL LFPDF14EU.DLL PDFDLL32.DLL
FILE_PLT | PLT / HPGL Format | LFPCL14N.DLL LVKRN14N.DLL | LFPCL14NU.DLL LVKRN14NU.DLL | LFPCL14E.DLL LVKRN14E.DLL | LFPCL14EU.DLL LVKRN14EU.DLL
FILE_PNG | Portable Network Graphics Format | LFPNG14N.DLL | LFPNG14NU.DLL | LFPNG14E.DLL | LFPNG14EU.DLL
FILE_POSTSCRIPT | Postscript Document Format | LFPDF14N.DLL PDFDLL32.DLL PDF Redist File: 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. | LFPDF14NU.DLL PDFDLL32.DLL PDF Redist File: 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. | LFPDF14E.DLL PDFDLL32.DLL PDF Redist File: 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. | LFPDF14EU.DLL PDFDLL32.DLL PDF Redist File: 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 | LFPSD14N.DLL | LFPSD14NU.DLL | LFPSD14E.DLL | LFPSD14EU.DLL
FILE_PSP FILE_PSP_RLE | Paint Shop Pro Format | LFPSP14N.DLL | LFPSP14NU.DLL | LFPSP14E.DLL | LFPSP14EU.DLL
FILE_PTOCA | Presentation Text Object Content Architecture Format | LFPTK14N.DLL | LFPTK14NU.DLL | LFPTK14E.DLL | LFPTK14EU.DLL
FILE_RAS FILE_RAS_RLE | SUN Raster Format | LFRAS14N.DLL | LFRAS14NU.DLL | LFRAS14E.DLL | LFRAS14EU.DLL
FILE_RAS_PDF (Read Support) | Portable Document Format (PDF) | LFPDF14N.DLL PDFDLL32.DLL PDF Redist Files | LFPDF14NU.DLL PDFDLL32.DLL PDF Redist Files | LFPDF14E.DLL PDFDLL32.DLL PDF Redist Files | LFPDF14EU.DLL PDFDLL32.DLL PDF Redist Files
FILE_RAS_PDF FILE_RAS_PDF_LZW (Write Support) | Portable Document Format (PDF) | LFPDF14N.DLL | LFPDF14NU.DLL | LFPDF14E.DLL | LFPDF14EU.DLL
FILE_RAS_PDF_G3_1D FILE_RAS_PDF_G3_2D FILE_RAS_PDF_G4 (Write Support) | Portable Document Format (PDF) | LFPDF14N.DLL LFFAX14N.DLL | LFPDF14NU.DLL LFFAX14NU.DLL | LFPDF14E.DLL LFFAX14E.DLL | LFPDF14EU.DLL LFFAX14EU.DLL
FILE_RAS_PDF_JPEG FILE_RAS_PDF_JPEG_422 FILE_RAS_PDF_JPEG_411 (Write Support) | Portable Document Format (PDF) | LFPDF14N.DLL LFCMP14N.DLL | LFPDF14NU.DLL LFCMP14NU.DLL | LFPDF14E.DLL LFCMP14E.DLL | LFPDF14EU.DLL LFCMP14EU.DLL
FILE_RAS_PDF_JBIG2 (Write Support) | Portable Document Format (PDF) | LFPDF14N.DLL LFJB214N.DLL | LFPDF14NU.DLL LFJB214NU.DLL | LFPDF14E.DLL LFJB214E.DLL | LFPDF14EU.DLL LFJB214EU.DLL
FILE_RAWICA_IBM_MMR FILE_RAWICA_UNCOMPRESSED | Image Object Content Architecture Format | LFICA14N.DLL | LFICA14NU.DLL | LFICA14E.DLL | LFICA14EU.DLL
FILE_RAWICA_G3_1D FILE_RAWICA_G3_2D FILE_RAWICA_G4 | Image Object Content Architecture Format | LFICA14N.DLL LFFAX14N.DLL | LFICA14NU.DLL LFFAX14NU.DLL | LFICA14E.DLL LFFAX14E.DLL | LFICA14EU.DLL LFFAX14EU.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 Formats | LFRAW14S.DLL LFFAX14S.DLL | LFRAW14SU.DLL LFFAX14SU.DLL | LFRAW14SE.DLL LFFAX14SE.DLL | LFRAW14SEU.DLL LFFAX14SEU.DLL
FILE_RTF_RASTER | Rich Text Format(read only) | LFRTF14N.DLL | LFRTF14NU.DLL | LFRTF14E.DLL | LFRTF14EU.DLL
FILE_SCT | Scitex Continuous Tone Format | LFSCT14N.DLL LTCLR14N.DLL | LFSCT14NU.DLL LTCLR14N.DLL | LFSCT14E.DLL LTCLR14N.DLL | LFSCT14EU.DLL LTCLR14N.DLL
FILE_SFF | Structured Fax Format | LFSFF14N.DLL LFFAX14N.DLL | LFSFF14NU.DLL LFFAX14NU.DLL | LFSFF14E.DLL LFFAX14E.DLL | LFSFF14EU.DLL LFFAX14EU.DLL
FILE_SGI FILE_SGI_RLE | Silicon Graphics Format | LFSGI14N.DLL | LFSGI14NU.DLL | LFSGI14E.DLL | LFSGI14EU.DLL
FILE_SHP | ESRI Shape Format | LFSHP14N.DLL LVKRN14N.DLL | LFSHP14NU.DLL LVKRN14NU.DLL | LFSHP14E.DLL LVKRN14E.DLL | LFSHP14EU.DLL LVKRN14EU.DLL
FILE_SID | MrSid Format | LFSID14N.DLL | LFSID14N.DLL | LFSID14N.DLL | LFSID14N.DLL
FILE_SMP FILE_SMP_G3_1D FILE_SMP_G3_2D FILE_SMP_G4 | Xionics Format | LFSMP14N.DLL LFFAX14N.DLL | LFSMP14NU.DLL LFFAX14NU.DLL | LFSMP14E.DLL LFFAX14E.DLL | LFSMP14EU.DLL LFFAX14EU.DLL
FILE_SVG | Scalable Vector Graphics Format | LFSVG14N.DLL LVKRN14N.DLL | LFSVG14NU.DLL LVKRN14NU.DLL | LFSVG14E.DLL LVKRN14E.DLL | LFSVG14EU.DLL LVKRN14EU.DLL
FILE_TGA FILE_TGA_RLE | TruvisionTarga Format | LFTGA14N.DLL | LFTGA14NU.DLL | LFTGA14E.DLL | LFTGA14EU.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 | LFTIF14N.DLL If you are loading TIF files that use LAB color space, you will also need LTCLR. | LFTIF14NU.DLL If you are loading TIF files that use LAB color space, you will also need LTCLR. | LFTIF14E.DLL If you are loading TIF files that use LAB color space, you will also need LTCLR. | LFTIF14EU.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 | LFTIF14N.DLL LFFAX14N.DLL | LFTIF14N.DLL LFFAX14NU.DLL | LFTIF14E.DLL LFFAX14E.DLL | LFTIF14E.DLL LFFAX14EU.DLL
FILE_TIF_CMYK FILE_TIF_PACKBITS_CMYK FILE_TIFLZW_CMYK | TIFF Tagged Image File Format | LFTIF14N.DLL LTCLR14N.DLL | LFTIF14N.DLL LTCLR14NU.DLL | LFTIF14N.DLL LTCLR14E.DLL | LFTIF14N.DLL LTCLR14EU.DLL
FILE_TIF_JPEG FILE_TIF_JPEG_422 FILE_TIF_JPEG_411 FILE_TIF_CMP | TIFF Tagged Image File Format | LFTIF14N.DLL LFCMP14N.DLL | LFTIF14N.DLL LFCMP14NU.DLL | LFTIF14N.DLL LFCMP14E.DLL | LFTIF14N.DLL LFCMP14EU.DLL
FILE_TIF_JBIG | TIFF Tagged Image File Format | LFTIF14N.DLL LFJBG14N.DLL | LFTIF14N.DLL LFJBG14NU.DLL | LFTIF14N.DLL LFJBG14E.DLL | LFTIF14N.DLL LFJBG14EU.DLL
FILE_TIF_JBIG2 | TIFF Tagged Image File Format | LFTIF14N.DLL LFJB214N.DLL | LFTIF14N.DLL LFJB214NU.DLL | LFTIF14N.DLL LFJB214E.DLL | LFTIF14N.DLL LFJB214EU.DLL
FILE_TIF_DXF_R12 FILE_TIF_DXF_R13 | TIFF Tagged Image File Format | LFTIF14N.DLL LFDXF14N.DLL LVKRN14N.DLL | LFTIF14N.DLL LFDXF14NU.DLL LVKRN14NU.DLL | LFTIF14N.DLL LFDXF14E.DLL LVKRN14E.DLL | LFTIF14N.DLL LFDXF14EU.DLL LVKRN14EU.DLL
FILE_TIF_J2K | TIFF Tagged Image File Format | LFTIF14N.DLL LFJ2K14N.DLL | LFTIF14N.DLL LFJ2K14NU.DLL | LFTIF14N.DLL LFJ2K14E.DLL | LFTIF14N.DLL LFJ2K14EU.DLL
FILE_TIFX_JBIG FILE_TIFX_JBIG_T43 FILE_TIFX_JBIG_T43_ITULAB FILE_TIFX_JBIG_T43_GS | Xerox Internet Fax Format | LFTFX14N.DLL LFJBG14N.DLL | LFTFX14N.DLL LFJBG14NU.DLL | LFTFX14N.DLL LFJBG14E.DLL | LFTFX14N.DLL LFJBG14EU.DLL
FILE_TIFX_FAX_G3_1D FILE_TIFX_FAX_G3_2D FILE_TIFX_FAX_G4 | Xerox Internet Fax Format | LFTFX14N.DLL LFFAX14N.DLL | LFTFX14N.DLL LFFAX14NU.DLL | LFTFX14N.DLL LFFAX14E.DLL | LFTFX14N.DLL LFFAX14EU.DLL
FILE_TIFX_JPEG | Xerox Internet Fax Format | LFTFX14N.DLL LFCMP14N.DLL | LFTFX14N.DLL LFCMP14NU.DLL | LFTFX14N.DLL LFCMP14E.DLL | LFTFX14N.DLL LFCMP14EU.DLL
FILE_TIF_CMW | TIFF Tagged Image File Format | LFTIF14N.DLL LFCMW14N.DLL | LFTIF14N.DLL LFCMW14NU.DLL | LFTIF14N.DLL LFCMW14E.DLL | LFTIF14N.DLL LFCMW14EU.DLL
FILE_TIF_ABC | TIFF Tagged Image File Format | LFTIF14N.DLL LFABC14N.DLL | LFTIF14N.DLL LFABC14NU.DLL | LFTIF14N.DLL LFABC14E.DLL | LFTIF14N.DLL LFABC14EU.DLL
FILE_TIF_ABIC | TIFF Tagged Image File Format | LFTIF14N.DLL LFABI14N.DLL | LFTIF14N.DLL LFABI14NU.DLL | LFTIF14N.DLL LFABI14E.DLL | LFTIF14N.DLL LFABI14EU.DLL
FILE_TIF_MRC | TIFF Tagged Image File Format | LFTIF14N.DLL LTSGM14N.DLL LFCMP14N.DLL LFFAX14N.DLL | LFTIF14N.DLL LTSGM14NU.DLL LFCMP14NU.DLL LFFAX14NU.DLL | LFTIF14N.DLL LTSGM14E.DLL LFCMP14E.DLL LFFAX14E.DLL | LFTIF14N.DLL LTSGM14EU.DLL LFCMP14EU.DLL LFFAX14EU.DLL
FILE_TIF_LEAD_MRC | TIFF Tagged Image File Format | LFTIF14N.DLL LTSGM14N.DLL LFCMP14N.DLL LFFAX14N.DLL LFJBG14N.DLL | LFTIF14NU.DLL LTSGM14NU.DLL LFCMP14NU.DLL LFFAX14NU.DLL LFJBG14NU.DLL | LFTIF14E.DLL LTSGM14E.DLL LFCMP14E.DLL LFFAX14E.DLL LFJBG14E.DLL | LFTIF14EU.DLL LTSGM14EU.DLL LFCMP14EU.DLL LFFAX14EU.DLL LFJBG14EU.DLL
FILE_TXT | ASCII Text Files (read only) | LFTXT14N.DLL | LFTXT14NU.DLL | LFTXT14E.DLL | LFTXT14EU.DLL
FILE_VECTOR_DUMP | LEADTOOLS Vector Dump Format | LFVEC14N.DLL LVKRN14N.DLL | LFVEC14NU.DLL LVKRN14NU.DLL | LFVEC14E.DLL LVKRN14E.DLL | LFVEC14EU.DLL LVKRN14NU.DLL
FILE_VWPG | WordPerfect Vector Format | LFVPG14N.DLL LVKRN14N.DLL | LFVPG14NU.DLL LVKRN14NU.DLL | LFVPG14E.DLL LVKRN14E.DLL | LFVPG14EU.DLL LVKRN14NU.DLL
FILE_WBMP | Wireless Bitmap Format | LFWMP14N.DLL | LFWMP14NU.DLL | LFWMP14E.DLL | LFWMP14EU.DLL
FILE_WIN_ICO FILE_WIN_CUR | Windows Icon and Cursor Formats | LFBMP14N.DLL | LFBMP14NU.DLL | LFBMP14E.DLL | LFBMP14EU.DLL
FILE_WFX_G3_1D FILE_WFX_G4 | Delrina WinFax Format | LFWFX14N.DLL LFFAX14N.DLL | LFWFX14NU.DLL LFFAX14NU.DLL | LFWFX14E.DLL LFFAX14E.DLL | LFWFX14EU.DLL LFFAX14EU.DLL
FILE_WMF | Windows Metafile | LFWMF14N.DLL LVKRN14N.DLL | LFWMF14NU.DLL LVKRN14NU.DLL | LFWMF14E.DLL LVKRN14E.DLL | LFWMF14EU.DLL LVKRN14EU.DLL
FILE_WMZ | Compressed Windows Metafile Format | LFWMZ14N.DLL LVKRN14N.DLL | LFWMZ14NU.DLL LVKRN14NU.DLL | LFWMZ14E.DLL LVKRN14E.DLL | LFWMZ14EU.DLL LVKRN14EU.DLL
FILE_WPG | WordPerfect Graphic Format | LFWPG14N.DLL | LFWPG14NU.DLL | LFWPG14E.DLL | LFWPG14EU.DLL
FILE_XBM | XWindowsXBitMap Format | LFXBM14N.DLL | LFXBM14NU.DLL | LFXBM14E.DLL | LFXBM14EU.DLL
FILE_XPM | X Window PixMap Format | LFXPM14N.DLL | LFXPM14NU.DLL | LFXPM14E.DLL | LFXPM14EU.DLL
FILE_XWD10 FILE_XWD11 | X Window Dump Format | LFXWD14N.DLL | LFXWD14NU.DLL | LFXWD14E.DLL | LFXWD14EU.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\DLL | One subdirectory for each example API 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.
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.
REDIST\NONAG | This directory contains the LTKRN DLL that must be distributed with your application. For more information about the nag and no-nag versions of LTKRN, refer to Document/Medical Support and Licensing Requirements. For non-royalty products, the extra licensing requirements do not apply, simply distribute the LTKRN from REDIST\NONAG.
USES | Pascal user uses and includes files.


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

MPG - MPEG Video Format

MRC - Mixed Raster Content

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

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


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) | LMC

When loading a multipage file, you can load all pages using L_LoadBitmapList. If you wish to load only one of the pages, set the page number in an instance of LOADFILEOPTIONwhen calling a loading function.

See Also

Implementing Animation


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.

Required registry: LFCRW requires the file "CDSDK.reg" to update the system registry on the target machine. It should be registered on any machine that needs LFCRW support.

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.

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

Related Formats: CGM - Computer Graphics Metafile, CMX - Corel Presentation Exchange Format, DGN - Intergraph Format, DRW - Micrografx Designer DRaWing, DWF - DWF Format, DWG - DWG Format, DXF - Drawing Interchange Format, EMF - Windows Metafile Formats, GBR - Gerber Format, PCL - Printer Command Language Format, PCT - Macintosh Pict Format, PDF - Portable Document Format, 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: 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 varioius types. You can use the L_ReadFileComment function to read comments in an existing file. Before writing a file, you can use the L_SetComment function 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 in LOADFILEOPTION.

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: 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 API the L_SetDJVOptions and L_GetDJVOptions functions let 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: 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.

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


File Formats: DRaWing (DRW)

DRaWing (DRW)

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

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

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

The file constants associated with this file format are:

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

When DRW files are rasterized, they are 24 BPP.

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

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

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

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

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


File Formats: Drawing Interchange Format (DXF)

Drawing Interchange Format (DXF)

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

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

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

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

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

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DXF | Yes | Yes | [58] AutoDesk AutoCAD ASCII format Release 12.
FILE_DXF_R12 | Yes | Yes | Same as FILE_DXF
FILE_DXF_R13 | Yes | Yes | [290] AutoDesk AutoCAD ASCII format Release 13.

When DXF files are rasterized, they are 24 BPP.

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

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

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

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

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


File Formats: DWF Format (DWF)

DWF Format (DWF)

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

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

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

The file constants associated with this file format are:

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

When DWF files are rasterized, they are 24 BPP.

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

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

LEADTOOLS also supports text and embedded raster objects.

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

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


File Formats: DWG Format (DWG)

DWG Format (DWG)

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

LEADTOOLS supports DWG 13, 14 and 15 files.

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

The default extension used by this format is: DWG.

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

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_DWG | Yes | No | [124] AutoDesk AutoCAD binary format.

When DWG files are rasterized, they are 24 BPP.

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

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

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

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


File Formats: 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 .

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


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: 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 L_ReadFileComment function to read comments in an existing file. Before writing a file, you can use the L_SetComment function 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.

An Exif JPG file can also contain a stamp (thumbnail) image, which is a small copy of the main image. The stamp stamp size has been restricted to 160x120x24. When saving Exif files, the StampWidth, StampHeight, and StampBits members of the SAVEFILEOPTION structure will be ignored and 160 (StampWidth), 120 (StampHeight) and 24 (StampBits) will be used instead. 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.

To load a stamp image from a file, use the L_GetCompressFileStamp function.

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

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


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: 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. For instructions for implementing progressive formats, refer to Controlling Progressive Loads and Saves. JPEG and LEAD files can contain many comment fields of various types. You can use the L_ReadFileComment function to read comments in an existing file. Before writing a file, you can use the L_SetComment function 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.

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

Related Formats: 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.

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

Related Formats: 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 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: 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: 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 (MRC)

Mixed Raster Content (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 L_GetLoadResolution, L_ReadLoadResolutions and L_SetLoadResolution.

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: 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 L_LoadLayer, or all at once, using L_LoadBitmap.

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.

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

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


File Formats: 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 ESO_PDF_SAVE_LOW_MEMORY_USAGE flag. 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 PDF_DISABLE_CROPPING flag in the FILEPDFOPTIONS structure, and an option that disables the use of CIE colors, by setting the PDF_DISABLE_CIECOLORS flag in the FILEPDFOPTIONS structure. 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.

For saving JBIG2 compressed PDF files, the user should unlock this capability using L_KEY_JBIG2.

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_JBIG2 | N/A* | 1 BPP | [188] Raster PDF with JBIG2 Compression.
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 LOADFILEOPTION structure's Passes field 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 PDF_DISABLE_CROPPING flag in the FILEPDFOPTIONS structure, and an option that disables the use of CIE colors, by setting the PDF_DISABLE_CIECOLORS flag in the FILEPDFOPTIONS structure. 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: 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 L_ReadFileComment function to read comments in an existing file. Before writing a file, you can use the L_SetComment function 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_ABIC | 1, 4 BPP | 1, 4 BPP | [186] Tagged Image File Format, with ABIC compression. (Supports multi-page) (ABIC support is required.)
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_JBIG2 | 1 BPP | 1 BPP | [187] Tagged Image File Format with JBIG2 Compression. (Supports multi-page) (JBIG2 and Advanced PDF support is required.)
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: 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: 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.


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: 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 ABC, 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: 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: 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: 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: 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: 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: 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.

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

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


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

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


API Function Groups

Raster Image Functions

Creation, Deletion, and Copying

Displaying and Printing

Image Processing

Input and Output

Palettes

Region Processing

Registered Class

Working with GeoKeys

Annotation Functions (Document/Medical only)

Automation

Creation, Deletion, and Copying

Displaying and Printing

Global Properties

Grouping and Ungrouping Objects

Hyperlinks

Input and Output

Object Information

Object Properties

Realizing to a Bitmap

Security

Size, Position, and Shape

Optimizer

ICC Profile Functions

ICC Profile Functions

Support Functions

Callbacks

ImageList Control

Version and License Information


Raster Image Functions: Working with GeoKeys

Raster Image Functions:
Working with GeoKeys

L_SetGeoKey

L_GetGeoKey

L_WriteFileGeoKey

L_ReadFileGeoKey

L_EnumFileGeoKeys

ENUMGEOKEYSCALLBACK


Raster Image Functions: Creation, Deletion, and Copying

Raster Image Functions:
Creation, Deletion, and Copying

Copying Images

Creating and Deleting Images

Creating and Maintaining Lists of Images

Using DIBs and DDBs

Using EMFs and WMFs

Using the Clipboard


Raster Image Functions: Copying Images

Raster Image Functions:
Creation, Deletion, and Copying
Copying Images

L_CombineBitmap

L_CopyBitmap

L_CopyBitmapData

L_CopyBitmapHandle

L_CopyBitmapPalette

L_CopyBitmapRect

L_UnderlayBitmap


Raster Image Functions: Creating and Deleting Images

Raster Image Functions:
Creation, Deletion, and Copying
Creating and Deleting Images

L_AllocateBitmap

L_CreateBitmap

L_DeletePage

L_FreeBitmap

L_GetBitmapMemoryInfo

L_GetMemoryThresholds

L_GetTempDirectory

L_InitBitmap

L_SetBitmapMemoryInfo

L_SetMemoryThresholds

L_SetTempDirectory


Raster Image Functions: Creating and Maintaining Lists of Images

Raster Image Functions:
Creation, Deletion, and Copying
Creating and Maintaining Lists of Images

Creating, saving, and deleting lists:

L_CopyBitmapListItems

L_CreateBitmapList

L_DestroyBitmapList

L_LoadBitmapList

L_SaveBitmapList

L_SliceBitmap

Maintaining list items:

L_ColorResBitmapList

L_DeleteBitmapListItems

L_GetBitmapListCount

L_InsertBitmapListItem

L_RemoveBitmapListItem

L_TranslateBitmapColor

Accessing bitmaps in a list:

L_GetBitmapListItem

L_SetBitmapListItem


Raster Image Functions: Using DIBs and DDBs

Raster Image Functions:
Creation, Deletion, and Copying
Using DIBs and DDBs

DIB functions:

L_ChangeFromDIB

L_ChangeToDIB

L_ConvertFromDIB

L_ConvertToDIB

DDB functions:

L_ChangeFromDDB

L_ChangeToDDB

L_ConvertFromDDB

L_ConvertToDDB


Raster Image Functions: Using EMFs and WMFs

Raster Image Functions:
Creation, Deletion, and Copying
Using EMFs and WMFs

EMF functions:

L_ChangeFromEMF

L_ChangeToEMF

L_ConvertFromEMF

L_ConvertToEMF

WMF functions:

L_ChangeFromWMF

L_ChangeToWMF

L_ConvertFromWMF

L_ConvertToWMF


Raster Image Functions: Using the Clipboard

Raster Image Functions:
Creation, Deletion, and Copying
Using the Clipboard

L_ClipboardReady

L_CopyBitmapPalette

L_CopyFromClipboard

L_CopyToClipboard


Raster Image Functions: Displaying and Printing

Raster Image Functions:
Displaying and Printing

Displaying Images

Playing Animated Images

Printing Images

Using Special Effects


Raster Image Functions: Displaying Images

Raster Image Functions:
Displaying and Printing
Displaying Images

Setting options:

L_CreatePaintPalette

L_DupBitmapPalette

L_SetBitmapPalette

L_GetDisplayMode

L_SetDisplayMode

L_GetPaintContrast

L_SetPaintContrast

L_GetPaintGamma

L_SetPaintGamma

L_GetPaintIntensity

L_SetPaintIntensity

L_WindowLevel

L_WindowLevelBitmap

L_WindowLevelFillLUT

Painting a bitmap:

L_EfxEffectBlt

L_EfxPaintBitmap

L_PaintDC

L_PaintDCBuffer

L_PaintDCCMYKArray

L_PaintDCEffect

L_PaintDCOverlay

Painting a bitmap's region:

L_PaintRgnDC

L_PaintRgnDCBuffer

L_PaintRgnDCEffect

L_PaintDCCMYKArray

Using a PanWindow:

L_CreatePanWindow

L_DestroyPanWindow

L_UpdatePanWindow

PANWNDCALLBACK

Using the Magnifying Glass:

L_SetMagGlassOwnerDrawCallback

L_SetMagGlassPaintOptions

L_SetMagGlassPos

L_ShowMagGlass

L_StartMagGlass

L_StopMagGlass

L_UpdateMagGlassBitmap

L_UpdateMagGlass

L_UpdateMagGlassRect

L_UpdateMagGlassShape

L_WindowHasMagGlass

MAGGLASSCALLBACK

MAGGLASSOWNERDRAWCALLBACK

Using Zoom View:

L_CreateZoomView

L_DestroyZoomView

L_GetZoomViewProps

L_GetZoomViewsCount

L_RenderZoomView

L_UpdateZoomView

L_WindowHasZoomView

ZOOMVIEWPROPS

Using double buffering to minimize flicker:

L_DoubleBufferBegin

L_DoubleBufferCreateHandle

L_DoubleBufferDestroyHandle

L_DoubleBufferEnable

L_DoubleBufferEnd

See Also

Implementing Transparency


Raster Image Functions: Playing Animated Images

Raster Image Functions:
Displaying and Printing
Playing Animated Images

Creating and deleting playbacks:

L_CreatePlayback

L_DestroyPlayback

Creating a list during a playback:

L_AppendPlayback

L_ValidatePlaybackLines

Running playbacks:

L_CancelPlaybackWait

L_ClearPlaybackUpdateRect

L_GetPlaybackDelay

L_GetPlaybackIndex

L_GetPlaybackState

L_GetPlaybackUpdateRect

L_ProcessPlayback

L_SetPlaybackIndex

See Also

Implementing Transparency


Raster Image Functions: Printing Images

Raster Image Functions:
Displaying and Printing
Printing Images

L_PrintBitmap

L_PrintBitmapFast


Raster Image Functions: Using Special Effects

Raster Image Functions:
Displaying and Printing
Using Special Effects

Painting bitmaps:

L_EfxEffectBlt

L_EfxPaintBitmap

Painting text:

L_EfxDraw3dText

L_EfxDrawRotated3dText

Painting shapes and patterns:

L_EfxDraw3dShape

L_EfxDrawFrame

L_EfxGradientFillRect

L_EfxPaintTransition

L_EfxPatternFillRect

See Also

Implementing Transparency


Raster Image Functions: Image Processing

Raster Image Functions:
Image Processing

Analysis Image Object or Region Analysis

Artistic Effects

Changing Brightness and Contrast

Cleaning Up 1-Bit Images

Combining Images

Comparing Images

Correcting Colors

Detecting and Enhancing Edges and Lines

Document Imaging

Doing Color Expansion or Reduction

Doing Color Space Conversions

Doing Geometric Transformations

Drawing on a Bitmap

Filtering Images

Fourier Transform

Getting and Setting Pixel Values

Image Analysis

Interpreting Bitmap Coordinates

Modifying Intensity Values

Processing an Image

Removing Noise

Using Histograms

Using the Alpha Channel

Working with Color Halftones


Raster Image Functions: Analysis Image Object or Region Analysis

Raster Image Functions:
Analysis Image Object or Region Analysis

L_CorrelationBitmap

L_CorrelationListBitmap

L_GetFeretsDiameter

L_GetObjectInfo

L_GetRgnContourPoints

L_GetRgnPerimeterLength

L_SelectBitmapData

L_SkeletonBitmap

L_SpatialFilterBitmap

L_SubtractBackgroundBitmap

L_UserFilterBitmap


Raster Image Functions: Artistic Effects

Raster Image Functions:
Image Processing
Artistic Effects

L_AddShadowBitmap

L_AgingBitmap

L_BricksTextureBitmap

L_CanvasBitmap

L_CloudsBitmap

L_ColoredBallsBitmap

L_CubismBitmap

L_DiffuseGlowBitmap

L_DisplaceMapBitmap

L_DrawStarBitmap

L_DiceEffectBitmap

L_DryBitmap

L_FragmentBitmap

L_FunctionalLightBitmap

L_GlassEffectBitmap

L_LensFlareBitmap

L_LightBitmap

L_MaskConvolutionBitmap

L_MosaicTilesBitmap

L_OceanBitmap

L_OffsetBitmap

L_PerspectiveBitmap

L_PlaneBendBitmap

L_PlaneBitmap

L_PlasmaFilterBitmap

L_PointillistBitmap

L_PuzzleEffectBitmap

L_RevEffectBitmap

L_RomanMosaicBitmap

L_RingEffectBitmap

L_SegmentBitmap

L_TunnelBitmap

L_VignetteBitmap

L_ZigZagBitmap


Raster Image Functions: Changing Brightness and Contrast

Raster Image Functions:
Changing Brightness and Contrast

L_AdaptiveContrastBitmap

L_AddBitmaps

L_AddWeightedBitmaps

L_ApplyLinearModalityLUT

L_ApplyLinearVOILUT

L_ApplyModalityLUT

L_ApplyVOILUT

L_AutoColorLevelBitmap

L_ChangeBitmapContrast

L_ChangeBitmapHue

L_ChangeBitmapIntensity

L_ChangeBitmapSaturation

L_ChangeHueSatIntBitmap

L_ColorIntensityBalance

L_ColorLevelBitmap

L_ColorMergeBitmap

L_ColorSeparateBitmap

L_ContBrightIntBitmap

L_DynamicBinaryBitmap

L_GammaCorrectBitmapExt

L_GammaCorrectBitmap

L_GetBitmapHistogram

L_GetFunctionalLookupTable

L_GetUserLookupTable

L_HistoContrastBitmap

L_HistoEqualizeBitmap

L_HSVtoRGB

L_LightControlBitmap

L_LocalHistoEqualizeBitmap

L_MathFunctionBitmap

L_MultiplyBitmap

L_MultiplyBitmap

L_RemapBitmapHue

L_RemapBitmapIntensity

L_RGBtoHSV

L_SetPaintContrast

L_SetPaintGamma

L_SetPaintIntensity

L_StretchBitmapIntensity

L_SubtractBackgroundBitmap


Raster Image Functions: Cleaning Up 1-Bit Images

Raster Image Functions:
Image Processing
 Cleaning Up 1-Bit Images

(Document/Medical)

L_BorderRemoveBitmap

L_ColorBitmapRgn

L_DotRemoveBitmap

L_HolePunchRemoveBitmap

L_InvertedTextBitmap

L_LineRemoveBitmap

L_SmoothBitmap


Raster Image Functions: Combining Images

Raster Image Functions:
Image Processing
Combining Images

L_AddBitmaps

L_AddBorder

L_AddFrame

L_AddWeightedBitmaps

L_AlphaBlendBitmap

L_BricksTextureBitmap

L_BumpMapBitmap

L_CanvasBitmap

L_CombineBitmap

L_CombineBitmapExt

L_CombineBitmapWarp

L_CreateFadedMask

L_DisplaceMapBitmap

L_FeatherAlphaBlendBitmap

L_FragmentBitmap

L_GetOverlayAttributes

L_GetOverlayBitmap

L_GetOverlayCount

L_MultiplyBitmap

L_PaintDCOverlay

L_PicturizeBitmap

L_PicturizeBitmapList

L_PicturizeBitmapSingle

L_SetOverlayAttributes

L_SetOverlayBitmap

L_TextureAlphaBlendBitmap

L_UnderlayBitmap

L_UpdateBitmapOverlayBits

L_VignetteBitmap

See Also

Implementing Transparency

Processing an Image


Raster Image Functions: Comparing Images

Raster Image Functions:
Image Processing
Comparing Images

L_CorrelationBitmap

L_CorrelationListBitmap


Raster Image Functions: Correcting Colors

Raster Image Functions:
Correcting Colors

L_AdjustBitmapTint

L_AntiAliasBitmap

L_ApplyMathLogicBitmap

L_AutoColorLevelBitmap

L_BalanceColors

L_BumpMapBitmap

L_ChangeBitmapHue

L_ChangeBitmapSaturation

L_ChangeHueSatIntBitmap

L_ChannelMix

L_ColorHalfToneBitmap

L_ColorIntensityBalance

L_ColorizeGrayBitmap

L_ColorLevelBitmap

L_ColorReplaceBitmap

L_ColorThresholdBitmap

L_CubismBitmap

L_DrawStarBitmap

L_DryBitmap

L_FreePlaneBendBitmap

L_FreeRadBendBitmap

L_GlassEffectBitmap

L_GlowFilterBitmap

L_InvertBitmap

L_LensFlareBitmap

L_LightBitmap

L_LightControlBitmap

L_OceanBitmap

L_PlaneBendBitmap

L_PlaneBitmap

L_RemoveRedeyeBitmap

L_SampleTargetBitmap

L_SelectBitmapData

L_SelectiveColorBitmap

L_ShiftBitmapData

L_SmoothEdgesBitmap

L_SwapColors

L_TunnelBitmap


Raster Image Functions: Detecting and Enhancing Edges and Lines

Raster Image Functions:
Detecting and Enhancing Edges and Lines

L_CombineBitmap

L_DiffuseGlowBitmap

L_DirectionEdgeStatisticalBitmap

L_EdgeDetectEffectBitmap

L_EdgeDetectorBitmap

L_EdgeDetectStatisticalBitmap

L_GaussianFilterBitmap

L_GlowFilterBitmap

L_HighPassFilterBitmap

L_IntensityDetectBitmap

L_MaskConvolutionBitmap

L_SharpenBitmap

L_SkeletonBitmap

L_SmoothEdgesBitmap

L_SpatialFilterBitmap

L_UnsharpMaskBitmap


Raster Image Functions: Document Imaging

Raster Image Functions:
Document Imaging

L_ApplyTransformationParameters

L_GetMarksCenterMassBitmap

L_GetTransformationParameters

L_IsRegMarkBitmap

L_SearchRegMarksBitmap

See Also

Detecting Registration Marks

How to Use the Registration Marks Demo


Raster Image Functions: Doing Color Expansion or Reduction

Raster Image Functions:
Image Processing
Doing Color Expansion or Reduction

Automated color reduction:

L_DefaultDithering

Main color resolution functions:

L_ColorResBitmap

L_ColorResBitmapList

Support for dithering to a custom palette:

L_CreateUserMatchTable

L_FreeUserMatchTable

L_SetUserMatchTable

Specialized resolution functions:

L_AutoBinaryBitmap

L_ChannelMix

L_ColorHalfToneBitmap

L_ConvertToColoredGray

L_DesaturateBitmap

L_DynamicBinaryBitmap

L_GrayScaleBitmap

L_GrayScaleBitmapExt

L_GrayScaleToDuotone

L_GrayScaleToMultitone

L_HalfToneBitmap

L_HalfTonePatternBitmap

L_PointillistBitmap

L_SampleTargetBitmap

L_SegmentBitmap

L_WindowLevelBitmap ( Medical edition only)

Low-level color resolution functions:

L_ConvertBuffer

L_ConvertBufferExt

L_DitherLine

L_StartDithering

L_StopDithering

See Also

Processing an Image


Raster Image Functions: Doing Color Space Conversions

Raster Image Functions:
Image Processing
Doing Color Space Conversions

L_ColorMergeBitmap

L_ColorResBitmap

L_ColorThresholdBitmap

L_ColorSeparateBitmap

L_ConvertBufferExt

L_ConvertColorSpace

L_CreateUserMatchTable

L_DefaultDithering

L_HSVtoRGB

L_RGBtoHSV

See Also

Processing an Image


Raster Image Functions: Doing Geometric Transformations

Raster Image Functions:
Image Processing
Doing Geometric Transformations

High-level resizing alternatives:

L_ResampleBitmap

L_ResizeBitmap

L_SizeBitmap

High-level trimming alternatives:

L_AutoTrimBitmap

L_GetAutoTrimRect

L_TrimBitmap

Other high-level transformation functions:

L_BendingBitmap

L_BricksTextureBitmap

L_ChangeBitmapViewPerspective

L_CylindricalBitmap

L_DeskewBitmap ( Document/Medical only)

L_DeskewBitmapExt ( Document/Medical only)

L_DisplaceMapBitmap

L_FlipBitmap

L_FreeHandShearBitmap

L_FreeHandWaveBitmap

L_FreePlaneBendBitmap

L_FreeRadBendBitmap

L_ImpressionistBitmap

L_MosaicTilesBitmap

L_OffsetBitmap

L_PerspectiveBitmap

L_PlaneBendBitmap

L_PlaneBitmap

L_PlasmaFilterBitmap

L_PolarBitmap

L_PunchBitmap

L_RadialBlurBitmap

L_RadWaveBitmap

L_ReadFileTransforms

L_ReverseBitmap

L_RippleBitmap

L_RomanMosaicBitmap

L_RotateBitmap

L_RotateBitmapFine

L_RotateBitmapViewPerspective ( Document/Medical only)

L_ShearBitmap

L_SpherizeBitmap

L_SwirlBitmap

L_TransformFile

L_TunnelBitmap

L_WaveBitmap

L_WindBitmap

L_WriteFileTransforms

L_ZigZagBitmap

L_ZoomBlurBitmap

L_ZoomWaveBitmap

Low-level resizing functions:

L_Resize

L_StartResize

L_StartResizeBitmap

L_StopResize

L_StopResizeBitmap

See Also

Processing an Image


Raster Image Functions: Drawing on a Bitmap

Raster Image Functions:
Image Processing
Drawing on a Bitmap

L_CreateLeadDC

L_DeleteLeadDC

See Also

Processing an Image


Raster Image Functions: Filtering Images

Raster Image Functions:
Image Processing
Filtering Images

General Filters

L_BinaryFilterBitmap

L_EdgeDetectorBitmap

L_SpatialFilterBitmap

Specialized Spatial Filters

L_AddBitmapNoise

L_AutoBinaryBitmap

L_AddShadowBitmap

L_AverageFilterBitmap

L_BricksTextureBitmap

L_ColoredPencilBitmap

L_ContourFilterBitmap

L_DespeckleBitmap

L_DeskewBitmap

L_DeskewBitmapExt

L_DiffuseGlowBitmap

L_DirectionEdgeStatisticalBitmap

L_DynamicBinaryBitmap

L_EdgeDetectEffectBitmap

L_EdgeDetectStatisticalBitmap

L_EmbossBitmap

L_GaussianFilterBitmap

L_GlowFilterBitmap

L_HalfTonePatternBitmap

L_HighPassFilterBitmap

L_IntensityDetectBitmap

L_MaskConvolutionBitmap

L_MedianFilterBitmap

L_MosaicBitmap

L_MotionBlurBitmap

L_OilifyBitmap

L_PerlinBitmap

L_PerspectiveBitmap

L_PlasmaFilterBitmap

L_PointillistBitmap

L_PosterizeBitmap

L_SharpenBitmap

L_SmoothEdgesBitmap

L_SolarizeBitmap

L_UnsharpMaskBitmap

Specialized Binary Filters

L_MaxFilterBitmap

L_MinFilterBitmap

L_ImpressionistBitmap

L_PixelateBitmap

L_RadialBlurBitmap

L_SkeletonBitmap

L_ZoomBlurBitmap

See Also

Applying Artistic Effects

Detecting and Enhancing Edges and Lines

Removing Noise


Raster Image Functions: Fourier Transform

Raster Image Functions:
Image Processing
Fourier Transform

L_AllocFTArray

L_DFTBitmap

L_FFTBitmap

L_FreeFTArray

L_FTDisplayBitmap

L_FrqFilterBitmap

L_FrqFilterMaskBitmap


Raster Image Functions: Getting and Setting Pixel Values

Raster Image Functions:
Image Processing
Getting and Setting Pixel Values

High-level functions:

L_ClearBitmap

L_ClearNegativePixels

L_ColorReplaceBitmap

L_ColorThresholdBitmap

L_ConvertBitmapSignedToUnsigned

L_FillBitmap

L_GetBitmapColorCount

L_RemoveRedeyeBitmap

L_ShiftMinimumToZero

L_ShiftZeroToNegative

Lock and release for low-level functions:

L_AccessBitmap

L_LineProfile

L_ReleaseBitmap

Low-level functions:

L_GetBitmapRow

L_PutBitmapRow

L_GetBitmapRowCol

L_PutBitmapRowCol

L_GetPixelColor

L_PutPixelColor

L_GetPixelData

L_PutPixelData

L_GetResizedRowCol

L_LineProfile


Raster Image Functions: Image Analysis

Raster Image Functions:
Image Analysis

L_CorrelationBitmap

L_CorrelationListBitmap

L_ColorizeGrayBitmap

L_DigitalSubtractBitmap

L_DynamicBinaryBitmap

L_GetBitmapStatisticsInfo

L_GetFeretsDiameter

L_GetObjectInfo

L_IntensityDetectBitmap

L_MultiScaleEnhancementBitmap

L_SelectBitmapData

L_SkeletonBitmap

L_SpatialFilterBitmap

L_SubtractBackgroundBitmap

L_UserFilterBitmap


Raster Image Functions: Interpreting Bitmap Coordinates

Raster Image Functions:
Image Processing
Interpreting Bitmap Coordinates

L_ChangeBitmapViewPerspective

L_PointFromBitmap

L_PointToBitmap

L_RectFromBitmap

L_RectToBitmap

L_RotateBitmapViewPerspective ( Document/Medical only)


Raster Image Functions: Modifying Intensity Values

Raster Image Functions:
Image Processing
Modifying Intensity Values

For overall brightness and contrast:

L_AdaptiveContrastBitmap

L_AddBitmaps

L_AddWeightedBitmaps

L_AdjustBitmapTint

L_ApplyLinearModalityLUT

L_ApplyLinearVOILUT

L_ApplyModalityLUT

L_ApplyVOILUT

L_AutoColorLevelBitmap

L_ChangeBitmapContrast

L_ChangeBitmapIntensity

L_GammaCorrectBitmap

L_GammaCorrectBitmapExt

L_GetFunctionalLookupTable

L_GetUserLookupTable

L_HistoContrastBitmap

L_HistoEqualizeBitmap

L_MultiplyBitmap

L_LightBitmap

L_LightControlBitmap

L_LocalHistoEqualizeBitmap

L_ReadFileTransforms

L_SelectiveColorBitmap

L_SetKaufmannRgnBitmap

L_StretchBitmapIntensity

L_SubtractBackgroundBitmap

L_WriteFileTransforms

For color changes:

L_AgingBitmap

L_ApplyMathLogicBitmap

L_BalanceColors

L_ChangeBitmapHue

L_ChangeBitmapSaturation

L_ChannelMix

L_ConvertColorSpace

L_ColorIntensityBalance

L_ColorizeGrayBitmap

L_ContBrightIntBitmap

L_ChangeHueSatIntBitmap

L_ColorReplaceBitmap

L_ColorThresholdBitmap

L_ColorMergeBitmap

L_ColorLevelBitmap

L_ColorSeparateBitmap

L_ConvertToColoredGray

L_DesaturateBitmap

L_DigitalSubtractBitmap

L_FunctionalLightBitmap

L_InvertBitmap

L_MathFunctionBitmap

L_MultiScaleEnhancementBitmap

L_ReadFileTransforms

L_RemapBitmapHue

L_RemoveRedeyeBitmap

L_SegmentBitmap

L_SampleTargetBitmap

L_SelectBitmapData

L_ShiftBitmapData

L_SwapColors

L_WriteFileTransforms

For filtering:

L_DynamicBinaryBitmap

L_GaussianFilterBitmap

L_HighPassFilterBitmap

L_IntensityDetectBitmap

L_ReadFileTransforms

L_SegmentBitmap

L_UserFilterBitmap

L_WriteFileTransforms

For low-level manipulation:

L_DeinterlaceBitmap

L_RemapBitmapHue

L_RemapBitmapIntensity

For Special Effects:

L_ColoredBallsBitmap

L_DiffuseGlowBitmap

L_ColoredPencilBitmap

L_LensFlareBitmap

See Also

Changing Brightness and Contrast

Correcting Colors


Raster Image Functions: Processing an Image

Raster Image Functions:
Processing an Image

L_AddBorder

L_AddFrame

L_AlphaBlendBitmap

L_BricksTextureBitmap

L_BumpMapBitmap

L_CanvasBitmap

L_ColorMergeBitmap

L_ColorSeparateBitmap

L_CombineBitmapExt

L_CombineBitmap

L_CombineBitmapWarp

L_ConvertColorSpace

L_CorrelationBItmap

L_CorrelationListBitmap

L_CreateFadedMask

L_CreateLeadDC

L_DeskewBitmapExt (Document/Medical only)

L_DeskewBitmap

L_DigitalSubtractBitmap

L_DisplaceMapBitmap

L_FeatherAlphaBlendBitmap

L_FlipBitmap

L_GetMinMaxBits (Medical only)

L_GetMinMaxVal (Medical only)

L_PerspectiveBitmap

L_PicturizeBitmap

L_PicturizeBitmapList

L_PicturizeBitmapSingle

L_ReverseBitmap

L_RotateBitmap

L_SizeBitmap

L_SliceBitmap

L_TextureAlphaBlendBitmap

L_TransformFile

L_TransformFile

L_UnderlayBitmap

L_WindowLevelBitmap (Medical only)

L_WindowLevelFillLUT (Medical only)

L_WindowLevel (Medical only)

LEADMARKERCALLBACK

TRANSFORMFILECALLBACK


Raster Image Functions: Removing Noise

Raster Image Functions:
Removing Noise

L_AddBitmaps

L_AddWeightedBitmaps

L_AllocFTArray

L_AutoBinaryBitmap [Document/Medical only]

L_AverageFilterBitmap

L_BinaryFilterBitmap [Document/Medical only]

L_CombineBitmap [Document/Medical only]

L_DeinterlaceBitmap

L_DespeckleBitmap [Document/Medical only]

L_DFTBitmap

L_DynamicBinaryBitmap

L_FFTBitmap

L_FragmentBitmap

L_FreeFTArray

L_FrqFilterBitmap

L_FrqFilterMaskBitmap

L_FTDisplayBitmap

L_GaussianFilterBitmap

L_HighPassFilterBitmap

L_MaxFilterBitmap [Document/Medical only]

L_MedianFilterBitmap

L_MinFilterBitmap [Document/Medical only]

L_SmoothEdgesBitmap

L_UnsharpMaskBitmap


Raster Image Functions: Using Histograms

Raster Image Functions:
Image Processing
Using Histograms

L_GetBitmapHistogram

L_GetBitmapHistogramGray

L_HistoContrastBitmap

L_HistoEqualizeBitmap

See Also

Changing Brightness and Contrast


Raster Image Functions: Using the Alpha Channel

Raster Image Functions:
Image Processing
Using the Alpha Channel

L_CreateMaskFromBitmapRgn

L_GetBitmapAlpha

L_SetBitmapAlpha

L_SetBitmapRgnFromMask

See Also

Implementing Transparency


Raster Image Functions: Working with Color Halftones

Raster Image Functions:
Working with Color Halftones

Creating and working with color halftones

L_AutoColorLevelBitmap

L_ChannelMix

L_ColorLevelBitmap

L_ColorMergeBitmap

L_ColorSeparateBitmap

L_ConvertColorSpace

L_ColorHalfToneBitmap

L_HistoContrastBitmap

L_HistoEqualizeBitmap

L_SelectiveColorBitmap

L_SelectBitmapData (Document/Medical only)

L_ShiftBitmapData (Document/Medical only)

Creating and working with halftone images

L_DefaultDithering

L_HalfToneBitmap

L_HalfTonePatternBitmap

Creating and working with grayscale images

L_ColorizeGrayBitmap

L_ConvertToColoredGray

L_DesaturateBitmap

L_GetBitmapAlpha

L_GrayScaleBitmap

L_GrayScaleBitmapExt

L_GrayScaleToDuotone

L_GrayScaleToMultitone

L_IsGrayScaleBitmap

L_SelectBitmapData (Document/Medical only)

L_ShiftBitmapData (Document/Medical only)

Changing the Highlight pen and Cursor Style (Document/Medical only)

L_AnnSetAutoCursor

L_AnnSetAutoHilightPen

Getting information about grayscale images

L_GetMinMaxBits (Document/Medical only)

L_GetMinMaxVal (Document/Medical only)

L_GetBitmapHistogramGray (Document/Medical only)

L_IsGrayScaleBitmap

Getting information about color images

L_GetBitmapColorCount

L_GetBitmapColors

L_GetBitmapHistogram

L_GetBitmapStatisticsInfo

Window leveling (Document/Medical only)

L_GetMinMaxBits

L_GetMinMaxVal

L_WindowLevel

L_WindowLevelBitmap

L_WindowLevelFillLUT


Raster Image Functions: Input and Output

Raster Image Functions:
Input and Output

Capturing a Screen Image

Compression Functions

Converting Files

Getting and Setting File Information

Input/Output File Filters

Loading and Saving Stamp Images

Loading Files

Low-Level DeCompression Functions

Maintaining File Comments and Tags

Markers

Rasterizing Files

Redirecting Input and Output

Saving Files

Scanning Images using ISIS

Scanning Images using Twain

Using the Thumbnail Browser


Raster Image Functions: Capturing a Screen Image

Raster Image Functions:
Input and Output
Capturing a Screen Image

L_ScreenCaptureBitmap


Raster Image Functions: Compression Functions

Raster Image Functions:
Input and Output
Compression Functions

High-Level Functions

L_ChangeBitmapCompression

For LEAD and JPEG Compression:

L_CompressBuffer

L_EndCompressBuffer

L_StartCompressBuffer

For 1-Bit RLE-Compressed Bitmaps (Document/Medical only):

L_ChangeBitmapCompression

L_CompressRow

L_CompressRows

L_ExpandRow

L_ExpandRows

L_GetBitmapRowColCompressed

L_GetBitmapRowCompressed

L_PutBitmapRowColCompressed

L_PutBitmapRowCompressed

Super Compressed Bitmaps

L_ChangeBitmapCompression

ABIC Compression:

L_EncodeABIC

L_DecodeABIC


Raster Image Functions: Converting Files

Raster Image Functions:
Input and Output
Converting Files

L_FileConvert


Raster Image Functions: Getting and Setting File Information

Raster Image Functions:
Input and Output
Getting and Setting File Information

Getting information:

L_FileInfo

L_FileInfoMemory

L_ExtractMessageFromBitmap

L_FreeExtensions

L_GetExtensionAudio

L_GetLoadResolution

L_GetPCDResolution

L_GetSaveResolution

L_GetWMFResolution

L_LoadExtensionStamp

L_ReadFileExtensions

L_ReadFileTransforms

L_ReadLoadResolutions

Setting information:

L_AddMessageToBitmap

L_SetLoadInfoCallback

L_SetLoadResolution

L_SetPCDResolution

L_SetSaveResolution

L_SetWMFResolution

L_WriteFileCommentExt

L_WriteFileTransforms


Raster Image Functions: Input/Output File Filters

Raster Image Functions:
Input and Output
Input/Output File Filters

L_GetPDFInitDir

L_IgnoreFilters

L_PreLoadFilters

L_SetPDFInitDir


Raster Image Functions: Loading and Saving Stamp Images

Raster Image Functions:
Input and Output
Loading and Saving Stamp Images

L_CompressBitmapWithStamp

L_GetCompressFileStamp

L_ReadFileStamp

L_WriteFileStamp


Raster Image Functions: Loading Files

Raster Image Functions:
Input and Output
Loading Files

Getting information before loading:

L_FileInfo

L_FileInfoMemory

L_ReadFileTransforms

Optional settings before loading:

L_GetDefaultLoadFileOption

L_GetDJVOptions

L_SetDJVOptions

L_GetLoadInfoCallbackData

L_SetLoadInfoCallback

L_GetLoadResolution

L_ReadLoadResolutions

L_SetLoadResolution

L_GetPCDResolution

L_SetPCDResolution

L_GetPDFOptions

L_SetPDFOptions

L_GetWMFResolution

L_SetWMFResolution

L_GetPLTOptions

L_SetPLTOptions

L_GetPTKOptions

L_SetPTKOptions

L_GetRTFOptions

L_SetRTFOptions

L_GetAutoCADFilesColorScheme

L_SetAutoCADFilesColorScheme

L_GetTXTOptions

L_SetTXTOptions

Alternatives to load from a file on a disk:

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapResize

L_LoadFile

L_LoadFileCMYKArray

L_LoadFileOffset

L_LoadFileTile

L_LoadLayer

Alternatives to load from a file in memory:

L_DecompressBitmapMemory

L_DecompressMemory

L_LoadBitmapMemory

L_LoadMemory

Where you supply the image data to load:

L_ChangeBitmapHeight

L_FeedLoad

L_StartFeedLoad

L_StopFeedLoad

L_LoadFileCMYKArray

Loading Overlay Files

L_GetOverlayCallback

L_SetOverlayCallback

OVERLAYCALLBACK

Loading Embedded ICC Profiles

L_FreeICCProfile

L_InitICCProfile

L_LoadICCProfile

Compacting TIFF Files

L_CompactFile

Loading Corrupted Files

L_GetLoadStatus


Raster Image Functions: Low-Level Decompression Functions

Raster Image Functions:
Input and Output
 Low-Level Decompression Functions

L_DecompressBuffer

L_StartDecompressBuffer

L_StopDecompressBuffer


Raster Image Functions: Maintaining File Comments and Tags

Raster Image Functions:
Input and Output
Maintaining File Comments and Tags

For the comment to be saved:

L_GetComment

L_SetComment

L_WriteFileComment

For the comment in an existing file:

L_ReadFileComment

L_ReadFileCommentMemory

L_ReadFileCommentOffset

L_WriteFileCommentExt

For the TIFF tag to be saved:

L_GetTag

L_SetTag

L_WriteFileTag

For the TIFF tag in an existing file:

L_EnumFileTags

L_ReadFileTag

L_ReadFileTagMemory

L_WriteFileTag

For the FlashPix Comments:

L_GetFileCommentSize

L_ReadFileComment

L_ReadFileCommentExt

L_SetComment

L_WriteFileCommentExt


Raster Image Functions: Markers

Raster Image Functions:
Input and Output
Markers

L_CopyMarkers

L_CreateMarkers

L_DeleteMarker

L_EnumMarkers

L_FreeMarkers

L_GetMarker

L_GetMarkerCount

L_GetMarkers

L_InsertMarker

L_LoadMarkers

L_SetMarkers

L_WriteFileMetaData


Raster Image Functions: Rasterizing Files

Raster Image Functions:
Input and Output
Rasterizing Files

L_2DGetViewMode

L_2DgetViewport

L_2DSetViewMode

L_2DSetViewport


Raster Image Functions: Redirecting Input and Output

Raster Image Functions:
Input and Output
Redirecting Input and Output

L_RedirectIO


Raster Image Functions: Saving Files

Raster Image Functions:
Input and Output
Saving Files

Optional settings before saving:

L_GetDefaultSaveFileOption

L_GetComment

L_GetDefaultJ2Koptions

L_GetJ2Koptions

L_GetJBIG2Options

L_GetPDFSaveOptions

L_GetSaveResolution

L_GetTag

L_SetComment

L_SetJ2Koptions

L_SetJBIG2Options

L_SetPDFSaveOptions

L_SetSaveResolution

L_SetTag

Alternatives to save a file on disk:

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapWithLayers

L_SaveFile

L_SaveFileCMYKArray

L_SaveFileOffset

L_SaveFileTile

Functions for saving a file in memory:

L_SaveBitmapBuffer

L_SaveBitmapMemory

L_SaveBitmapWithLayers

L_SaveFileBuffer

L_SaveFileMemory

Optional settings after saving:

L_WriteFileStamp

L_WriteFileTransforms

Compacting TIFF Files

L_CompactFile


Raster Image Functions: Scanning Images using ISIS

Raster Image Functions:
Input and Output
Scanning Images using ISIS

L_ISISAcquire ( Document/Medical only)

L_ISISAcquireMulti ( Document/Medical only)

L_ISISGetTagASCII ( Document/Medical only)

L_ISISGetTagASCIIChoice ( Document/Medical only)

L_ISISGetTagLong ( Document/Medical only)

L_ISISGetTagLongChoice ( Document/Medical only)

L_ISISGetTagShort ( Document/Medical only)

L_ISISGetTagShortChoice ( Document/Medical only)

L_IsISISAvailable ( Document/Medical only)

L_ISISLoadDriver ( Document/Medical only)

L_ISISSelect ( Document/Medical only)

L_ISISSetScanOptions ( Document/Medical only)

L_ISISSetTagASCII ( Document/Medical only)

L_ISISSetTagLong ( Document/Medical only)

L_ISISSetTagShort ( Document/Medical only)

L_ISISUnloadDriver ( Document/Medical only)


Raster Image Functions: Scanning Images using Twain

Raster Image Functions:
Input and Output
Scanning Images using Twain

For information on Scanning using TWAIN, refer to the Lttwndlln.chm file in the LEADTOOLS/HELP folder, where "LEADTOOLS" represents the folder in which you installed the toolkit.


Raster Image Functions: Using the Thumbnail Browser

Raster Image Functions:
Input and Output
Using the Thumbnail Browser

BROWSEDIRCALLBACK

L_BrowseDir

L_CreateThumbnailFromFile


Raster Image Functions: Palettes

Raster Image Functions:
Palettes

Implementing palettes:

L_CopyBitmapPalette

L_CreatePaintPalette

L_DupPalette

L_GetBitmapColors

L_GetFixedPalette

L_IsGrayScaleBitmap

L_PutBitmapColors

L_TranslateBitmapColor

Implementing window leveling:

Note: This topic is for Document/Medical edition only.

L_GetMinMaxBits

L_GetMinMaxVal

L_WindowLevel

L_WindowLevelBitmap

L_WindowLevelFillLUT


Raster Image Functions: Region Processing

Raster Image Functions:
Region Processing

Creating and Using a Region

Displaying a Region

Functions That Transform the Region and the Bitmap

Functions Where the Region Preempts the Bitmap


Raster Image Functions: Creating and Using a Region

Raster Image Functions:
Region Processing
Creating and Using a Region

For creating a region:

L_SetBitmapRgnBorder

L_SetBitmapRgnColor

L_SetBitmapRgnColorHSVRange

L_SetBitmapRgnColorRGBRange

L_SetBitmapRgnCurve

L_SetBitmapRgnEllipse

L_SetBitmapRgnFromMask

L_SetBitmapRgnHandle

L_SetBitmapRgnMagicWand

L_SetBitmapRgnPolygon

L_SetBitmapRgnRect

L_SetBitmapRgnRoundRect

L_SliceBitmap

L_SetKaufmannRgnBitmap

For working with the current region:

L_BitmapHasRgn

L_ColorBitmapRgn

L_CreateMaskFromBitmapRgn

L_FrameBitmapRgn

L_FreeBitmapRgn

L_GetBitmapClipSegments

L_GetBitmapClipSegmentsMax

L_GetBitmapRgnArea

L_GetBitmapRgnBounds

L_GetBitmapRgnHandle

L_GetRgnContourPoints

L_GetRgnPerimeterLength

L_HolesRemovalBitmapRgn

L_IsPtInBitmapRgn

L_OffsetBitmapRgn

L_SetBitmapRgnCurve

See Also

Implementing Transparency

L_ResizeBitmapRgn


Raster Image Functions: Displaying a Region

Raster Image Functions:
Region Processing
Displaying a Region

L_FrameBitmapRgn

L_PaintRgnDC

L_PaintRgnDCBuffer

L_PaintRgnDCEffect

See Also

Implementing Transparency


Raster Image Functions: Functions Where the Region Preempts the Bitmap

Raster Image Functions:
Region Processing
Functions Where the Region Preempts the Bitmap

If a bitmap has a region, the following functions act on the region, not on the whole bitmap. To determine whether a bitmap has a region, use the L_BitmapHasRgn function. To remove a bitmap region so that these functions act on the bitmap, use the L_FreeBitmapRgn function.

L_AddBitmapNoise

L_AutoBinaryBitmap

L_AutoColorLevelBitmap

L_AverageFilterBitmap

L_BendingBitmap

L_BinaryFilterBitmap

L_ChangeBitmapContrast

L_ChangeBitmapHue

L_ChangeBitmapIntensity

L_ChangeBitmapSaturation

L_ChannelMix

L_ClearBitmap

L_CloudsBitmap

L_ColoredBallsBitmap

L_ColorHalfToneBitmap

L_ColorizeGrayBitmap

L_ColorLevelBitmap

L_CombineBitmap

L_ContBrightIntBitmap

L_CorrelationListBitmap

L_CylindricalBitmap

L_DespeckleBitmap

L_DiceEffectBitmap

L_DiffuseGlowBitmap

L_DigitalSubtractBitmap

L_DisplaceMapBitmap

L_DrawStarBitmap

L_DryBitmap

L_EmbossBitmap

L_FillBitmap

L_FragmentBitmap

L_FreeHandWaveBitmap

L_FreePlaneBendBitmap

L_FreeRadBendBitmap

L_GammaCorrectBitmap

L_GetBitmapColorCount

L_GetBitmapHistogramGray

L_GetBitmapHistogram

L_GetPixelColor

L_GlassEffectBitmap

L_HalfTonePatternBitmap

L_HighPassFilterBitmap

L_HistoContrastBitmap

L_HistoEqualizeBitmap

L_IntensityDetectBitmap

L_InvertBitmap

L_LightBitmap

L_MaxFilterBitmap

L_MedianFilterBitmap

L_MinFilterBitmap

L_MosaicBitmap

L_MosaicTilesBitmap

L_MultiScaleEnhancementBitmap

L_OceanBitmap

L_OilifyBitmap

L_PerspectiveBitmap

L_PixelateBitmap

L_PlaneBendBitmap

L_PlaneBitmap

L_PointillistBitmap

L_PolarBitmap

L_PosterizeBitmap

L_PunchBitmap

L_PutPixelColor

L_PuzzleEffectBitmap

L_RadialBlurBitmap

L_RadWaveBitmap

L_RemapBitmapIntensity

L_RingEffectBitmap

L_RippleBitmap

L_RomanMosaicBitmap

L_SelectBitmapData

L_SelectiveColorBitmap

L_SharpenBitmap

L_ShiftBitmapData

L_SkeletonBitmap

L_SolarizeBitmap

L_SpatialFilterBitmap

L_SpherizeBitmap

L_StretchBitmapIntensity

L_SwirlBitmap

L_VignetteBitmap

L_WaveBitmap

L_ZigZagBitmap

L_ZoomBlurBitmap

L_ZoomWaveBitmap

Related Topics:

Saving a Region


Raster Image Functions: Functions That Transform the Region and the Bitmap

Raster Image Functions:
Region Processing
Functions That Transform the Region and the Bitmap

L_AutoTrimBitmap

L_ChangeBitmapViewPerspective

L_ContourFilterBitmap

L_FlipBitmap

L_ResampleBitmap

L_ReverseBitmap

L_RotateBitmap

L_RotateBitmapFine

L_RotateBitmapViewPerspective

L_ShearBitmap

L_SizeBitmap

L_TrimBitmap

Related Topics:

Saving a Region


Raster Image Functions: Registered Class

Raster Image Functions:
Registered Class

L_UseBitmapClass


Annotation Functions (Document/Medical only): Global Properties

Annotation Functions (Document/Medical only):
Global Properties

L_AnnGetUserMode

L_AnnGetWnd

L_AnnSetUserMode

L_AnnSetWnd


Annotation Functions (Document/Medical only): Grouping and Ungrouping Objects

Annotation Functions (Document/Medical only):
Object Properties
 Grouping and Ungrouping Objects

L_AnnGetGrouping

L_AnnGroup

L_AnnSetGrouping

L_AnnUngroup


Annotation Functions (Document/Medical only): Hyperlinks

Annotation Functions (Document/Medical only):
Hyperlinks

L_AnnGetHyperlink

L_AnnGetHyperlinkLen

L_AnnGetHyperlinkMenuEnable

L_AnnSetHyperlink

L_AnnSetHyperlinkMenuEnable


Annotation Functions (Document/Medical only): Object Information

Annotation Functions (Document/Medical only):
Object Information

L_AnnEnumerate

L_AnnGetAngle

L_AnnGetArea

L_AnnGetAutoBackColor

L_AnnGetBitmap

L_AnnGetContainer

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetItem

L_AnnGetNodes

L_AnnGetObjectFromTag

L_AnnGetOptions

L_AnnGetPredefinedMetafile

L_AnnGetProtractorOptions

L_AnnGetRgnHandle

L_AnnGetROP2

L_AnnGetSecondaryBitmap

L_AnnGetSelected

L_AnnGetSelectRect

L_AnnGetShowFlags

L_AnnGetTextOptions

L_AnnGetTopContainer

L_AnnGetTransparent

L_AnnGetTransparentColor

L_AnnGetType

L_AnnHitTest


Annotation Functions (Document/Medical only): Realizing to a Bitmap

Annotation Functions (Document/Medical only):
Realizing to a Bitmap

L_AnnRealize

L_AnnUnrealize


Annotation Functions (Document/Medical only): Security

Annotation Functions (Document/Medical only):
Security

L_AnnGetLocked

L_AnnLock

L_AnnSetUser

L_AnnShowLockedIcon

L_AnnUnlock


Annotation Functions (Document/Medical only): Automation

Annotation Functions (Document/Medical only):
Automation

Implementing Automation

Working with the Toolbar

Creating Custom Annotations


Annotation Functions (Document/Medical only): Implementing Automation

Annotation Functions (Document/Medical only):
Automation
Implementing Automation

Creating the automation object:

L_AnnCreate

L_AnnCreateItem

Setting initial automation properties:

L_AnnGetActiveState

L_AnnGetAutoBackColor

L_AnnGetAutoContainer

L_AnnGetAutoDialogFontSize

L_AnnGetAutoDrawEnable

L_AnnGetAutoMenuEnable

L_AnnGetAutoSnapCursor

L_AnnGetAutoOptions

L_AnnGetBitmapDpiX

L_AnnGetBitmapDpiY

L_AnnGetDpiX

L_AnnGetDpiY

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetOptions

L_AnnGetTextOptions

L_AnnSetActiveState

L_AnnSetAutoBackColor

L_AnnSetAutoContainer

L_AnnSetAutoDialogFontSize

L_AnnSetAutoDrawEnable

L_AnnSetAutoMenuEnable

L_AnnSetAutoSnapCursor

L_AnnSetAutoOptions

L_AnnSetBitmapDpiX

L_AnnSetBitmapDpiY

L_AnnSetDpiX

L_AnnSetDpiY

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetOptions

L_AnnSetTextOptions

L_AnnSetUndoDepth

Using automation:

L_AnnGetTool

L_AnnSetTool

Undoing automation operations

L_AnnAddUndoNode

L_AnnGetAutoUndoEnable

L_AnnSetAutoUndoEnable

L_AnnUndo

Modifying automated text strings:

L_AnnGetAutoText

L_AnnGetAutoTextLen

L_AnnSetAutoText

Modifying automation cursors:

L_AnnGetAutoCursor

L_AnnSetAutoCursor

Modifying the automation highlight color:

L_AnnSetAutoHilightPen

Modifying the menu

L_AnnGetAutoMenuItemEnable

L_AnnGetAutoMenuState

L_AnnSetAutoMenuItemEnable

L_AnnSetAutoMenuState


Annotation Functions (Document/Medical only): Working with the Toolbar

Annotation Functions (Document/Medical only):
Automation
Working with the Toolbar

L_AnnCreateToolBar

L_AnnFreeToolBarButtons

L_AnnGetToolBarButtons

L_AnnGetToolBarButtonVisible

L_AnnGetToolBarChecked

L_AnnGetToolBarInfo

L_AnnSetToolBarButtons

L_AnnSetToolBarButtonVisible

L_AnnSetToolBarChecked

L_AnnSetToolBarColumns

L_AnnSetToolBarRows


Annotation Functions (Document/Medical only): Creating Custom Annotations

Annotation Functions (Document/Medical only):
Automation
Creating Custom Annotations

L_AnnAddUserHandle

L_AnnAdjustPoint

L_AnnChangeUserHandle

L_AnnConvert

L_AnnDefine2

L_AnnDefine

L_AnnDeleteUserHandle

L_AnnEnumerateHandles

L_AnnGetOptions

L_AnnGetRestrictToContainer

L_AnnGetUserHandle

L_AnnGetUserHandles

L_AnnHitTestExt

L_AnnRestrictCursor

L_AnnSetOptions

L_AnnSetRestrictToContainer

WM_LTANNEVENT

ANNMOUSEPOS


Annotation Functions (Document/Medical only): Creation, Deletion, and Copying

Annotation Functions (Document/Medical only):
Creation, Deletion, and Copying

Copying Annotations

Creating and Deleting Annotations

Using the Clipboard


Annotation Functions (Document/Medical only): Copying Annotations

Annotation Functions (Document/Medical only):
Creation, Deletion, and Copying
Copying Annotations

L_AnnCopy


Annotation Functions (Document/Medical only): Creating and Deleting Annotations

Annotation Functions (Document/Medical only):
Creation, Deletion, and Copying
Creating and Deleting Annotations

High-level creation:

L_AnnCreateContainer

L_AnnCreateItem

L_AnnDefine

Creation, insertion, and removal:

L_AnnCreate

L_AnnInsert

L_AnnRemove

Cut:

L_AnnCutToClipboard

Deletion:

L_AnnDestroy

Custom:

L_AnnAddUserHandle

L_AnnAdjustPoint

L_AnnChangeUserHandle

L_AnnConvert

L_AnnDefine2

L_AnnDeleteUserHandle

L_AnnEnumerateHandles

L_AnnGetRestrictToContainer

L_AnnGetRotateAngle

L_AnnGetUserHandle

L_AnnGetUserHandles

L_AnnHitTestExt

L_AnnRestrictCursor

L_AnnSetRestrictToContainer


Annotation Functions (Document/Medical only): Using the Clipboard

Annotation Functions (Document/Medical only):
Creation, Deletion, and Copying
Using the Clipboard

L_AnnClipboardReady

L_AnnCopyFromClipboard

L_AnnCopyToClipboard

L_AnnCutToClipboard

L_AnnSetBitmapDpiX

L_AnnSetBitmapDpiY


Annotation Functions (Document/Medical only): Displaying and Printing

Annotation Functions (Document/Medical only):
Displaying and Printing

Displaying Annotations

Printing Annotations


Annotation Functions (Document/Medical only): Displaying Annotations

Annotation Functions (Document/Medical only):
Displaying and Printing
Displaying Annotations

L_AnnBringToFront

L_AnnDraw

L_AnnGetAutoCursor

L_AnnGetAutoSnapCursor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetOptions

L_AnnGetROP2

L_AnnGetTextOptions

L_AnnGetTransparent

L_AnnGetTransparentColor

L_AnnSendToBack

L_AnnSetAutoCursor

L_AnnSetAutoSnapCursor

L_AnnSetAutoHilightPen

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetOptions

L_AnnSetROP2

L_AnnSetTextOptions

L_AnnSetTransparent

L_AnnSetTransparentColor


Annotation Functions (Document/Medical only): Printing Annotations

Annotation Functions (Document/Medical only):
Displaying and Printing
Printing Annotations

L_AnnPrint


Annotation Functions (Document/Medical only): Input and Output

Annotation Functions (Document/Medical only):
Input and Output

Deleting Pages from an Annotation File

Getting Annotation File Information

Loading Annotation Files

Saving Annotation Files


Annotation Functions (Document/Medical only): Deleting Pages from an Annotation File

Annotation Functions (Document/Medical only):
Input and Output
 Deleting Pages from an Annotation File

L_AnnDeletePage

L_AnnDeletePageMemory

L_AnnDeletePageOffset


Annotation Functions (Document/Medical only): Getting Annotation File Information

Annotation Functions (Document/Medical only):
Input and Output
 Getting Annotation File Information

L_AnnFileInfo

L_AnnFileInfoMemory

L_AnnFileInfoOffset

L_AnnGetOptions

L_AnnSetOptions


Annotation Functions (Document/Medical only): Loading Annotation Files

Annotation Functions (Document/Medical only):
Input and Output
Loading Annotation Files

L_AnnLoad

L_AnnLoadMemory

L_AnnLoadOffset


Annotation Functions (Document/Medical only): Saving Annotation Files

Annotation Functions (Document/Medical only):
Input and Output
Saving Annotation Files

L_AnnSave

L_AnnSaveMemory

L_AnnSaveOffset

L_AnnSaveTag


Annotation Functions (Document/Medical only): Object Properties

Annotation Functions (Document/Medical only):
Object Properties

General Properties

Getting and Setting Color Properties

Getting and Setting Fill Properties

Getting and Setting Font Properties

Getting and Setting the Activation Property

Getting and Setting the Bitmap Property

Getting and Setting the Name Property

Getting and Setting Node Properties

Getting and Setting the Tag Property

Getting and Setting the Visible Property

Getting and Setting the ROP2 Property

Specific Object Properties

Getting and Setting Automation Properties

Getting and Setting Audio Properties

Getting and Setting Button Properties

Getting and Setting Closed Curve Properties

Getting and Setting Container Properties

Getting and Setting Cross product Properties

Getting and Setting Curve Properties

Getting and Setting Ellipse Properties

Getting and Setting Encrypt Properties

Getting and Setting Freehand Hotspot Properties

Getting and Setting Freehand Line Properties

Getting and Setting Highlight Properties

Getting and Setting Hotspot Properties

Getting and Setting Line Properties

Getting and Setting Note Properties

Getting and Setting the Object Metafile Property

Getting and Setting Point Properties

Getting and Setting Pointer Properties

Getting and Setting Polygon Properties

Getting and Setting Polyline Properties

Getting and Setting Polyruler Properties

Getting and Setting Protractor Properties

Getting and Setting Push Pin Properties

Getting and Setting Rubber Stamp Properties

Getting and Setting Rectangle Properties

Getting and Setting Redaction Properties

Getting and Setting Rich Text Properties

Getting and Setting Ruler Properties

Getting and Setting Stamp Properties

Getting and Setting Text Properties

Getting and Setting Text Pointer Properties

Getting and Setting the Fixed Property

Getting and Setting the Rotation Options

Getting and Setting the Alpha Property

Getting and Setting the Transparency Property

Getting and Setting Video Properties


Annotation Functions (Document/Medical only): Getting and Setting Color Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Color Properties

L_AnnGetAutoBackColor

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetForeColor

L_AnnGetOptions

L_AnnGetROP2

L_AnnGetTextOptions

L_AnnGetTransparent

L_AnnGetTransparentColor

L_AnnSetAutoBackColor

L_AnnSetBackColor

L_AnnSetForeColor

L_AnnSetAutoHilightPen

L_AnnSetOptions

L_AnnSetROP2

L_AnnSetTransparent

L_AnnSetTransparentColor


Annotation Functions (Document/Medical only): Getting and Setting Fill Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Fill Properties

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetOptions

L_AnnGetPolyFillMode

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetOptions

L_AnnSetPolyFillMode


Annotation Functions (Document/Medical only): Getting and Setting Font Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Font Properties

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontNameLen

L_AnnGetFontSize

L_AnnGetFontStrikeThrough

L_AnnGetFontUnderline

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikeThrough

L_AnnSetFontUnderline


Annotation Functions (Document/Medical only): Getting and Setting the Activation Property

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Activation Property

L_AnnGetActiveState

L_AnnSetActiveState


Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Object Bitmap Property

L_AnnGetBitmap

L_AnnGetPredefinedBitmap

L_AnnGetSecondaryBitmap

L_AnnSetBitmap

L_AnnSetPredefinedBitmap

L_AnnSetSecondaryBitmap


Annotation Functions (Document/Medical only): Getting and Setting the Name Property

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Name Property

L_AnnGetNameOptions

L_AnnSetNameOptions


Annotation Functions (Document/Medical only): Getting and Setting Node Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Node Properties

L_AnnGetNodes

L_AnnSetNodes


Annotation Functions (Document/Medical only): Getting and Setting the ROP2 Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the ROP2 Property

L_AnnSetROP2

L_AnnGetROP2


Annotation Functions (Document/Medical only): Getting and Setting the Tag Property

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Tag Property

L_AnnGetTag

L_AnnSetTag


Annotation Functions (Document/Medical only): Getting and Setting the Visible Property

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Visible Property

L_AnnGetVisible

L_AnnSetVisible


Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Alpha Property

L_AnnGetFillModeExt

L_AnnGetOptions

L_AnnSetFillModeExt

L_AnnSetOptions


Annotation Functions (Document/Medical only): Getting and Setting Audio Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Audio Properties

L_AnnGetActiveState

L_AnnGetFixed

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetText

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetActiveState

L_AnnSetFixed

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetText

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Button Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Button Properties

L_AnnGetActiveState

L_AnnGetFillModeExt

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetTextOptions

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetActiveState

L_AnnSetFillModeExt

L_AnnSetFillMode

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetTextOptions

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Closed Curve Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Closed Curve Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPoints

L_AnnGetPolyFillMode

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPoints

L_AnnSetPolyFillMode

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Container Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Container Properties

L_AnnCreateContainer

L_AnnDefine

L_AnnDefine2

L_AnnGetAutoContainer

L_AnnGetBackColor

L_AnnGetContainer

L_AnnGetDistance

L_AnnGetDistance2

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetForeColor

L_AnnGetGrouping

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetOptions

L_AnnGetRestrictToContainer

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextOptions

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetAutoContainer

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetOptions

L_AnnSetRestrictToContainer

L_AnnSetSelected

L_AnnSetShowFlags

L_AnnSetTag

L_AnnSetTextOptions

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Cross product Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Cross product Properties

L_AnnCalibrateRuler

L_AnnGetBackColor

L_AnnGetDistance2

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetROP2

L_AnnGetSelected

L_AnnGetShowFlags

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetROP2

L_AnnSetSelected

L_AnnSetShowFlags

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Curve Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Curve Properties

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetPoints

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetPoints

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Ellipse Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Ellipse Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Encrypt Properties

Annotation Functions (Document/Medical only):
Getting and Setting Encrypt Properties

L_AnnEncryptApply

L_AnnGetBackColor

L_AnnGetEncryptOptions

L_AnnGetFillMode

L_AnnGetFillPattern

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetMetafile

L_AnnGetNameOptions

L_AnnGetSecondaryMetafile

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetEncryptOptions

L_AnnSetFillPattern

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetMetafile

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd

L_ScrambleBitmap


Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Fixed Property

L_AnnGetFixed

L_AnnSetFixed

L_AnnPushFixedState

L_AnnPopFixedState

L_AnnIsFixedInRect


Annotation Functions (Document/Medical only): Getting and Setting Freehand Hot Spot Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Freehand Hot Spot Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetNodes

L_AnnGetPoints

L_AnnGetROP2

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetNodes

L_AnnSetPoints

L_AnnSetROP2

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Freehand Line Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Freehand Line Properties

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Highlight Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Highlight Properties

L_AnnGetBackColor

L_AnnGetFixed

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFixed

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Hot Spot Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Hot Spot Properties

L_AnnGetActiveState

L_AnnGetFixed

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetActiveState

L_AnnSetFixed

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Line Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Line Properties

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Note Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Note Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Object Metafile Property

L_AnnGetMetafile

L_AnnGetPredefinedMetafile

L_AnnGetSecondaryMetafile

L_AnnSetMetafile

L_AnnSetPredefinedMetafile


Annotation Functions (Document/Medical only): Getting and Setting Point Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Point Properties

L_AnnGetBitmap

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetNameOptions

L_AnnGetPoints

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTransparent

L_AnnGetTransparentColor

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBitmap

L_AnnSetBackColor

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetNameOptions

L_AnnSetPoints

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTransparent

L_AnnSetTransparentColor

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Pointer Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Pointer Properties

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Polygon Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Polygon Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPolyFillMode

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPolyFillMode

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Polyline Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Polyline Properties

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetPoints

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetPoints

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Polyruler Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Polyruler Properties

L_AnnCalibrateRuler

L_AnnGetDistance2

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetGaugeLength

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPoints

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTicMarkLength

L_AnnGetUnit

L_AnnGetVisible

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetGaugeLength

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPoints

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTicMarkLength

L_AnnSetUnit

L_AnnSetVisible


Annotation Functions (Document/Medical only): Getting and Setting Rubber Stamp Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Rubber Stamp Properties

L_AnnGetBackColor

L_AnnGetBitmap

L_AnnGetFillMode

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetMetafile

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPredefinedMetafile

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetBitmap

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetMetafile

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPredefinedMetafile

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting the Protractor Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Protractor Properties

L_AnnGetAngle

L_AnnGetBackColor

L_AnnCalibrateRuler

L_AnnGetDistance2

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetProtractorOptions

L_AnnGetROP2

L_AnnGetSelected

L_AnnGetShowFlags

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetProtractorOptions

L_AnnSetROP2

L_AnnSetSelected

L_AnnSetShowFlags

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting the Push Pin Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Push Pin Properties

L_AnnGetBackColor

L_AnnGetBitmap

L_AnnGetFillMode

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSecondaryBitmap

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetBitmap

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSecondaryBitmap

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Rectangle Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Rectangle Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Redaction Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Redaction Properties

L_AnnGetBackColor

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Rich Text Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Rich Text Properties

L_AnnGetFixed

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextRTF

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetFixed

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextRTF

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting the Rotation Options

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting the Rotation Options

L_AnnGetRotateOptions

L_AnnSetRotateOptions


Annotation Functions (Document/Medical only): Getting and Setting Ruler Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Ruler Properties

L_AnnCalibrateRuler

L_AnnGetBitmapDpiX

L_AnnGetBitmapDpiY

L_AnnGetDistance2

L_AnnGetDistance

L_AnnGetFillModeExt

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetGaugeLength

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetShowFlags

L_AnnGetTag

L_AnnGetUnit

L_AnnGetUnitLen

L_AnnGetVisible

L_AnnSetBitmapDpiX

L_AnnSetBitmapDpiY

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetGaugeLength

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetShowFlags

L_AnnSetUnit


Annotation Functions (Document/Medical only): Getting and Setting the Stamp Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Stamp Properties

L_AnnGetBackColor

L_AnnGetBitmap

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFillPattern

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetLineStyle

L_AnnGetLineWidth

L_AnnGetMetafile

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPredefinedMetafile

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetBitmap

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFillPattern

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetLineStyle

L_AnnSetLineWidth

L_AnnSetMetafile

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPredefinedMetafile

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting Text Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Text Properties

For text in objects:

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextAlign

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetTextLen

L_AnnGetTextOptions

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextAlign

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetTextOptions

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd

For automated menu text:

L_AnnGetAutoText

L_AnnGetAutoTextLen

L_AnnSetAutoText

L_AnnTextEdit

For text token tables

L_AnnClearTextTokenTable

L_AnnDeleteTextTokenTable

L_AnnEnumerateTextTokenTable

L_AnnInsertTextTokenTable


Annotation Functions (Document/Medical only): Getting and Setting Text Pointer Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Text Pointer Properties

L_AnnGetBackColor

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetNameOptions

L_AnnGetOptions

L_AnnGetPoints

L_AnnGetSelected

L_AnnGetTag

L_AnnGetTextAlign

L_AnnGetTextExpandTokens

L_AnnGetText

L_AnnGetTextPointerFixed

L_AnnGetTextRotate

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetNameOptions

L_AnnSetOptions

L_AnnSetPoints

L_AnnSetSelected

L_AnnSetTag

L_AnnSetTextAlign

L_AnnSetTextExpandTokens

L_AnnSetText

L_AnnSetTextPointerFixed

L_AnnSetTextRotate

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Transparency Property

L_AnnGetTransparent

L_AnnGetTransparentColor

L_AnnSetTransparent

L_AnnSetTransparentColor


Annotation Functions (Document/Medical only): Getting and Setting Video Properties

Annotation Functions (Document/Medical only):
Object Properties
Getting and Setting Video Properties

L_AnnGetBackColor

L_AnnGetFillMode

L_AnnGetFixed

L_AnnGetFontBold

L_AnnGetFontItalic

L_AnnGetFontName

L_AnnGetFontSize

L_AnnGetFontStrikethrough

L_AnnGetFontUnderline

L_AnnGetForeColor

L_AnnGetNameOptions

L_AnnGetSelected

L_AnnGetTag

L_AnnGetText

L_AnnGetUserMode

L_AnnGetVisible

L_AnnGetWnd

L_AnnSetBackColor

L_AnnSetFixed

L_AnnSetFontBold

L_AnnSetFontItalic

L_AnnSetFontName

L_AnnSetFontSize

L_AnnSetFontStrikethrough

L_AnnSetFontUnderline

L_AnnSetForeColor

L_AnnSetNameOptions

L_AnnSetSelected

L_AnnSetTag

L_AnnSetText

L_AnnSetUserMode

L_AnnSetVisible

L_AnnSetWnd


Annotation Functions (Document/Medical only): Size, Position, and Shape

Annotation Functions (Document/Medical only):
Size, Position, and Shape

Doing Geometric Transformations

Getting and Setting Geometric Properties

Using Window Coordinates to Define an Object

Using Window Coordinates to Select Objects


Annotation Functions (Document/Medical only): Doing Geometric Transformations

Annotation Functions (Document/Medical only):
Size, Position, and Shape
Doing Geometric Transformations

L_AnnDefine

L_AnnBringToFront

L_AnnFlip

L_AnnMove

L_AnnResize

L_AnnReverse

L_AnnRotate

L_AnnSendToBack


Annotation Functions (Document/Medical only): Getting and Setting Geometric Properties

Annotation Functions (Document/Medical only):
Size, Position, and Shape
Getting and Setting Geometric Properties

Setting up coordinate translations:

L_AnnGetOffsetX

L_AnnGetOffsetY

L_AnnGetScalarX

L_AnnGetScalarY

L_AnnSetOffsetX

L_AnnSetOffsetY

L_AnnSetScalarX

L_AnnSetScalarY

Defining the position and shape of an object:

L_AnnGetPointCount

L_AnnGetPoints

L_AnnGetRect

L_AnnSetPoints

L_AnnSetRect

Getting the window coordinates of an object:

L_AnnGetBoundingRect


Annotation Functions (Document/Medical only): Using Window Coordinates to Define an Object

Annotation Functions (Document/Medical only):
Size, Position, and Shape
Using Window Coordinates to Define an Object

L_AnnDefine


Annotation Functions (Document/Medical only): Using Window Coordinates to Select Objects

Annotation Functions (Document/Medical only):
Size, Position, and Shape
Using Window Coordinates to Select Objects

Selecting all objects in a rectangle:

L_AnnGetSelectCount

L_AnnGetSelectItems

L_AnnSelectRect

Selecting an object at a particular point:

L_AnnSelectPoint

Getting the bounding rectangle of selected objects:

L_AnnGetSelectRect

Identifying an object at a particular point:

L_AnnHitTest

L_AnnSendToBack


Annotation Functions (Document/Medical only): Optimizer

Annotation Functions (Document/Medical only):
Optimizer

Optimizer Optimization Functions

Optimizer Callback Functions


Optimizer: Optimization Functions

Optimizer:
Optimization Functions

L_OptGetDefaultOptions

L_OptOptimizeBuffer

L_OptOptimizeDir


Optimizer: Callback Functions

Optimizer:
Callback Functions

OPTIMIZEBUFFERCALLBACK

OPTIMIZEIMAGEDIRCALLBACK


ICC Profile Functions

Creating an ICC Profile

Tags

Loading an ICC Profile

Saving an ICC Profile

Freeing an ICC Profile


ICC Profile Functions: Creating an ICC Profile

ICC Profile Functions:
Creating an ICC Profile

L_InitICCHeader

L_InitICCProfileExt

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent


ICC Profile Functions: Tags

ICC Profile Functions:
Tags

L_2bFixed2bNumberToDouble

L_CreateICCTagData

L_DeleteICCTag

L_DoubleTo2bFixed2bNumber

L_FreeICCTagType

L_GenerateICCFile

L_GenerateICCPointer

L_GetICCTagData

L_GetICCTagTypeSig

L_SaveICCProfile

L_SetICCTagData


ICC Profile Functions: Loading an ICC Profile

ICC Profile Functions:
Loading an ICC Profile

L_FillICCProfileFromICCFile

L_FillICCProfileStructure

L_InitICCProfileExt

L_LoadICCProfileExt


ICC Profile Functions: Saving an ICC Profile

ICC Profile Functions:
Saving an ICC Profile

L_GenerateICCFile

L_SaveICCProfile


ICC Profile Functions: Freeing an ICC Profile

ICC Profile Functions:
Freeing an ICC Profile

L_FreeICCProfileExt


Support Functions: Callbacks

Support Functions:
Callbacks

Cleaning Up 1-Bit Images callbacks:

BORDERREMOVECALLBACK

DOTREMOVECALLBACK

HOLEPUNCHREMOVECALLBACK

INVERTEDTEXTCALLBACK

LINEREMOVECALLBACK

SMOOTHCALLBACK

Detecting the progress of a function:

L_SetStatusCallBack

STATUSCALLBACK

Retrieving the status callback

L_GetStatusCallBack

Function-specific callbacks:

ANNENUMCALLBACK

ANNENUMHANDLECALLBACK

ANNENUMTEXTTOKENTABLECALLBACK

COLORRESCALLBACK

COMPBUFFCALLBACK

FILEREADCALLBACK

FILESAVECALLBACK

ISISCALLBACK

LEADMARKERCALLBACK

LOADINFOCALLBACK

TRANSFORMFILECALLBACK

Supporting L_RedirectIO:

REDIRECTCLOSE

REDIRECTOPEN

REDIRECTREAD

REDIRECTSEEK

REDIRECTWRITE


Support Functions: Version and License Information

Support Functions:
Version and License Information

L_IsSupportLocked

L_UnlockSupport

L_VersionInfo


Support Functions: LEADTOOLS ImageList Control

Support Functions:
ImageList Control

ImageList Control Messages

L_CreateImageListControl

L_UseImageListControl


Support Functions: Miscellaneous Functions

Low-level conversions

L_CurveToBezier


Possible Flag Values

Processing options. Note that the palette and dithering options are useful only when the resulting bitmap requires a palette (when it is 8 bits per pixel or less). You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:

Value | Meaning
CRF_FIXEDPALETTE | [0x01] Use the fixed palette.
CRF_OPTIMIZEDPALETTE | [0x02] Create an optimized palette.
CRF_BYTEORDERBGR | [0x04] Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRF_BYTEORDERRGB | [0x00] Use RGB color order. This flag only has meaning when going to 16 bits per pixel or higher.
CRF_IDENTITYPALETTE | [0x08] Insert the Windows system palette.
CRF_USERPALETTE | [0x10] Use the palette specified in the pPalette parameter.
CRF_FASTMATCHPALETTE | [0x20] Use a predefined table to speed conversion using your own palette. Refer to L_CreateUserMatchTable.
CRF_NODITHERING | [0x00000000] Use nearest color matching.
CRF_FLOYDSTEINDITHERING | [0x00010000] Use Floyd Stein dithering.
CRF_STUCKIDITHERING | [0x00020000] Use Stucki dithering.
CRF_BURKESDITHERING | [0x00030000] Use Burkes dithering.
CRF_SIERRADITHERING | [0x00040000] Use Sierra dithering.
CRF_STEVENSONARCEDITHERING | [0x00050000] Use Stevenson Arce dithering.
CRF_JARVISDITHERING | [0x00060000] Use Jarvis dithering.
CRF_ORDEREDDITHERING | [0x00070000] Use ordered dithering, which is faster but less accurate than other dithering methods.


L_BM_ADDNOISE

Send this message to add random pixels to an L_BITMAPCLASS window's bitmap. You can specify the percentage of coverage and the color plane.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter specifies the channel. 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.
 | The high order is the percentage of coverage, expressed in tenths of a percent. Valid values are 0 to 1000.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_AVERAGE

Send this message to average filter an L_BITMAPCLASS window's bitmap.

This changes the color of each pixel in a 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.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should specify the dimensions of the neighborhood used to calculate the effect. The value is the length, in pixels, of one side of a square.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_BINARYFLT

(Document/Medical only) Send this message to apply a binary filter to an L_BITMAPCLASS window's bitmap. The predefined filters let you shrink or enlarge black objects in an image.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to a predefined filter. For a list of predefined filters, refer to L_BinaryFilterBitmap.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_BITMAPCHANGED

Send this message to signal a change in an L_BITMAPCLASS window's bitmap without causing the window to repaint.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter is a boolean value that should be true if the size has changed. The high order should be true if the color has changed.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_CLEAR

Send this message to clear an L_BITMAPCLASS window's bitmap, setting all bits to 0 to make it a black bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_COLORRES

Send this message to change the color resolution of an L_BITMAPCLASS window's bitmap. This message provides flexibility in specifying the output destination and in specifying the palette to use.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to a LEADBITMAPCOLORRES structure. For a description, refer to the LEADBITMAPCOLORRES Structure described below.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPCOLORRES Structure

The L_BM_COLORRES message lets you change the bits per pixel of an image in the L_BITMAPCLASS registered class. Before sending the message, your program must declare a LEADBITMAPCOLORRES structure.

The following table describes the fields in the structure, using ColRes as the name of the LEADBITMAPCOLORRES structure.

Sample Field Name | Data Type | Description
ColRes.uStructSize | L_UINT | Size of the LEADBITMAPCOLORRES structure. This field allows for compatibility with future enhancements. It can be specified as follows: ColRes.uStructSize = sizeof(ColRes);
ColRes.BitsPerPixel | L_INT | The number of bits per pixel to increase or decrease the bitmap to. Valid values are 1, 4, 8, 16, 24, and 32.
ColRes.Flags | L_UINT32 | Indicator of the color order or palette usage. Refer to Possible Flag Values .
ColRes.pPalette | LPRGBQUAD | The palette to use if the CRF_USERPALETTE is specified in the Flags field. This is an array of RGBQUAD values. For each item in the array do one of the following: Enter the actual RGBQUAD value to specify a fixed color. Enter RGB_RESERVED to Leave the item blank, for possible later use. Enter RGB_EMPTY to let LEADTOOLS fill in the color. LEADTOOLS supplies optimized colors to fill the RGB_EMPTY items. If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL.
ColRes.Colors | L_UINT | The number of colors in the palette specified by the pPalette field. If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL


L_BM_CONTRAST

Send this message to change the contrast of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the amount to change the contrast. The value should range between -1000 and 1000.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_COPY

Send this message to copy an L_BITMAPCLASS window's bitmap to the clipboard.

Parameter | Meaning
wParam | Reserved. Set to NULL.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_COPYBITMAP

Send this message to copy the bitmap referenced by a LEAD bitmap handle into the L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Specifies a pointer to the LEAD bitmap handle referencing the bitmap to be copied.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_DESKEW

(Document/Medical only) Send this message to rotate an L_BITMAPCLASS window's bitmap to straighten it. This function typically is used to automatically straighten scanned images.

The calculated rotation is limited to 10 degrees in either direction. This message 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.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_DESPECKLE

(Document/Medical only) Send this message to remove speckles from an L_BITMAPCLASS window's bitmap. Typically, this function is used to clean up scanned images (such as FAX images).

This function 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.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_FILL

Send this message to fill an L_BITMAPCLASS window's bitmap with the specified color.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The lParam parameter should contain a COLORREF value, which you can specify using the Windows RGB macro.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

See Also

Topics:

Using Color Values in LEADTOOLS


L_BM_FLIP

Send this message to flip an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_FOCUSEDZOOM

Send this message to zoom in or zoom out, with the ability to center the display at the current mouse position.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to the LEADBITMAPFOCUSEDZOOM structure that specifies the zoom information.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPFOCUSEDZOOM Structure

Before sending the L_BM_FOCUSEDZOOM message, your program must declare a LEADBITMAPFOCUSEDZOOM structure and update its required fields. The following table describes the fields in the structure, using MyZoom as the name of the LEADBITMAPFOCUSEDZOOM structure. )

Sample Field Name | Data Type | Description
MyZoom.uStructSize | L_UINT | Size of the LEADBITMAPFOCUSEDZOOM structure. This field allows for compatibility with future enhancements. It can be specified as follows: MyZoom.uStructSize = sizeof(MyZoom);
MyZoom.Factor | L_UINT | The percentage scale factor. A value of 100 means no zooming.
MyZoom.Center | L_BOOL | TRUE for centering on the current mouse position, or FALSE for maintaining the current display offsets.
MyZoom.XFocus | L_INT | The horizontal mouse coordinate.
MyZoom.YFocus | L_INT | The vertical mouse coordinate.


L_BM_FREE

Send this message to free an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_GAMMACORRECT

Send this message to adjust the intensity of colors in an L_BITMAPCLASS window's 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.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain an 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.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_GETBITMAP

Send this message to an L_BITMAPCLASS window to get a pointer to a LEAD BITMAPHANDLE structure that references the bitmap in memory.

Parameter | Meaning
wParam | Not used.
lParam | Not used.

Returns

> 0 | A pointer to the LEAD bitmap structure.
0 | There is no bitmap loaded to the window.


L_BM_GETPALETTE

Send this message to get an L_BITMAPCLASS window's active palette.

Parameter | Meaning
wParam | Reserved. Set to NULL
lParam | Reserved. Set to NULL.

Returns

The return value's low order word is the handle of the active palette. A NULL indicates that no palette is active.


L_BM_GRAYSCALE

Send this message to change an L_BITMAPCLASS window's bitmap to grayscale.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_HALFTONE

Send this message to halftone an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the type of halftone to perform. Possible values are:
 | HT_PRINT [0] Dither for printing
 | HT_VIEW [1] Dither for display

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_HISTOEQ

Send this message to histogram-equalize an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_HUE

Send this message to change the hue of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the angular amount to change the hue, in degrees.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_INFO

Send this message to get an L_BITMAPCLASS window's bitmap information.

Parameter | Meaning
wParam | Size of buffer to receive the bitmap information.
lParam | Points to a LEADBITMAPINFO structure. For a description, refer to the LEADBITMAPINFO Structure described below.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPINFO Structure

The L_BM_INFO message lets you get information about an image in the L_BITMAPCLASS registered class. Before sending the message, your program must declare a LEADBITMAPINFO structure. (The information in this structure is a simplified subset of the information in the BITMAPHANDLE structure.)

The following table describes the fields in the structure, using MyImage as the name of the LEADBITMAPINFO structure.

Sample Field Name | Data Type | Description
MyImage.uStructSize | L_UINT | Size of the LEADBITMAPINFO structure. This field allows for compatibility with future enhancements. It can be specified as follows: MyImage.uStructSize = sizeof(MyImage);
MyImage.Width | L_INT | Width of the image in pixels.
MyImage.Height | L_INT | Height of the image in pixels.
MyImage.Pixels | L_INT | Number of bits per pixel.


L_BM_INTENSITY

Send this message to change an L_BITMAPCLASS window's bitmap intensity, or brightness.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of lParam should contain the amount to change the intensity. The value should range between -1000 and 1000 from dark to light. The high order word must be set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_INTENSITYDETECT

Send this message to filter an L_BITMAPCLASS window's bitmap to detect colors in a specified intensity range.

Intensity levels range from 0 to 255 for each color plane (red, green, and blue). This function processes each plane separately. If a value falls within the range, it is raised to 255, and if it falls outside the range, it is lowered to 0.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message and specifies the child-window ID.
lParam | The low order of lParam should specify the lowest intensity to detect. The high order word should specify the highest intensity to detect.


L_BM_INVERT

Send this message to invert the colors of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_LOAD

Send this message to load a bitmap file to an L_BITMAPCLASS window.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to a LEADBITMAPLOAD structure. For a description, refer to the LEADBITMAPLOAD Structure described below.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPLOAD Structure

The L_BM_LOAD message lets you load an image file into an L_BITMAPCLASS registered class window. Before sending the message, your program must declare a LEADBITMAPLOAD structure.

The following table describes the fields in the structure, using LoadStruct as the name of the LEADBITMAPLOAD structure.

Sample Field Name | Data Type | Description
LoadStruct.uStructSize | L_UINT | Size of the LEADBITMAPLOAD structure. This field allows for compatibility with future enhancements. It can be specified as follows: LoadStruct.uStructSize = sizeof(LoadStruct);
LoadStruct.Name | L_TCHAR | An 80-character array containing the full path name of the file to load.
LoadStruct.pOptions | pLOADFILEOPTION | Pointer to optional extra load options. Use NULL for defaults.


L_BM_MEDIAN

Send this message to median filter an L_BITMAPCLASS window's bitmap.

This changes the color of each pixel in a bitmap to the median color of pixels in its neighborhood. You control the effect by specifying the size of the neighborhood. This is similar to the L_BM_AVERAGE message, but it is used for noise reduction, rather than a blur effect

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should specify the dimensions of the neighborhood used to calculate the effect. The value is the length, in pixels, of one side of a square.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_MOSAIC

Send this message to apply a mosaic effect to an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should specify the dimensions of the mosaic tile. The value is the length, in pixels, of one side of a square.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_PASTE

Send this message to paste from the clipboard to an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_POSTERIZE

Send this message to posterize an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the number of color levels to use.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_PRINT

Send this message to print an L_BITMAPCLASS window's bitmap.

Use this message with a LEADBITMAPPRINT structure, which lets you position the image on the printed page, and lets you print more than one image on the page.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to a LEADBITMAPPRINT structure. For a description, refer to the LEADBITMAPPRINT structure described below.

Returns

>0 | Function was successful. If the fEndDOC field in the LEADBITMAPPRINT structure is FALSE, the return value is the printer HDC.
0 | An error occurred.

LEADBITMAPPRINT Structure

The L_BM_PRINT message lets you print an image in the L_BITMAPCLASS registered class. Before sending the message, your program must declare a LEADBITMAPPRINT structure.

You can specify the position and dimensions of the printed image, or let LEADTOOLS calculate values for you as follows:

You can specify the X and Y offsets of the image, or you can let LEADTOOLS center the image vertically, horizontally, or both.

You can specify the width, and let LEADTOOLS calculate the height to preserve the aspect ratio.

You can specify the height, and let LEADTOOLS calculate the width to preserve the aspect ratio.

You can let LEADTOOLS calculate the maximum printed width and height, while preserving the aspect ratio.

The structure is designed to let you print multiple bitmaps on the same page. To do so, send the message with the fEndDoc field set to FALSE for each image except the last one on the page. Then send the message with the fEndDoc field set to TRUE. If you do not set the fEndDoc field to TRUE in the last message, the hDC will not be freed, and the page will not flush.

The following table describes the fields in the structure, using MyPrint as the name of the LEADBITMAPPRINT structure:

Sample Field Name

Data Type

Description

MyPrint.uStructSize

L_UINT

Size of the LEADBITMAPINFO structure. This field allows for compatibility with future enhancements. It can be specified as follows:

MyPrint.uStructSize = sizeof(MyPrint);

MyPrint.hDC

HDC

Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT.

MyPrint.nXPos

L_INT

X position to start the print. Pass a 0 to center the image horizontally on the page.

MyPrint.nYPos

L_INT

Y position to start the print. Pass a 0 to center the image vertically on the page.

MyPrint.nXSize

L_INT

The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.

Pass a 0 to let LEADTOOLS calculate the width. If you specify only the width or only the height, LEADTOOLS calculates the remaining dimension. If you pass zeros for both width and height, LEADTOOLS calculates the maximum dimensions that fit on the page while preserving the aspect ratio.

MyPrint.nYSize

L_INT

The printed height. The value is in dots, and the actual height depends on the dots per inch (DPI) of the printer.

Pass a 0 to let LEADTOOLS calculate the height. If you specify only the width or only the height, LEADTOOLS calculates the remaining dimension. If you pass zeros for both width and height, LEADTOOLS calculates the maximum dimensions that fit on the page while preserving the aspect ratio.

MyPrint.fEndDoc

L_BOOL

This is used to let LEADTOOLS know whether you plan to print another image on the same page or not.


L_BM_RESAMPLE

Send this message to change the size of an L_BITMAPCLASS window's bitmap, using interpolation and averaging to produce a higher-quality image than is achieved with other resizing functions.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the new width. The high order of the lParam parameter should contain the new height.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_RESIZE

Send this message to change the size of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the new width. The high order of the lParam parameter should contain the new height.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_REVERSE

Send this message to reverse an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Reserved. Set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_ROTATE

Send this message to rotate an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the angle (in degrees) to rotate the image. A positive value will rotate clockwise and a negative value will rotate the image counter-clockwise. If the high order word is nonzero, then the window is resized (if needed) to contain the new image.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SATURATION

Send this message to change the color saturation of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of lParam should contain the amount to change the saturation. The value should range between -1000 and 1000 from gray to full saturation. The high order word must be set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SAVE

Send this message to save an L_BITMAPCLASS window's bitmap to a file.

Parameter | Meaning
wParam | Reserved. Set to NULL
lParam | Points to a LEADBITMAPSAVE structure. For a description, refer to the LEADBITMAPSAVE Structure described below.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPSAVE Structure

The L_BM_SAVE message lets you save an image in the L_BITMAPCLASS registered class. Before sending the message, your program must declare a LEADBITMAPSAVE structure and update its required fields. The following table describes the fields in the structure, using SavFile as the name of the LEADBITMAPSAVE structure.

Sample Field Name | Data Type | Description
SavFile.uStructSize | L_UINT | Size of the LEADBITMAPSAVE structure. This field allows for compatibility with future enhancements. It can be specified as follows: SavFile.uStructSize = sizeof(SavFile);
SavFile.Name | L_TCHAR [L_MAXPATH] | An array of length L_MAXPATH that holds the full path and name of the file to save.
SavFile.Format | L_INT | The format of the file to save. For valid values, refer to Formats of Output Files.
SavFile.QFactor | L_INT | The Q factor to be used if the image is saved as a compressed file. The value can range from 2 to 255 for any of the LEAD, JTIF, or JFIF compression types. For additional valid values, refer to Compression Quality Factors.
SavFile.BitsPerPixel | L_INT | Number of bits per pixel. For valid values, refer to Formats of Output Files.
SavFile.pOptions | pSAVEFILEOPTION | Pointer to optional extra save options. Use NULL for defaults.


L_BM_SETBITMAP

Send this message to set the L_BITMAPCLASS window's bitmap to the bitmap referenced by a LEAD bitmap handle.

This is similar to the L_BM_COPYBITMAP message, except that it references the existing bitmap data, instead of making a copy.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Specifies a pointer to the LEAD bitmap handle referencing the bitmap.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SETBITMAPCLIP

Send this message to limit the part of the bitmap that is repainted.

When you send this message, specifying a RECT structure, only the part of the bitmap that is in the rectangle and visible in the window is repainted.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to the RECT structure that specifies the area of the bitmap to repaint. The coordinates of the rectangle are relative to the bitmap origin.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SETIMAGERECT

Send this message to change the display rectangle of an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Pointer to RECT structure.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SETSTYLE

Send this message to alter an L_BITMAPCLASS window's style.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Specifies the style value. You can use standard Windows styles and the styles specified in L_BITMAPCLASS Windows Styles.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SETZOOM

Send this message to zoom in or zoom out by setting the display scalar for an L_BITMAPCLASS window's bitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of the lParam parameter should contain the percentage scale factor. A value of 100 means no zooming.

Returns

L_UINT | The previous zoom factor.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SHARPEN

Send this message to increase or decrease the sharpness of the L_BITMAPCLASS window's image.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | The low order of lParam should contain the amount to change the sharpness. The value should range between -1000 and 1000 from minimum to maximum sharpness. The high order word must be set to NULL.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.


L_BM_SHEAR

Send this message to move the corners of an L_BITMAPCLASS window's 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 following are horizontal and vertical examples:

Parameter | Meaning
wParam | Reserved. Set to NULL
lParam | Points to a LEADBITMAPSHEAR structure. For a description, refer to the LEADBITMAPSHEAR Structure described below.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

LEADBITMAPSHEAR Structure

The L_BM_SHEAR message lets you move the corners of an L_BITMAPCLASS window's bitmap in the fashion of a parallelogram. Before sending the message, your program must declare a LEADBITMAPSHEAR structure and update its required fields. The following table describes the fields in the structure, using MyShear as the name of the LEADBITMAPSHEAR structure:

Sample Field Name | Data Type | Description
MyShear.uStructSize | L_UINT | Size of the LEADBITMAPSHEAR structure. This field allows for compatibility with future enhancements. It can be specified as follows: MyShear.uStructSize = sizeof(MyShear);
MyShear.nAngle | L_INT | The angle of slant. Positive values are for clockwise angles; negative values are for counterclockwise angles.
MyShear.fHorizontal | L_BOOL | TRUE for horizontal shear, or FALSE for vertical shear.
MyShear.crFill | COLORREF | The COLORREF value that specifies the fill color. You can assign the value using the Windows RGB macro.

See Also

Topics:

Using Color Values in LEADTOOLS


L_BM_SPATIALFLT

Send this message to apply a spatial filter to an L_BITMAPCLASS window's bitmap.

For more information about spatial filters, refer to L_SpatialFilterBitmap.

Parameter | Meaning
wParam | Specifies whether the window should be redrawn to reflect the image changes. Use 1 to redraw the window, or 0 not to redraw it.
lParam | Points to a SPATIALFLT structure. For a list of predefined structures, refer to L_SpatialFilterBitmap.

Returns

L_UINT | The previous zoom factor.
< 0 | An error occurred. Refer to Return Codes.


L_BN_CHANGE

When received, this message indicates that the user has taken an action that may have altered the bitmap. For example, flipping or rotating the bitmap would cause this message to be sent.

It is sent after Windows updates a display (unlike the L_BN_UPDATE code.) The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS windows handle in its low-order word and the L_BN_CHANGE code in its high-order word.


L_BN_CLICKED

When received, this message indicates that the window was clicked with the left mouse button.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_CLICKED code in its high-order word.


L_BN_DBLCLK

When received, this message indicates that the window was double-clicked with the left mouse button.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_DBLCLK code in its high-order word.


L_BN_HSCROLL

When received, this message indicates that the user has clicked the L_BITMAPCLASS window's horizontal scroll bar.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window. Notification occurs before the screen is updated.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS windows handle in its low-order word and the L_BN_HSCROLL code in its high-order word.


L_BN_KILLFOCUS

When received, this message indicates that L_BITMAPCLASS window has lost the input focus.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_KILLFOCUS code in its high-order word.


L_BN_PAINTED

When received, this message indicates that the window was painted.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_PAINTED code in its high-order word.


L_BN_SETFOCUS

When received, this message indicates that L_BITMAPCLASS window has obtained the input focus.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_SETFOCUS code in its high-order word.


L_BN_UPDATE

When received, this message indicates that L_BITMAPCLASS window will display an altered image.

The L_BITMAPCLASS window's parent receives this code through a WM_COMMAND message from the L_BITMAPCLASS window. Notification occurs before the altered image is displayed.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_UPDATE code in its high-order word.


L_BN_VSCROLL

When received, this message indicates that the user has clicked the L_BITMAPCLASS window's vertical scroll bar.

The L_BITMAPCLASS window's parent window receives this code through a WM_COMMAND message from the L_BITMAPCLASS window. Notification occurs before the screen is updated.

Parameter | Description
wParam | Contains the wParam parameter of the WM_COMMAND message, and specifies the child-window ID.
lParam | Contains the L_BITMAPCLASS window handle in its low-order word and the L_BN_VSCROLL code in its high-order word.


L_ILM_CANCELDB

Send this message to cancel the progress of a database load/save that was started with either the L_ILM_LOADDATABASE or L_ILM_SAVEDATABASE message.

Parameter | Description
wParam | Ignored, use 0.
LParam | Ignored, use 0.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

Send this message to the control while processing either the L_ILN_LOADDBSTATUS or L_ILN_SAVEDBSTATUS notification commands in order to stop the database process.

The associated macro is:

L_ImgListCancelDB(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_LOADDATABASE, L_ILM_SAVEDATABASE, L_ILN_LOADDBSTATUS, L_ILN_SAVEDBSTATUS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

/* NOTE this is not a complete sample, and is meant only to
show you a way in which this message can be used */
case IDC_LEADIMAGELIST:
if((HIWORD(wParam) == L_ILN_LOADDBSTATUS) ||
(HIWORD(wParam) == L_ILN_SAVEDBSTATUS))
{
static int x=0;
x++;
if(x>2)//stop after loading/saving 3 items
L_ImgListCancelDB(hCtl);
}


L_ILM_CLEAR

Send this message to clear all items from the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The associated macro is:

L_ImgListClear(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_REMOVE, L_ILM_SORT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc20(HWND hWnd)
{
if(IsWindow(hWnd))
{
/* clear all items */
SendMessage(hWnd, L_ILM_CLEAR, 0, 0L);
}
}


L_ILM_DRAWITEM

Send this message to draw/paint the specified item in the ImageList Control's parent window.

Parameter | Description
wParam | 0-not used.
lParam | Pointer to an LILDRAWITEM structure that contains information about the item to be drawn/painted.

Returns

ERROR_USER_ABORT | The ImageList Control will not do any further drawing/painting of the specified item.
<> ERROR_USER_ABORT | The ImageList Control will draw/paint the item normally.

Comments

The LILDRAWITEM structure pointed to by lParam specifies the information to draw/paint.

The user is responsible for any objects created during the processing of this message. In addition, the user is also responsible for returning the HDC to its original state before returning from the processing of this message.

See Also

Elements: | LILDRAWITEM
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
pLILDRAWITEM pdi=NULL;

switch (Message)
{
case ILM_DRAWITEM:
pdi=(pLILDRAWITEM)lParam;
if(pdi)
{
if(pdi->pItem)
{
HRGN hRgn1=NULL;
HRGN hRgn2=NULL;
HBRUSH hBrush=NULL;
RECT rcMyItem;
SaveDC(pdi->hDC);
CopyRect(&rcMyItem, &pdi->rcItem);
InflateRect(&rcMyItem, -10, -10);
hRgn1 = CreateEllipticRgn(pdi->rcItemBack.left,
pdi->rcItemBack.top,
pdi->rcItemBack.right,
pdi->rcItemBack.bottom);
hRgn2 = CreateEllipticRgn(rcMyItem.left,
rcMyItem.top,
rcMyItem.right,
rcMyItem.bottom);
if(pdi->pItem->bSelected)
hBrush=(HBRUSH)GetStockObject(WHITE_BRUSH);
else
hBrush=(HBRUSH)GetStockObject(BLACK_BRUSH);
SelectObject(pdi->hDC, hBrush);
SelectObject(pdi->hDC, hRgn1);
Rectangle(pdi->hDC, pdi->rcItemBack.left,
pdi->rcItemBack.top,
pdi->rcItemBack.right,
pdi->rcItemBack.bottom);
SelectObject(pdi->hDC, hRgn2);
L_PaintDC(pdi->hDC, pdi->pItem->pBitmap,
NULL, NULL, &rcMyItem, NULL, SRCCOPY);
if(pdi->pItem->pText && lstrlen(pdi->pItem->pText))
DrawText(pdi->hDC, pdi->pItem->pText,
lstrlen(pdi->pItem->pText), &rcMyItem,
DT_SINGLELINE|DT_BOTTOM|DT_END_ELLIPSIS);
DeleteObject(hRgn1);
DeleteObject(hRgn2);
RestoreDC(pdi->hDC, -1);
return ERROR_USER_ABORT;//I did the drawing
}
}
return SUCCESS;//I did not do the drawing
//other cases here...............
//for other window messages......
}
return DefWindowProc(hWnd, Message, wParam, lParam);
}


L_ILM_ENABLEKEYBOARD

Send this message to enable or disable the ImageList control's automatic processing of the keyboard.

Parameter | Description
wParam | Boolean flag that specifies the keyboard status. Possible values are:
 | Value | Meaning
 | TRUE | ImageList Control will process the keyboard
 | FALSE | ImageList Control will not process the keyboard
lParam | Ignored, use 0.

Returns

The previous setting for keyboard processing.

Comments

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 ALLOWSELECTION_SINGLE, then the selected item will move up, down, left, or right, depending on the key(s) being processed. If AllowSelection is set to ALLOWSELECTION_MULTI, multiple items can be selected using the CTRL and/or SHIFT keys in conjunction with the keys listed above.

The associated macro is:

L_ImgListEnableKeyboard(hWnd, bFlag)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETSCROLLSTYLE, L_ILM_GETSCROLLSTYLE, L_ILM_SETSELOPTIONS, L_ILM_GETSELOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

/* enable automatic keyboard processing */
HWND hCtl;

SendMessage(hCtl, L_ILM_ENABLEKEYBOARD, (WPARAM)TRUE, 0L);


L_ILM_ENSUREVISIBLE

Send this message to scroll the items in the ImageList Control so that the specified item is visible.

Parameter | Description
wParam | 0-based index of the item to make visible.
lParam | Ignored, use 0.

Returns

<>0 | The number or rows/columns scrolled.
0 | Did not scroll or an error occured. Refer to Return Codes.

Comments

Depending on the current setting for the control's ScrollStyle, the number or rows or columns returned will be scrolled in order to make the specified item visible.

The associated macro is:

L_ImgListEnsureVisible(hWnd, uItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSCROLLSTYLE, L_ILM_INSERT, L_ILM_SCROLLITEMS, L_ILM_GETPAGE, L_ILM_GETITEMCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_INSERTAT.


L_ILM_EXPORTBITMAPLIST

Send this message to export a number of bitmaps from the ImageList Control to a Bitmap List.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to the LILEXPORTBITMAPLIST structure that contains the list of bitmaps to be exported.

Returns

SUCCESS | Function was successful.
<0 | An error occurred. Refer to Error Codes.

Comments

You must set the uStructSize member of the LILEXPORTBITMAPLIST structure before using this message.

The list of bitmaps will be exported from the ImageList control into the passed hList starting from nStartIndex to (nStartIndex + nItemsToExport –1).

If you passed NULL into the hList member of the passed LILEXPORTBITMAPLIST structure, this parameter hList will be created internally and is going to contain all the exported bitmaps.

After exporting the list of bitmaps successfully from the ImageList control, don’t try to free the bitmaps of the exported list hList, since it is going to have a reference to the original bitmaps not a copy of them.

The associated macro is:

L_ImgListExportBitmapList(hWnd, pExportList)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_IMPORTBITMAPLIST, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestExportList(HWND hWnd, L_TCHAR L_FAR * lpOutputFileName)
{
if(IsWindow(hWnd))
{
// Check if the ImageList control has more than 4 images.
if(SendMessage(hWnd, L_ILM_GETITEMCOUNT, 0, 0L) > 4)
{
LILEXPORTBITMAPLIST ExportList;
ZeroMemory(&ExportList, sizeof(LILEXPORTBITMAPLIST));

ExportList.uStructSize = sizeof(LILEXPORTBITMAPLIST);
ExportList.nStartIndex = 1; // Start from index 1
ExportList.nItemsToExport = 2; // Export only 2 images.

// Export images
SendMessage(hWnd, L_ILM_EXPORTBITMAPLIST, (WPARAM)0, (LPARAM)(&ExportList));

// Check if the images exported successfully
if(ExportList.hList)
{
// Save the exported images to a disk-file
L_SaveBitmapList(lpOutputFileName,
ExportList.hList,
FILE_GIF,
0,
2,
NULL);
}
}
}
}


L_ILM_GETBACKCOLOR

Send this message to get the background color of the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to a variable to be updated with the background color of the control.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

Before using this message, you must allocate a variable of type COLORREF and pass the address of this variable in lParam.

The variable pointed to by lParam will be updated with the ImageList Control's current background color.

The associated macro is:

L_ImgListGetBackColor(hWnd, pcrBack)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETBACKCOLOR, L_ILM_GETBORDERCOLOR, L_ILM_SETBORDERCOLOR, L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages
 | Using Color Values in LEADTOOLS

Example

L_VOID TestFunc7(HWND hWnd)
{
LRESULT lRet;
COLORREF crBack;
if(IsWindow(hWnd))
{
/* get current color */
lRet = SendMessage(hWnd, L_ILM_GETBACKCOLOR, 0, (LPARAM)&crBack);
/* change it and reset */
if(crBack != RGB(190,190,190))
crBack = RGB(190,190,190);
lRet = SendMessage(hWnd, L_ILM_SETBACKCOLOR, 0, (LPARAM)&crBack);
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}


L_ILM_GETBORDERCOLOR

Send this message to get the border color of the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to a variable to be updated with the border color of the control.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

Before using this message, you must allocate a variable of type COLORREF and pass the address of this variable in lParam.

The variable pointed to by lParam will be updated with the ImageList Control's current border color.

The associated macro is:

L_ImgListGetBorderColor(hWnd, pcrBorder)

Note: Border Color only has an effect when the ImageList Control's window includes the WS_BORDER window style, and does not include the WS_EX_CLIENTEDGE

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETBORDERCOLOR, L_ILM_GETBACKCOLOR, L_ILM_SETBACKCOLOR, L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages
 | Using Color Values in LEADTOOLS

Example

L_VOID TestFunc8(HWND hWnd)
{
LRESULT lRet;
COLORREF crBorder;
if(IsWindow(hWnd))
{
/* get current color */
lRet = SendMessage(hWnd, L_ILM_GETBORDERCOLOR, 0, (LPARAM)&crBorder);
/* change it and reset */
if(crBorder != RGB(255,10,10))
crBorder = RGB(255,10,10);
lRet = SendMessage(hWnd, L_ILM_SETBORDERCOLOR, 0, (LPARAM)&crBorder);
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}


L_ILM_GETCOLCOUNT

Send this message to get the current number of item columns in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of columns.
<0 | An error occurred. Refer to Return Codes.

Comments

This message will return the total number of item columns in the ImageList Control.

The associated macro is:

L_ImgListGetColumnCount(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETROWCOUNT, L_ILM_GETITEMCOUNT, L_ILM_GETSELCOUNT, L_ILM_GETPAGECOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETROWCOUNT.


L_ILM_GETFIRSTVISIBLE

Send this message to get the first visible item in the ImageList Control's view.

Parameter | Description
wParam | Ignored. Use 0.
lParam | Ignored. Use 0.

Returns

>= 0 | The 0-based index of the first visible item.
< 0 | An error occurred. Refer to Return Codes.

Comments

The associated macro is

L_ImgListGetFirstVisible(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_GETVIEWSIZE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETVIEWSIZE.


L_ILM_GETITEM

Send this message to get the specified item from the ImageList Control.

Parameter | Description
wParam | 0-based index of the item to get.
lParam | Pointer to LILITEM structure to be filled with the item.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The LILITEM structure pointed to by lParam specifies the information to retrieve and will be filled with the information about the item. The uMask member of the LILITEM structure indicates the attributes of the item to retrieve.

You must set the uStructSize member of the LILITEM structure before using this message.

If you are including the LILITEM_BITMAP flag in the uMask member of the LILITEM structure, you must set the uBitmapStructSize member of the LILITEM structure before using this message.

The associated macro is:

L_ImgListGetItem(hWnd, uIndex, pItem)

After this function returns, the LILITEM structure pointed to by lParam will reference the specified item. You can use the pBitmap or pText members of the structure to modify the item. If you modify the bitmap or text pointed to by this structure, you will be directly modifying the item in the ImageList Control. You should not attempt to free the memory pointed to by pBitmap or pText.

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_SETITEM, L_ILM_GETSELCOUNT, L_ILM_GETSELITEMS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc10(HWND hWnd)
{
LILITEM Item;
LRESULT lRet;

if(IsWindow(hWnd))
{
/* get the 3rd item */
memset(&Item, 0, sizeof(LILITEM));
Item.uStructSize = sizeof(LILITEM);
Item.uMask = LILITEM_BITMAP|LILITEM_TEXT; /* retrieve the bitmap & the text */
lRet = SendMessage(hWnd, L_ILM_GETITEM, 2, (LPARAM)&Item);
if((L_INT)lRet==SUCCESS)
{
MessageBox(hWnd, Item.pText, TEXT("Item"), MB_OK);
/* flip the image and update the control */
L_FlipBitmap(Item.pBitmap);
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}
}


L_ILM_GETITEMCOUNT

Send this message to get the current number of items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of items
<0 | An error occurred. Refer to Return Codes.

Comments

This message will return the total number of items in the ImageList Control.

The associated macro is:

L_ImgListGetItemCount(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT, L_ILM_GETSELCOUNT, L_ILM_GETPAGECOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc4(HWND hWnd)
{
LRESULT lCount;
L_TCHAR buf[180];

/* get current item count */
lCount = SendMessage(hWnd, L_ILM_GETITEMCOUNT, 0, 0L);

wsprintf(buf, TEXT("Items: %ld\n"), lCount);
MessageBox(hWnd, buf, TEXT("Count"), MB_OK);
}


L_ILM_GETITEMOPTIONS

Send this message to get the ImageList Control's item display options.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to LILITEMOPTIONS structure to be filled with current display options.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The structure pointed to by lParam will be updated with the ImageList Control's current display options.

You must set the uStructSize member of the LILITEMOPTIONS structure before using this message.

The default item display options are:

uVerticalSpacing | 5
uHorizontalSpacing | 5
uWidth | 115
uHeight | 115
crBackground | GetSysColor(COLOR_BTNFACE)
bDisplayItemText | TRUE
crForeground | RGB(0,0,0)
hFont | NULL (Times New Roman, 8 point)

The associated macro is:

L_ImgListGetItemOptions(hWnd, pItemOptions)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETITEMOPTIONS, L_ILM_GETSELOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc2(HWND hWnd)
{
LILITEMOPTION Opt; /* item options structure */
LRESULT lRet;

/* get current item options */
Opt.lStructSize = sizeof(LILITEMOPTION);
lRet = SendMessage(hWnd, L_ILM_GETITEMOPTIONS, 0, (LPARAM)&Opt);

/* now, set some new options */
Opt.uVerticalSpacing = 10;
Opt.uHorizontalSpacing = 10;
if(Opt.uWidth < 100)
Opt.uWidth=100;
if(Opt.uHeight < 100)
Opt.uHeight=100;
Opt.crBackground = RGB(100,100,100);
Opt.bDisplayItemText = FALSE;
lRet = SendMessage(hWnd, L_ILM_SETITEMOPTIONS, 0, (LPARAM)&Opt);

/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}


L_ILM_GETPAGE

Send this message to get the number of the currently visible page of items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of the currently visible page
< 0 | An error occurred. Refer to Return Codes.

Comments

This message 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.

The associated macro is:

L_ImgListGetPage(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETPAGECOUNT, L_ILM_GETITEMCOUNT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT, L_ILM_GETSELCOUNT, L_ILM_GETSCROLLSTYLE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETPAGECOUNT.


L_ILM_GETPAGECOUNT

Send this message to get the number of pages of items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of pages
< 0 | An error occurred. Refer to Return Codes.

Comments

This message 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.

The associated macro is:

L_ImgListGetPageCount(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETPAGE, L_ILM_GETITEMCOUNT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT, L_ILM_GETSELCOUNT, L_ILM_GETSCROLLSTYLE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc22(HWND hWnd)
{
L_INT32 lCount;
L_INT32 lPage;
L_TCHAR buf[200];
if(IsWindow(hWnd))
{
/* get current page count */
lCount = (L_INT32)SendMessage(hWnd, L_ILM_GETPAGECOUNT, 0, 0L);
/* get current page */
lPage = (L_INT32)SendMessage(hWnd, L_ILM_GETPAGE, 0, 0L);
wsprintf(buf, TEXT("Page: %ld of %ld Pages!"), lPage, lCount);
MessageBox(hWnd, buf, TEXT("Page Count"), MB_OK);
}
}


L_ILM_GETROWCOUNT

Send this message to get the current number of item rows in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of rows.
<0 | An error occurred. Refer to Return Codes.

Comments

This message will return the total number of item rows in the ImageList Control.

The associated macro is:

L_ImgListGetRowCount(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETCOLCOUNT, L_ILM_GETITEMCOUNT, L_ILM_GETSELCOUNT, L_ILM_GETPAGECOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc3(HWND hWnd)
{
LRESULT lRows;
LRESULT lCols;
L_TCHAR buf[180];

/* get current row and column counts */
lRows = SendMessage(hWnd, L_ILM_GETROWCOUNT, 0, 0L);
lCols = SendMessage(hWnd, L_ILM_GETCOLCOUNT, 0, 0L);

wsprintf(buf, TEXT("Rows: %ld\tCols: %ld\n"), lRows, lCols);
MessageBox(hWnd, buf, TEXT("Count"), MB_OK);
}


L_ILM_GETSCROLLSTYLE

Send this message to get the ImageList control's current scroll style.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

The current scroll style, which can be one of the following:

SCROLLSTYLE_VERTICAL | [0] scrolling vertically
SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontally

Comments

The associated macro is:

L_ImgListGetScrollStyle(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETSCROLLSTYLE, L_ILM_SCROLLITEMS, L_ILM_ENSUREVISIBLE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc18(HWND hWnd)
{
L_INT nStyle;
if(IsWindow(hWnd))
{
/* get current scroll style */
nStyle = (L_INT)SendMessage(hWnd, L_ILM_GETSCROLLSTYLE, 0, 0L);
if(nStyle == SCROLLSTYLE_VERTICAL)
nStyle = SCROLLSTYLE_HORIZONTAL;
else
nStyle = SCROLLSTYLE_VERTICAL;
/* set new scroll style */
SendMessage(hWnd, L_ILM_SETSCROLLSTYLE, (WPARAM)nStyle, 0L);
}
}


L_ILM_GETSELCOUNT

Send this message to get the current number of selected items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

>=0 | The number of selected items.
< 0 | An error occurred. Refer to Return Codes.

Comments

Use this message before using L_ILM_GETSELITEMS in order to get the number of selected items for allocating storage for the LILITEM structures.

The associated macro is:

L_ImgListGetSelCount(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSELITEMS, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT, L_ILM_GETITEMCOUNT, L_ILM_GETPAGECOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc9(HWND hWnd)
{
L_TCHAR szText[200];
LRESULT lRet;

if(IsWindow(hWnd))
{
lRet = SendMessage(hWnd, L_ILM_GETSELCOUNT, 0, 0L);
wsprintf(szText, TEXT("%ld"),lRet);
MessageBox(hWnd, szText, TEXT("SelectCount"), MB_OK);
}
}


L_ILM_GETSELITEMS

Send this message to get the currently selected items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to a caller-allocated array of LILITEM structures to be filled with the selected items.

Returns

>=0 | The number of items currently selected and pointed to by lParam
< 0 | An error occurred. Refer to Return Codes.

Comments

The return value is the number of items pointed to by lParam.

You must set the uStructSize member of the LILITEM structure before using this message.

If you are including the LILITEM_BITMAP flag in the uMask member of the LILITEM structure, you must set the uBitmapStructSize member of the LILITEM structure before using this message.

You must allocate the array to be large enough to hold the selected items and free the memory when it is no longer needed by your application.

If you pass NULL for lParam, the message will simply return the current number of selected items.

The LILITEM structure for each selected item will contain all attributes for the item. The lIndex member of the structure will contain the 0-based index of the item.

The associated macro is:

L_ImgListGetSelItems(hWnd, pItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSELCOUNT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT, L_ILM_GETITEMCOUNT, L_ILM_GETPAGECOUNT, L_ILM_GETITEM, L_ILM_SETITEM
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc16(HWND hWnd)
{
LRESULT lRet;
L_TCHAR szText[200];
L_TCHAR szMsg[200];
pLILITEM pItems=NULL;
pLILITEM pTemp=NULL;
L_INT32 x;

if(IsWindow(hWnd))
{
/* Get selected item count */
lRet = SendMessage(hWnd, L_ILM_GETSELITEMS, 0, 0L);
if(lRet > 0)
{
/* allocate the storage */
pItems = (pLILITEM)malloc(lRet * sizeof(LILITEM));
memset(pItems, 0, lRet * sizeof(LILITEM));
pTemp = pItems;
for(x=0; x<lRet; x++)
{
pTemp->uStructSize = sizeof(LILITEM);
pTemp->uBitmapStructSize = sizeof(BITMAPHANDLE);
}
/* Get selected items */
lRet = SendMessage(hWnd, L_ILM_GETSELITEMS, 0, (LPARAM)pItems);

pTemp = pItems;
lstrcpy(szMsg, TEXT(""));
if(pItems)
{
for(x=0;x<lRet;x++)
{
wsprintf(szText, TEXT("%s at index %ld\n"), pTemp->pText, pTemp->lIndex);
lstrcat(szMsg, szText);
pTemp++;
}
/* free the storage */
free(pItems);
}
MessageBox(hWnd, szMsg, TEXT("Selected Items"), MB_OK);
}
else
MessageBox(hWnd, TEXT("None"), TEXT("Selected Items"), MB_OK);
}
}


L_ILM_GETSELOPTIONS

Send this message to get the ImageList Control's current selection options.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to an LILSELOPTION structure to be filled with the current options.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

Comments

The structure pointed to by lParam will be updated with the ImageList Control's current options.
You must set the uStructSize member of the LILSELOPTION structure before using this message.

The default selection options are:

uAllowSelection | ALLOWSELECTION_NONE
uSelectionStyle | SELECTIONSTYLE_SELECTCOLOR
crSelection | RGB(0,0,255)

The associated macro is:

L_ImgListGetSelOptions(hWnd, pSelOptions)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SETSELOPTIONS, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc(HWND hWnd)
{
LILSELOPTION Opt; /* selection options structure */
LRESULT lRet;

/* get current selection options */

Opt.lStructSize = sizeof(LILSELOPTION);
lRet = SendMessage(hWnd, L_ILM_GETSELOPTIONS, 0, (LPARAM)&Opt);

/* now, set some new options */
if(Opt.uAllowSelection != ALLOWSELECTION_MULTI)
Opt.uAllowSelection = ALLOWSELECTION_MULTI;
Opt.uSelectionStyle = SELECTIONSTYLE_SELECTCOLOR;
Opt.crSelection = RGB(0,255,0);
lRet = SendMessage(hWnd, L_ILM_SETSELOPTIONS, 0, (LPARAM)&Opt);

/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}


L_ILM_GETVIEWSIZE

Send this message to get the ImageList Control's view size.

Parameter | Description
wParam | Ignored. Use 0.
lParam | Ignored. Use 0.

Returns

>= 0 | The number of rows/columns that are "visible".
< 0 | An error occurred. Refer to Return Codes.

Comments

This message returns the size of the ImageList control's viewing area in rows or columns. The size includes partially visible rows/columns.

The value returned depends on the current scroll style . If the scroll style is SCROLLSTYLE_VERTICAL, then the value returned indicates rows. If the scroll style is SCROLLSTYLE_HORIZONTAL, then the value returned indicates columns.

The associated macro is

L_ImgListGetViewSize(hWnd)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSCROLLSTYLE, L_ILM_SETSCROLLSTYLE, L_ILM_GETFIRSTVISIBLE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

HWND hCtl;

L_INT32 nSize;
L_INT32 nFirst;
L_INT32 nLast;
L_INT32 nCols;
L_INT32 nCount;

//NOTE: assume scroll style = SCROLLSTYLE_VERTICAL
//get the view size
nSize = SendMessage(hCtl, L_ILM_GETVIEWSIZE, 0, 0);
//get the first visible item
nFirst = SendMessage(hCtl, L_ILM_GETFIRSTVISIBLE, 0, 0);
//get the column count
nCols = SendMessage(hCtl, L_ILM_GETCOLCOUNT, 0, 0);
//calculate the index of last visible item
nLast = nFirst + (nSize*nCols) - 1;//0 based index
nCount = SendMessage(hCtl, L_ILM_GETITEMCOUNT, 0, 0);
if(nLast > nCount-1)
nLast = nCount-1;


L_ILM_HITTEST

Send this message to query the ImageList Control for the index of the item at the specified location.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to a POINT structure containing the location to query.

Returns

>=0 | The index of the item at the specified location
< 0 | An error occurred, refer to Return Codes.

Comments

This message will return the 0 based index of the item at the specified location, if one exists.

The location is in MM_TEXT mapping mode (pixels), and is relative to the client area of the control's window.

The associated macro is:

L_ImgListHitTest(hWnd, pPoint)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEM, L_ILM_GETITEMCOUNT, L_ILM_SETITEM
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc15(HWND hWnd)
{
LRESULT lRet;
L_TCHAR szText[200];
POINT pt;

if(IsWindow(hWnd))
{
/* check a location for an item */
pt.x = 80;
pt.y = 100;
lRet = SendMessage(hWnd, L_ILM_HITTEST, 0, (LPARAM)&pt);
if(lRet >= 0)
{
wsprintf(szText, TEXT("Item: %ld"), lRet);
MessageBox(hWnd, szText, TEXT("HitTest"), MB_OK);
}
else
MessageBox(hWnd, TEXT("None"), TEXT("HitTest"), MB_OK);
}
}


L_ILM_IMPORTBITMAPLIST

Send this message to insert a list of bitmaps into the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to the LILIMPORTBITMAPLIST structure that contains the list of bitmaps to be inserted.

Returns

SUCCESS | Function was successful.
<0 | An error occurred. Refer to Error Codes.

Comments

You must set the uStructSize member of the LILIMPORTBITMAPLIST structure before using this message.

The list of bitmaps found in the passed LILIMPORTBITMAPLIST structure (pointed to by lParam) will be inserted into the Image List control starting from nStartIndex to (nStartIndex + nItemsToInsert –1).

After inserting the list of bitmaps successfully into the ImageList control, don’t try to free the bitmaps of the passed list (hList’s bitmaps). The ImageList control will have a reference to hList bitmaps not a copy of them.

The associated macro is:

L_ImgListImportBitmapList(hWnd, pImportList)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_EXPORTBITMAPLIST, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestImportList(HWND hWnd, HBITMAPLIST hList)
{
if(IsWindow(hWnd) && hList)
{
L_UINT uCount =0;

// Getting the number of bitmaps in the list.
L_GetBitmapListCount(hList, &uCount);

if(uCount > 0) // There are some bitmaps
{
LILIMPORTBITMAPLIST ImportList;
ZeroMemory(&ImportList, sizeof(LILIMPORTBITMAPLIST));

ImportList.uStructSize = sizeof(LILIMPORTBITMAPLIST);
ImportList.hList = hList;
ImportList.nStartIndex = 0; // Start from Index 0.
ImportList.nItemsToInsert = uCount;// Import all the list bitmaps.
ImportList.pText = _T("Imported Bitmap-Text");
ImportList.pTextExt = _T("Imported Bitmap-TextExt");

SendMessage(hWnd, L_ILM_IMPORTBITMAPLIST, (WPARAM)0, (LPARAM)(&ImportList));
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}
}
}


L_ILM_INSERT

Send this message to insert an item into the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to LILITEM structure containing the item to be inserted.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

This message will insert the specified item at the end of the list.

You must set the uStructSize member of the LILSELOPTION structure before using this message.

Note: On an insert, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

The associated macro is:

L_ImgListInsert(hWnd, pItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_INSERTAT, L_ILM_REMOVE, L_ILM_CLEAR, L_ILM_ENSUREVISIBLE, L_ILM_GETITEMCOUNT, L_ILM_SORT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc21(HWND hWnd, pBITMAPHANDLE pBitmap)
{
LILITEM Item;
L_TCHAR szText[200];
SYSTEMTIME st;

if(IsWindow(hWnd))
{
Item.uStructSize = sizeof(LILITEM);
Item.pBitmap = pBitmap;
Item.uBitmapStructSize = sizeof(BITMAPHANDLE);
Item.pText = szText;
Item.bSelected = FALSE;
Item.lData = 0;
GetSystemTime(&st);
wsprintf(szText, TEXT("%d%d%d"),st.wMinute,st.wSecond,st.wMilliseconds);
SendMessage(hCtl, L_ILM_INSERT, 0, (LPARAM)(pLILITEM)&Item);
}
}


L_ILM_INSERTAT

Send this message to insert an item into the ImageList Control at a specified index.

Parameter | Description
wParam | Index at which to insert the item.
lParam | Pointer to LILITEM structure containing item to be inserted

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

This message will insert the specified item at the specified index in the list. All items from the specified index are pushed up by one.

You must set the uStructSize member of the LILSELOPTION structure before using this message.

Note: On an insert, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

The associated macro is:

L_ImgListInsertAt(hWnd, uIndex, pItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_INSERT, L_ILM_REMOVE, L_ILM_CLEAR, L_ILM_ENSUREVISIBLE, L_ILM_GETITEMCOUNT, L_ILM_SORT, L_ILM_GETROWCOUNT, L_ILM_GETCOLCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc5(HWND hWnd)
{
LILITEM Item;
L_TCHAR szText[200];
SYSTEMTIME st;
BITMAPHANDLE Bitmap;
L_INT nRet;

if(IsWindow(hWnd))
{
nRet = L_LoadBitmap(TEXT("v:\\images\\eagle.cmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR);
Item.uStructSize = sizeof(LILITEM);
Item.pBitmap = &Bitmap;
Item.uBitmapStructSize = sizeof(BITMAPHANDLE);
Item.pText = szText;
Item.bSelected = FALSE;
Item.lData = 0;

GetSystemTime(&st);
wsprintf(szText, TEXT("%d%d%d"),st.wMinute,st.wSecond,st.wMilliseconds);
/* insert item at the specified index */
SendMessage(hWnd, L_ILM_INSERTAT, 3, (LPARAM)&Item);
SendMessage(hWnd, L_ILM_ENSUREVISIBLE, 3, 0L);
}
}


L_ILM_ITEMSELECTED

Processes this message to be notified when the user selects an item in the ImageList Control.

Parameter | Description
wParam | idCtlr = (L_INT)LOWORD(wParam) identifier of the control.
 | wNotifyCode = HIWORD(wParam) will be L_ILN_ITEMSEL.
lParam | Pointer to an LILITEMSELstructure containing information about the selected item.

Returns

None

Comments

This message is sent to the ImageList Control's window by itself when an Item is selected by the user.

You can use this message instead of the L_ILN_ITEMSEL command notification when you are sub-classing the ImageList Control.

The lIndex member of the LILITEMSEL structure pointed to by lParam will contain the 0-based index of the selected item.

See Also

Elements: | L_ILM_GETSELCOUNT, L_ILM_GETITEM, L_ILM_GETSELITEMS, L_ILN_ITEMSEL
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

/* this sample code comes from an example that sub-classes the LEAD ImageList Control Window */
/* this function processes the L_ILM_ITEMSELECTED message to be notified when an item is selected */

LRESULT OnItemSel(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
L_TCHAR szBuf[300];
pLILITEMSEL pItem=NULL;
pItem = (pLILITEMSEL)lParam;
if(pItem)
{
wsprintf(szBuf, TEXT("Item %ld was selected\n"), pItem->lIndex);
MessageBox(hWnd, szBuf, TEXT("Selected"), MB_OK);
this->Fire_ItemSelected(pItem->lIndex);
}
return 0;
}


L_ILM_ITEMUNSELECTED

Send this message to be notified when an item is unselected due to the user selecting or unselecting one or more items in the ImageList Control.

Parameter | Description
wParam | idCtlr = (L_INT)LOWORD(wParam) identifier of the control.
 | wNotifyCode = HIWORD(wParam) will be L_ILN_ITEMUNSEL.
lParam | Pointer to an LILITEMSEL structure containing information about the unselected item.

Returns

None.

Comments

This message is sent to the ImageList Control's window by itself when an Item is unselected by the user.

You can use this message instead of the L_ILN_ITEMUNSEL command notification when you are sub-classing the ImageList Control.

The lItem member of the LILITEMSEL structure pointed to by lParam will contain the 0-based index of the unselected item.

See Also

Elements: | L_ILM_ITEMSELECTED, L_ILM_GETSELCOUNT, L_ILM_GETITEM, L_ILM_GETSELITEMS, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

/* this sample code comes from an example that sub-classes the LEAD ImageList Control Window */
/* this function processes the L_ILM_ITEMUNSELECTED message to be notified when an item is unselected */

LRESULT OnItemUnSel(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
L_TCHAR szBuf[300];
pLILITEMSEL pItem=NULL;
pItem = (pLILITEMSEL)lParam;
if(pItem)
{
wsprintf(szBuf, TEXT("Item %ld was unselected\n"), pItem->lIndex);
MessageBox(hWnd, szBuf, TEXT("UnSelected"), MB_OK);
}
return 0;
}


L_ILM_LOADDATABASE

Send this message to have the ImageList Control load items from a previously saved database (multipage TIFF file).

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to the filename from which the database will be loaded.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

Comments

The text for each item will be read from the CMNT_SZNAMEOFPAGE comment.

The associated macro is:

L_ImgListLoadDatabase(hWnd, pszFilename)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ReadFileComment, L_SetComment, L_WriteFileComment, L_ILM_SAVEDATABASE, L_ILM_INSERT
Topics: | Using the ImageList Control Image List Control Messages

Example

HWND hCtl;
HWND hWndFrame;
L_VOID LoadDatabase()
{
L_INT nRet;
OPENFILENAME OFN;
L_TCHAR szFilter[] = {TEXT("ImgListDB\0") TEXT("*.tif\0\0")};
L_TCHAR szFile[L_MAXPATH] = TEXT("\0");

memset(&OFN, 0, sizeof(OFN));

OFN.lStructSize = sizeof(OPENFILENAME);
OFN.hwndOwner = hWndFrame;
OFN.lpstrFilter = szFilter;
OFN.lpstrCustomFilter = NULL;
OFN.lpstrFile = szFile;
OFN.nMaxFile = sizeof(szFile);
OFN.lpstrFileTitle = NULL;
OFN.lpstrTitle = "Load Database";
OFN.lpstrDefExt = NULL;
OFN.lpfnHook = NULL;

if(GetOpenFileName(&OFN))
{
nRet = SendMessage(hCtl, L_ILM_LOADDATABASE, (WPARAM)0, (LPARAM)szFile);

if(nRet != SUCCESS)
MessageBox(hWndFrame, TEXT("Error loading file!"), TEXT("Error"), MB_OK);
}
}


L_ILM_REMOVE

Send this message to remove an item from the ImageList Control.

Parameter | Description
wParam | Index of item to remove.
lParam | Ignored, use 0.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

This message will remove the specified item from the list.

Note: on an insert, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

The associated macro is:

L_ImgListRemove(hWnd, uIndex)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_INSERT, L_ILM_CLEAR, L_ILM_GETITEMCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc6(HWND hWnd)
{
LRESULT lRet;
if(IsWindow(hWnd))
{
/* remove the first item from the list */
lRet = SendMessage(hWnd, L_ILM_REMOVE, 0, 0L);
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}


L_ILM_SAVEDATABASE

Send this message to have the ImageList Control save its contents as a multipage TIFF file (database).

Parameter | Description
wParam | Flag that indicates which items to save. Possible values are:
 | Value | Meaning
 | TRUE | Save only selected items.
 | FALSE | Save all items.
lParam | Pointer to the filename in which the database will be saved.

Returns

SUCCESS | Function was successful.
< 0 | An error occurred. Refer to Return Codes.

Comments

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_TIF_JPEG
other | FILE_TIF

The pText for each item will be saved in the CMNT_SZNAMEOFPAGE comment.

The pTextExt for each item will be saved in the CMNT_SZNAMEOFDOC comment.

The associated macro is:

L_ImgListSaveDatabase(hWnd, bSelected, pszFilename)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ReadFileComment, L_SetComment, L_WriteFileComment, L_ILM_LOADDATABASE, L_ILM_INSERT
Topics: | Using the ImageList Control Image List Control Messages

Example

HWND hCtl;
HWND hWndFrame;

L_VOID SaveDatabase()
{
L_INT nRet;
OPENFILENAME OFN;
L_TCHAR szFilter[] = {TEXT("TIFF\0") TEXT("*.tif\0\0")};
L_TCHAR szFile[L_MAXPATH] = TEXT("\0");

memset(&OFN, 0, sizeof(OFN));

OFN.lStructSize = sizeof(OPENFILENAME);
OFN.hwndOwner = hWndFrame;
OFN.lpstrFilter = szFilter;
OFN.lpstrCustomFilter = NULL;
OFN.lpstrFile = szFile;
OFN.nMaxFile = sizeof(szFile);
OFN.lpstrFileTitle = NULL;
OFN.lpstrTitle = "Save Database";
OFN.lpstrDefExt = NULL;
OFN.lpfnHook = NULL;

if(GetSaveFileName(&OFN))
{
nRet = SendMessage(hCtl, L_ILM_SAVEDATABASE, (WPARAM)FALSE, (LPARAM)szFile);
if(nRet != SUCCESS)
MessageBox(hWndFrame, TEXT("Error saving file!"), TEXT("Error"), MB_OK);
}
}


L_ILM_SCROLLITEMS

Send this message to scroll the items in the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | Number of rows/columns to scroll.

Returns

<>0 | The actual number or rows/columns scrolled.
0 | Did not scroll or an error occured. Refer to Return Codes.

Comments

Depending on the current setting for the control's ScrollStyle, the specified number or rows or columns will be scrolled if possible. The actual number or rows/columns scrolled will be returned.

The associated macro is:

L_ImgListScrollItems(hWnd, uCount)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSCROLLSTYLE, L_ILM_INSERT, L_ILM_ENSUREVISIBLE, L_ILM_GETPAGE, L_ILM_GETITEMCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc13(HWND hWnd)
{
LRESULT lRet;
L_TCHAR szText[200];

if(IsWindow(hWnd))
{
/* scroll down 2 rows */
lRet = SendMessage(hWnd, L_ILM_SCROLLITEMS, 0, 2L);
wsprintf(szText, TEXT("%ld"), lRet);
MessageBox(hWnd, szText, TEXT("Scroll"), MB_OK);
}
}


L_ILM_SELECTALL

Send this message to set the select flag for all items.

Parameter | Description
wParam | Ignored, use 0.
lParam | Ignored, use 0.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

This message will set the select flag for all items in the ImageList control. If wParam is TRUE, all items will be selected, otherwise all item will be un-selected.

The associated macro is:

L_ImgListSelectAll(hWnd, bFlag)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_CLEAR, L_ILM_SORT, L_ILM_GETITEM, L_ILM_SETITEM, L_ILM_GETSELCOUNT
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc17(HWND hWnd)
{
LRESULT lRet;

if(IsWindow(hWnd))
{
/* deselect all items in the list */
lRet = SendMessage(hWnd, L_ILM_SELECTALL, FALSE, 0L);
}
}


L_ILM_SETBACKCOLOR

Send this message to set the background color of the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | COLORREF value to be used as the new background color of the control.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The associated macro is:

L_ImgListSetBackColor(hWnd, crBack)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETBACKCOLOR, L_ILM_GETBORDERCOLOR, L_ILM_SETBORDERCOLOR, L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_ILM_GETBACKCOLOR.


L_ILM_SETBORDERCOLOR

Send this message to set the border color of the ImageList Control.

Parameter | Description
wParam | Ignored, use 0.
lParam | COLORREF value to be used as the new border color of the control.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The associated macro is:

L_ImgListSetBorderColor(hWnd, crBorder)

Note: Border Color only has an effect when the ImageList Control's window includes the WS_BORDER window style, and does not include the WS_EX_CLIENTEDGE extended window style.

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETBORDERCOLOR, L_ILM_GETBACKCOLOR, L_ILM_SETBACKCOLOR, L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_ILM_GETBORDERCOLOR.


L_ILM_SETDISPLAYFLAGS

Send this message to set the display mode flags to use.

Parameter | Description
wParam | Ignored, use 0.
lParam | The display mode flags to use. For a list of available values, refer to Flags for the L_SetDisplayMode Function.

Returns

>=0 | The number of the currently visible page
< 0 | An error occurred. Refer to Return Codes.

Comments

The associated macro is:

L_ImgListSetDisplayFlags()

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_UINT32 uFlags;
HWND hWnd;
uFlags = L_GetDisplayMode();
SendMessage(hWnd, L_ILM_SETDISPLAYFLAGS, 0, (LPARAM)uFlags);


L_ILM_SETITEM

Send this message to update the specified item in the ImageList Control.

Parameter | Description
WParam | 0-based index of the item to update.
LParam | Pointer to an LILITEM structure that contains new attributes for the item.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The LILITEM structure pointed to by lParam specifies the information to update the specified item with. The uMask member of the LILITEM structure indicates the attributes of the item to update.

You must set the uStructSize member of the LILITEM structure before using this message.

If you are including the LILITEM_BITMAP flag in the uMask member of the LILITEM structure, you must set the uBitmapStructSize member of the LILITEM structure before using this message.

Note: when you update an item, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

The associated macro is:

L_ImgListSetItem(hWnd, uIndex, pItem)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_GETITEM, L_ILM_GETSELCOUNT, L_ILM_GETSELITEMS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc11(HWND hWnd)
{
LILITEM Item;
L_TCHAR szText[200];
SYSTEMTIME st;
BITMAPHANDLE Bitmap;
L_INT nRet;

if(IsWindow(hWnd))
{
/* load new image for the item */
memset(&Item, 0, sizeof(LILITEM));
nRet = L_LoadBitmap(TEXT("d:\\temp\\test2.jpg"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR);
Item.uStructSize = sizeof(LILITEM);
Item.pBitmap = &Bitmap;
Item.uBitmapStructSize = sizeof(BITMAPHANDLE);
Item.pText = szText;
Item.bSelected = TRUE;
Item.lData = 0;

GetSystemTime(&st);
wsprintf(szText, TEXT("%d%d%d"),st.wMinute,st.wSecond,st.wMilliseconds);
/* update all attributes */
Item.uMask = LILITEM_BITMAP | LILITEM_TEXT | LILITEM_SELECTED | LILITEM_DATA;
/* update the 3rd item with the new data */
SendMessage(hWnd, L_ILM_SETITEM, 2, (LPARAM)&Item);
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}


L_ILM_SETITEMOPTIONS

Send this message to set the ImageList Control's item display options.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to LILITEMOPTIONSstructure that contains the new display options to be set.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The ImageList Control will be updated with the settings in the structure pointed to by lParam.

You must set the uStructSize member of the LILITEMOPTIONS structure before using this message.

If you set a font other than the default, you are responsible for creating the font and you are responsible for destroying it when it is no longer needed.

The associated macro is:

L_ImgListSetItemOptions(hWnd, pItemOptions)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMOPTIONS, L_ILM_GETSELOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETITEMOPTIONS.


L_ILM_SETSCROLLSTYLE

Send this message to set the ImageList control's scroll style.

Parameter | Description
wParam | New scroll style, which can be one of the following:
 | SCROLLSTYLE_VERTICAL | [0] scrolling vertically
 | SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontally
lParam | Ignored, use 0. |

Returns

The previous scroll style, which can be one of the following:

SCROLLSTYLE_VERTICAL | [0] scrolling vertically
SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontally

Comments

The associated macro is:

L_ImgListSetScrollStyle(hWnd, uStyle)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSCROLLSTYLE, L_ILM_SCROLLITEMS, L_ILM_ENSUREVISIBLE
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETSCROLLSTYLE.


L_ILM_SETSELBITMAP

Send this message to set the item selection bitmap and transparent color for the ImageList Control.

Parameter | Description
wParam | COLORREF value to be used as the transparent color.
lParam | Pointer to the bitmap to use as the selection bitmap.

Returns

>=0 | The number of the currently visible page
< 0 | An error occurred. Refer to Return Codes.

Comments

Use this message to set a user-defined bitmap to be used to display selected items when the selection style is set to SELECTIONSTYLE_USERBITMAP. The bitmap that you specify will be drawn with the specified color as transparent, and will be centered around each selected item.

The associated macro is:

L_ImgListSetSelBitmap

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Functions: | L_ILM_SETSELOPTIONS, L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages
 | Using Color Values in LEADTOOLS

Example

HINSTANCE hInst;

/* this sample loads a bitmap from a resource as a DDB,
converts it to a DDB, and then sets that as the selection bitmap */
L_VOID TestFunc(HWND hWnd, HWND hCtl)
{
HBITMAP hBitmap=NULL;
BITMAPHANDLE Bitmap;
HDC hDC=NULL;
LILSELOPTION Opt;

if(IsWindow(hCtl))
{
/* get current selection options */
SendMessage(hCtl, L_ILM_GETSELOPTIONS, 0, (LPARAM)&Opt);

hBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FLAG));
if(hBitmap)
{
hDC = GetDC(hWnd);
if(L_ConvertFromDDB(hDC, &Bitmap, sizeof(BITMAPHANDLE), hBitmap, NULL)==SUCCESS)
{
SendMessage(hCtl, L_ILM_SETSELBITMAP, (WPARAM)RGB(0,255,0), (LPARAM)&Bitmap);
L_FreeBitmap(&Bitmap);
}
DeleteObject(hBitmap);
ReleaseDC(hWnd, hDC);
}
Opt.uSelectionStyle = SELECTIONSTYLE_USERBITMAP;
SendMessage(hCtl, L_ILM_SETSELOPTIONS, 0, (LPARAM)&Opt);
RedrawWindow(hCtl, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}
}


L_ILM_SETSELOPTIONS

Send this message to set the ImageList Control's selection options.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to LILSELOPTION structure that contains new options to be set.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

The ImageList Control will be updated with the settings in the structure pointed to by lParam.

You must set the uStructSize member of the LILSELOPTION structure before using this message.

The associated macro is:

L_ImgListSetSelOptions(hWnd, pSelOptions)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETSELOPTIONS, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

For an example, refer to L_ILM_GETSELOPTIONS message


L_ILM_SORT

Send this message to sort the items in the ImageList Control based on their text attribute.

Parameter | Description
wParam | Boolean flag, TRUE to sort ascending, FALSE to sort descending.
lParam | Ignored, use 0.

Returns

SUCCESS | Function was successful
< 0 | An error occurred. Refer to Return Codes.

Comments

If wParam is TRUE, items will be sorted in ascending order, otherwise, items will be sorted in descending order.

The associated macro is:

L_ImgListSort(hWnd, bAscending)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_GETITEMCOUNT, L_ILM_CLEAR
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestFunc12(HWND hWnd)
{
if(IsWindow(hWnd))
{
/* sort items ascending */
SendMessage(hWnd, L_ILM_SORT, (WPARAM)TRUE, 0L);
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE);
}
}


L_ILM_SORTEXT

Send this message to sort the items in the ImageList Control based on their text or Extended Text attributes referenced in the pTextExt member of the LILITEM structure.

Parameter | Description
wParam | Ignored, use 0.
lParam | Pointer to the LILSORTOPTIONS structure that contains the sorting options to be used.

Returns

SUCCESS | Function was successful.
<0 | An error occurred. Refer to Error Codes.

Comments

The ImageList Control items will be sorted according to the options in the structure pointed to by lParam.

You must set the uStructSize member of the LILSORTOPTIONS structure before using this message.

The associated macro is:

L_ImgListSortExt(hWnd, pSortOptions)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements: | L_ILM_SORT, L_ILM_GETITEMCOUNT, L_ILM_CLEAR
Topics: | Using the ImageList Control
 | Image List Control Messages

Example

L_VOID TestSortExt(HWND hWnd)
{
if(IsWindow(hWnd))
{
LILSORTOPTIONS SortOptions;

ZeroMemory(&SortOptions, sizeof(LILSORTOPTIONS));
SortOptions.uStructSize = sizeof(LILSORTOPTIONS);
SortOptions.bAscending = TRUE;
SortOptions.bCaseSensitive = TRUE;
SortOptions.bUseExtText = FALSE;

/* sort items in Ascending, case Sensitive, and using Text string */
SendMessage(hWnd, L_ILM_SORTEXT, (WPARAM)0, (LPARAM)(&SortOptions));
/* update the control */
RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}
}


L_ILN_CLICKED

Sent when the user clicks a mouse button in the ImageList Control's client area.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | pClick = (pLILCLICK) lParam pointer to click info structure.

Comments

Sent when the user clicks a mouse button in the ImageList Control's client area. pClick contains the mouse position of the click event.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;
L_TCHAR buf[300];
pLILCLICK pClick;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_CLICKED:
pClick = (pLILCLICK)lParam;
wsprintf(buf, TEXT("x: %ld, y: %ld"), pClick->xPos, pClick->yPos);
MessageBox(hWnd, buf, TEXT("Clicked"), MB_OK);
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_DBLCLCK

Sent when the user double-clicks a mouse button in the ImageList Control's client area.

Parameter | Description
WParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control
 | wNotifyCode = HIWORD(wParam) notification code
LParam | pClick = (pLILCLICK) lParam pointer to click info structure

Comments

Sent when the user double-clicks a mouse button in the ImageList Control's client area. pClick contains the mouse position of the click event.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;
L_TCHAR buf[300];
pLILCLICK pClick;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_DBLCLCK:
pClick = (pLILCLICK)lParam;
wsprintf(buf, TEXT("x: %ld, y: %ld"), pClick->xPos, pClick->yPos);
MessageBox(hWnd, buf, TEXT("Double-Clicked"), MB_OK);
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_DROPFILES

Sent when files are dropped onto an ImageList Control (for example from Explorer).

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | pszFilename = (L_CHAR L_FAR*) lParam pointer to the file that was dropped.

Comments

The parent window of the ImageList will get one L_ILN_DROPFILES notification for each file that is dropped onto the ImageList Control when the control has L_ILS_ACCEPTDROPFILES set.

See Also

Elements: | L_ILN_DROPFILES
Topics: | Using the ImageList Control Image List Control Command Notifications

Example

/* NOTE this is not a complete sample, and is meant only to
show you a way in which this message can be used */
case IDC_LEADIMAGELIST:
if(HIWORD(wParam) == L_ILN_DROPFILES)
{
if(lParam)
{
BITMAPHANDLE Bitmap;
LILITEM Item;
L_INT nResult;
THUMBOPTIONS to;

to.nWidth = 80;
to.nHeight = 80;
to.nBits = 24;
to.uCRFlags = 0;
to.bMaintainAspect = TRUE;
to.bForceSize = FALSE;
to.crBackColor = 0;
to.bLoadStamp = FALSE;
to.bResample = TRUE;

nResult = L_CreateThumbnailFromFile((L_TCHAR L_FAR*)lParam,
&Bitmap, &to,
NULL, NULL, NULL, NULL);
if(nResult == SUCCESS)
{
Item.lStructSize = sizeof(LILITEM);
Item.pText = (L_TCHAR L_FAR*)lParam;
Item.uMask = LILITEM_BITMAP | LILITEM_TEXT;
Item.pBitmap = &Bitmap;
L_ImgListInsert(hCtl, &Item);
}
}
}


L_ILN_HSCROLL

Sent when the user scrolls the ImageList Control’s contents using the horizontal scrollbar.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control
 | wNotifyCode = HIWORD(wParam) notification code
lParam | hWndCtrl = (HWND) lParam handle of the control

Comments

Sent when the user scrolls the ImageList Control’s contents using the horizontal scrollbar.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_HSCROLL:
MessageBox(hWnd, TEXT("Horizontal Scroll"), TEXT("Notify"), MB_OK);
break;
case L_ILN_VSCROLL:
MessageBox(hWnd, TEXT("Vertical Scroll"), TEXT("Notify"), MB_OK);
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_ITEMSEL

Sent when the user selects an item in the ImageList Control.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | pItemSel = (pLILITEMSEL) lParam pointer to item selection info structure.

Comments

Sent when the user selects an item in the ImageList Control. pItemSel contains information about the item that was selected.

The parent window of the control receives this notification message through the WM_COMMAND message.

Note: If you are subclassing the ImageList Control window, you can use the L_ILM_ITEMSELECTED message to get item selection notifications.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_ITEMSEL, L_ILN_DBLCLCK, L_ILM_ITEMSELECTED, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;
L_TCHAR buf[300];
pLILCLICK pClick;
pLILITEMSEL pItemSel;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_ITEMSEL:
pItemSel = (pLILITEMSEL)lParam;
if(pItemSel);
{
wsprintf(buf, TEXT("Item: %ld"), pItemSel->lIndex);
MessageBox(hWnd, buf, TEXT("Selected"), MB_OK);
}
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_ITEMUNSEL

Sent when the user unselects one or more items in the ImageList Control.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | pItemSel = (pLILITEMSEL) lParam pointer to item selection info structure..

Comments

Sent when the user unselects one or more items in the ImageList Control. pItemSel contains information about the item that was unselected.

The parent window of the control receives this notification message through the WM_COMMAND message.

Note: If you are subclassing the ImageList Control window, you can use the L_ILM_ITEMUNSELECTED message to get item unselection notifications.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_KEYDOWN, L_ILM_ITEMSELECTED, L_ILM_ITEMUNSELECTED
Topics: | Using the ImageList Control Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;
L_TCHAR buf[300];
pLILCLICK pClick;
pLILITEMSEL pItemSel;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_ITEMUNSEL:
pItemSel = (pLILITEMSEL)lParam;
if(pItemSel);
{
wsprintf(buf, TEXT("Item: %ld"), pItemSel->lIndex);
MessageBox(hWnd, buf, TEXT("UnSelected"), MB_OK);
}
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_KEYDOWN

Sent when the user presses a key while the ImageList Control has the focus.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | pKeyInfo = (pLILKEYDOWN) lParam pointer to key info structure.

Comments

Sent when the user presses a key while the ImageList Control has the focus. pKeyInfo contains information about the key that was pressed.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILM_ITEMSELECTED
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;
L_TCHAR buf[300];

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
/* other code here */
case L_ILN_KEYDOWN:
MessageBox(hWnd, TEXT("KeyPress"), TEXT("KeyPress"), MB_OK);
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_KILLFOCUS

Sent when an ImageList Control loses the keyboard focus.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | hWndCtrl = (HWND) lParam handle of the control.

Comments

Sent when an ImageList Control loses the keyboard focus.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

For an example, refer to L_ILN_SETFOCUS.


L_ILN_LOADDBSTATUS

Sent during an ImageList Control load database procedure started by the L_ILM_LOADDATABASE message.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | nIndex = (L_INT32) lParam index of the newly added item.

Comments

Sent when an ImageList Control is processing an L_ILM_LOADDATABASE message.

The parent window of the control receives this notification message through the WM_COMMAND message. During the processing of this message, you can cancel the procedure using the L_ILM_CANCELDB message.

See Also

Elements: | L_ILN_SAVEDBSTATUS, L_ILM_LOADDATABASE, L_ILM_SAVEDATABASE, L_ILM_CANCELDB
Topics: | Using the ImageList Control Image List Control Command Notifications

Example

For an example, refer to L_ILM_CANCELDB.


L_ILN_SAVEDBSTATUS

Sent during an ImageList Control load database procedure started by the L_ILM_SAVEDATABASE message.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | nIndex = (L_INT32) lParam page number that was added to the file.

Comments

Sent when an ImageList Control is processing an L_ILM_SAVEDATABASE message.

The parent window of the control receives this notification message through the WM_COMMAND message. During the processing of this message, you can cancel the procedure using the L_ILM_CANCELDB message.

See Also

Elements: | L_ILN_LOADDBSTATUS, L_ILM_LOADDATABASE, L_ILM_SAVEDATABASE, L_ILM_CANCELDB
Topics: | Using the ImageList Control Image List Control Command Notifications

Example

For an example, refer to L_ILM_CANCELDB.


L_ILN_SETFOCUS

Sent when an ImageList Control receives the keyboard focus.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control.
 | wNotifyCode = HIWORD(wParam) notification code.
lParam | hWndCtrl = (HWND) lParam handle of the control.

Comments

Sent when an ImageList Control receives the keyboard focus.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

/* this function processes all the messages for a window */
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
WORD wNotifyCode;
L_INT idCtl;
HWND hWndCtrl;

switch (Message)
{
case WM_SETFOCUS:
if(hCtl)
SetFocus(hCtl);
break;
case WM_COMMAND:
wNotifyCode = HIWORD(wParam); // notification code
idCtl = LOWORD(wParam); // item, control, or accelerator identifier
hWndCtrl = (HWND) lParam; // handle of control
switch(idCtl)
{
case IDC_LEADIMAGELIST:
switch(wNotifyCode)
{
case L_ILN_SETFOCUS:
MessageBeep(MB_OK);
break;
case L_ILN_KILLFOCUS:
MessageBeep(MB_ICONEXCLAMATION);
break;
/* other code here */
}
break;
/* other code here */
}
break;
/* other code here */
}
return DefWindowProc (hWnd, Message, wParam, lParam);
}


L_ILN_VSCROLL

Sent when the user scrolls the ImageList Control’s contents using the vertical scrollbar.

Parameter | Description
wParam | idCtrl = (L_INT) LOWORD(wParam) identifier of control
 | wNotifyCode = HIWORD(wParam) notification code
lParam | hWndCtrl = (HWND) lParam handle of the control

Comments

Sent when the user scrolls the ImageList Control’s contents using the vertical scrollbar.

The parent window of the control receives this notification message through the WM_COMMAND message.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_CLICKED, L_ILN_DBLCLCK, L_ILN_ITEMSEL, L_ILN_ITEMUNSEL, L_ILN_KEYDOWN
Topics: | Using the ImageList Control
 | Image List Control Command Notifications

Example

For an example, refer to L_ILN_HSCROLL.


Control Messages and Styles

Window Messages and Styles

L_BITMAPCLASS Registered Class

Window Styles

Input and Output

Getting Bitmap Information

Creation, Deletion, and Copying

Palettes

Displaying and Printing

Image Processing

Detecting Events

LTIMGLISTCLASS Registered Class

Styles

Detecting Events

Getting/Setting Options

Getting ImageList Information

Scrolling

Modifying the ImageList

Annotation Event Message (Document/Medical only)

WM_LTANNEVENT message


WM_LTANNEVENT Message

WM_LTANNEVENT Message (Document/Medical only)

When received, the WM_LTANNEVENT message indicates that an annotation event has occurred. The message parameters contain the following information:

wParam contains one of the following constants:

LTANNEVENT_ACTIVATE

[3] Indicates that an activation event was triggered by the L_AnnSetActiveState function. Only the automation, audio clip, button, and hot spot objects generate activation events.

LTANNEVENT_DEACTIVATE

[4] Indicates that a dectivation event was triggered by the L_AnnSetActiveState function. Only the automation, audio clip, button, and hot spot objects generate activation events.

LTANNEVENT_AUTOCLICKED

[9] Indicates that the user has clicked a button or hot spot object in run mode using the automated features.

LTANNEVENT_TOOLCREATE

[1] Indicates that the annotation toolbar, used for automation, has been created.

LTANNEVENT_TOOLDESTROY

[2] Indicates that the annotation toolbar, used for automation, has been destroyed.

LTANNEVENT_TOOLCHECKED

[0] Indicates that the user has selected a different tool on the toolbar.

LTANNEVENT_INSERT

[5] Indicates that an annotation object has been inserted into a container. The L_AnnInsert function generates this message, but it does so only if the specified container has a window handle. (This is not an issue in automation mode.)

LTANNEVENT_REMOVE

[6] Indicates that an annotation object is being removed from a container. You can use this message in automation mode to detect the deletion of an object, because objects are removed from the container before they are deleted.

LTANNEVENT_AUTOBEGINSET

[7] Indicates that the user has begun drawing an object. This event occurs before the first call to the L_AnnDefine function.

LTANNEVENT_AUTOENDSET

[8] Indicates that the user has finished drawing an object. This event occurs after the last call to the L_AnnDefine function.

LTANNEVENT_AUTOCHANGED

[10] Occurs when the coordinates of an annotation object changes in automation mode.

LTANNEVENT_AUTOITEMCHANGED

[11] Occurs when any property of an annotation object changes in automation mode.

LTANNEVENT_AUTOSELECT

[12] Occurs when the Selected property of an annotation object changes in automation mode.

LTANNEVENT_LOCKED

[13] Indicates the object has been locked.

LTANNEVENT_UNLOCKED

[14] Indicates the object has been unlocked.

LTANNEVENT_HYPERLINK

[15] Indicates that an object with a hyperlink of type ANNLINK_LTANNEVENT has been clicked. THis is in run mode only.

LTANNEVENT_HYPERLINKMENU

[16] Indicates the Hyperlink menu item has been activated for an object or a group of objects. (design mode only) In this case, if there are selected objects, then the hyperlink is meant to be for all objects. If there are no selected objects, the hyperlink is intended for the automation menu. When receiving this automation event, you have to bring up a dialog box or provide the means to set the desired type of hyperlink for the specified object(s).

LTANNEVENT_LBUTTONDOWN

[17] Indicates that the left mouse button has been pressed in design mode. The user can change the mouse position or the key flags (so it can simulate that a certain key is pressed).

LTANNEVENT_MOUSEMOVE

[18] Indicates that the mouse is moving in design mode. Note that there is no guarantee that the left mouse button is pressed. lParam is a pointer to an ANNMOUSEPOS structure.

LTANNEVENT_LBUTTONUP

[19] Indicates that the left mouse button has been depressed in design mode.

LTANNEVENT_MENU

[20] Allows you to add user-defined menus that can be displayed in automation design mode. When the right mouse button is clicked in design mode, a popup menu is displayed. Menu items can be added to that menu. The commands should be in the range LTANNEVENT_MENUFIRST [256] to LTANNEVENT_MENULAST [511] inclusively. For more information, refer to the Comments section below.

LParam contains the handle to the popup menu about to be displayed. The menu can be changed using the Windows API menu functions (Append Menu, CreatePopupMenu, etc.)

LTANNEVENT_AUTOITEMCHANGING

Indicates that changes are about to occur. Everything that can be done in annotation automated mode sends two messages. Both messages are sent via _LTANNEVENT with wParam equal to LTANNEVENT_AUTOITEMCHANGING. The lParam argument points to a structure of type ANNCHANGEPARAM. The ANNCHANGEPARAM structure has a field called nChange.

1. One message is sent before the action is done. Setting the nChange field to SUCCESS_NO_CHANGE prevents the change, and cancels the "after" event. Returning SUCCESS_CHANGE allows both the change to take place, and the ‘after’ message to be sent.

2. A second messages is sent after the action is done. The return value of this message is ignored.

LTANNEVENT_HIGHLIGHT

[27] Indicates that part or all of the annotation object (EXCEPT for the rotated ellipse, protractor, ruler, and cross product objects, which do not send this message) is about to be drawn with a highlight. This can occur due to selecting the object, changing the object using automation, or changing the object by making calls to L_AnnDefine. The lParam argument points to a variable of type pANNHILIGHT.

This message gets sent for all objects EXCEPT:

Rotated Ellipse--does not get fired if ellipse is rotated

Protractor

Ruler

Cross product

The highlight behavior can be customized by changing the ppts array. For example, if the annotation object is a rectangle, uCount will be 4 and ppts will be an array of four coordinates (client coordinates) that correspond the corners of the rectangle. Modifying the four points will change the way the rectangle is highlighted.

This message is also useful for updating information about an annotation in real time.

For example, if you are doing a resize/rotate on a rectangle, you can use this event to display the size and angle as it changes.

LTANNEVENT_MENUFIRST

[256]

LTANNEVENT_MENULAST

[511] User defined menu. Refer to the Comments section below.

lParam contains one of the following:

The handle to the annotation object.

Or, if the message is from the toolbar, one of the Annotation Toolbar Button constants.

Or the menu handle (LTANNEVENT_MENU).

Or a pointer to an ANNCHANGEPARAM structure (LTANNEVENT_AUTOCHANGING).

Or a pointer to an ANNMOUSEPOS structure (LTANNEVENT_LBUTTONDOWN, LTANNEVENT_MOUSENOVE, etc.).

Or a pointer to an ANNHILIGHT structure (LTANNEVENT_HIGHLIGHT).

Comments:

For all notifications in the LTANNEVENT_MENUFIRST to LTANNEVENT_MENULAST range, lParam is the handle to the selected object or the automation object. The process works as follows:

1. | When the right mouse button is clicked in design mode, the automation menu is displayed. Before it is displayed however, the WM_LTANNEVENT message is sent with the LTANNEVENT_MENU notification.
2. | At this point the menu handle can be changed and menu items can be added to it. The command IDs must be between LTANNEVENT_MENUFIRST and LTANNEVENT_MENULAST. After the WM_LTANNEVENT message is processed, the modified menu is displayed.
3. | If a standard automation menu item is selected (Undo, Delete, Copy, etc.), the command is processed automatically, and the LTANNEVENT_AUTOITEMCHANGED or LTANNEVENT_AUTOCHANGED notifications are sent.
4. | If a user defined menu item is selected, the WM_LTANNEVENT message is sent with wParam containing the selected command ID. The lParam contains the handle to the object(s) selected. LParam can have the following values:
 | a. | The handle to the automation object.
 |  | In one case no objects are selected and you should change some properties of the automation object.
 |  | In the other case one or more objects are selected and you should change the selected object(s).
 | b. | The handle to a selected object. In this case you should change the selected object.

You can add submenus by calling CreatePopupMenu and AddMenu. Menu items are generally different, depending on the object selected.

The default automation menus send LTANNEVENT_AUTOITEMCHANGED and LTANNEVENT_AUTOCHANGED notifications. If your program relies on them, make sure you send LTANNEVENT_AUTOITEMCHANGED to every object with changed properties, and LTANNEVENT_AUTOCHANGED to every object with changed coordinates.

If you create a Popup menu and add it to the automation menu, it will be destroyed automatically when the window goes away. Do not destroy the menu after adding it to the automation menu.

Example

// The following example is a function that can be used to display all the annotation events
// To use this, call the function
// L_VOID DebugLtAnnEvent(int nID, LPARAM lParam)
// in your annotation program when processing the WM_LTANNEVENT message.
// Pass wParam for the first argument, and lParam for the second argument.

L_TCHAR *aChangeToString[ANNCHANGE_LAST];

L_TCHAR *annGetObjectString(L_UINT uObjectType)
{
L_TCHAR *pszType = TEXT("Unknown");
switch(uObjectType)
{
case ANNOBJECT_CONTAINER:
pszType = TEXT("ANNOBJECT_CONTAINER");
break;

case ANNOBJECT_POINTER:
pszType = TEXT("ANNOBJECT_POINTER");
break;

case ANNOBJECT_AUDIO:
pszType = TEXT("ANNOBJECT_AUDIO");
break;

case ANNOBJECT_BUTTON:
pszType = TEXT("ANNOBJECT_BUTTON");
break;

case ANNOBJECT_ELLIPSE:
pszType = TEXT("ANNOBJECT_ELLIPSE");
break;

case ANNOBJECT_FREEHAND:
pszType = TEXT("ANNOBJECT_FREEHAND");
break;

case ANNOBJECT_HILITE:
pszType = TEXT("ANNOBJECT_HILITE");
break;

case ANNOBJECT_HOTSPOT:
pszType = TEXT("ANNOBJECT_HOTSPOT");
break;

case ANNOBJECT_LINE:
pszType = TEXT("ANNOBJECT_LINE");
break;

case ANNOBJECT_NOTE:
pszType = TEXT("ANNOBJECT_NOTE");
break;

case ANNOBJECT_POLYGON:
pszType = TEXT("ANNOBJECT_POLYGON");
break;

case ANNOBJECT_POLYLINE:
pszType = TEXT("ANNOBJECT_POLYLINE");
break;

case ANNOBJECT_RECT:
pszType = TEXT("ANNOBJECT_RECT");
break;

case ANNOBJECT_REDACT:
pszType = TEXT("ANNOBJECT_REDACT");
break;

case ANNOBJECT_STAMP:
pszType = TEXT("ANNOBJECT_STAMP");
break;

case ANNOBJECT_TEXT:
pszType = TEXT("ANNOBJECT_TEXT");
break;

case ANNOBJECT_AUTOMATION:
pszType = TEXT("ANNOBJECT_AUTOMATION");
break;

case ANNOBJECT_RULER:
pszType = TEXT("ANNOBJECT_RULER");
break;

case ANNOBJECT_CROSSPRODUCT:
pszType = TEXT("ANNOBJECT_CROSSPRODUCT");
break;

case ANNOBJECT_POINT:
pszType = TEXT("ANNOBJECT_POINT");
break;

case ANNOBJECT_PROTRACTOR:
pszType = TEXT("ANNOBJECT_PROTRACTOR");
break;

case ANNOBJECT_VIDEO:
pszType = TEXT("ANNOBJECT_VIDEO");
break;

case ANNOBJECT_PUSHPIN:
pszType = TEXT("ANNOBJECT_PUSHPIN");
break;

case ANNOBJECT_FREEHANDHOTSPOT:
pszType = TEXT("ANNOBJECT_FREEHANDHOTSPOT");
break;

case ANNOBJECT_CURVE:
pszType = TEXT("ANNOBJECT_CURVE");
break;

case ANNOBJECT_CURVECLOSED:
pszType = TEXT("ANNOBJECT_CURVECLOSED");
break;

case ANNOBJECT_ENCRYPT:
pszType = TEXT("ANNOBJECT_ENCRYPT");
break;
}
return pszType;
}

L_VOID LoadChangeToStringTable()
{
aChangeToString[ANNCHANGE_TAG] = TEXT("ANNCHANGE_TAG");
aChangeToString[ANNCHANGE_VISIBLE] = TEXT("ANNCHANGE_VISIBLE");
aChangeToString[ANNCHANGE_SELECTED] = TEXT("ANNCHANGE_SELECTED");
aChangeToString[ANNCHANGE_FONT_BOLD] = TEXT("ANNCHANGE_FONT_BOLD");
aChangeToString[ANNCHANGE_FONT_ITALIC] = TEXT("ANNCHANGE_FONT_ITALIC");
aChangeToString[ANNCHANGE_FONT_STRIKETHROUGH] = TEXT("ANNCHANGE_FONT_STRIKETHROUGH");
aChangeToString[ANNCHANGE_FONT_UNDERLINE] = TEXT("ANNCHANGE_FONT_UNDERLINE");
aChangeToString[ANNCHANGE_LINEWIDTH] = TEXT("ANNCHANGE_LINEWIDTH");
aChangeToString[ANNCHANGE_LINESTYLE] = TEXT("ANNCHANGE_LINESTYLE");
aChangeToString[ANNCHANGE_FILLPATTERN] = TEXT("ANNCHANGE_FILLPATTERN");
aChangeToString[ANNCHANGE_FILLMODE] = TEXT("ANNCHANGE_FILLMODE");
aChangeToString[ANNCHANGE_POLYFILLMODE] = TEXT("ANNCHANGE_POLYFILLMODE");
aChangeToString[ANNCHANGE_FONT_SIZE] = TEXT("ANNCHANGE_FONT_SIZE");
aChangeToString[ANNCHANGE_FORECOLOR] = TEXT("ANNCHANGE_FORECOLOR");
aChangeToString[ANNCHANGE_BACKCOLOR] = TEXT("ANNCHANGE_BACKCOLOR");
aChangeToString[ANNCHANGE_TRANSPARENT_COLOR] = TEXT("ANNCHANGE_TRANSPARENT_COLOR");
aChangeToString[ANNCHANGE_TRANSPARENT] = TEXT("ANNCHANGE_TRANSPARENT");
aChangeToString[ANNCHANGE_FONT_NAME] = TEXT("ANNCHANGE_FONT_NAME");
aChangeToString[ANNCHANGE_TEXT] = TEXT("ANNCHANGE_TEXT");
aChangeToString[ANNCHANGE_ROP2] = TEXT("ANNCHANGE_ROP2");
aChangeToString[ANNCHANGE_BITMAP] = TEXT("ANNCHANGE_BITMAP");
aChangeToString[ANNCHANGE_BITMAP2] = TEXT("ANNCHANGE_BITMAP2");
aChangeToString[ANNCHANGE_METAFILE] = TEXT("ANNCHANGE_METAFILE");
aChangeToString[ANNCHANGE_METAFILE2] = TEXT("ANNCHANGE_METAFILE2");
aChangeToString[ANNCHANGE_NAME_FORECOLOR] = TEXT("ANNCHANGE_NAME_FORECOLOR");
aChangeToString[ANNCHANGE_NAME_BACKCOLOR] = TEXT("ANNCHANGE_NAME_BACKCOLOR");
aChangeToString[ANNCHANGE_NAME_SHOWNAME] = TEXT("ANNCHANGE_NAME_SHOWNAME");
aChangeToString[ANNCHANGE_NAME_OFFSET] = TEXT("ANNCHANGE_NAME_OFFSET");

aChangeToString[ANNCHANGE_NAME_RESTRICT] = TEXT("ANNCHANGE_NAME_RESTRICT");
aChangeToString[ANNCHANGE_NAME_BACKTRANSPARENT] = TEXT("ANNCHANGE_NAME_BACKTRANSPARENT");
aChangeToString[ANNCHANGE_NAME_TEXT] = TEXT("ANNCHANGE_NAME_TEXT");
aChangeToString[ANNCHANGE_NAME_FONT_NAME] = TEXT("ANNCHANGE_NAME_FONT_NAME");
aChangeToString[ANNCHANGE_NAME_FONT_BOLD] = TEXT("ANNCHANGE_NAME_FONT_BOLD");
aChangeToString[ANNCHANGE_NAME_FONT_ITALIC] = TEXT("ANNCHANGE_NAME_FONT_ITALIC");
aChangeToString[ANNCHANGE_NAME_FONT_STRIKEOUT] = TEXT("ANNCHANGE_NAME_FONT_STRIKEOUT");
aChangeToString[ANNCHANGE_NAME_FONT_UNDERLINE] = TEXT("ANNCHANGE_NAME_FONT_UNDERLINE");
aChangeToString[ANNCHANGE_NAME_FONT_SIZE] = TEXT("ANNCHANGE_NAME_FONT_SIZE");
aChangeToString[ANNCHANGE_POINT_USE_BITMAP] = TEXT("ANNCHANGE_POINT_USE_BITMAP");
aChangeToString[ANNCHANGE_POINT_RADIUS] = TEXT("ANNCHANGE_POINT_RADIUS");
aChangeToString[ANNCHANGE_POINT_BORDER_COLOR] = TEXT("ANNCHANGE_POINT_BORDER_COLOR");
aChangeToString[ANNCHANGE_POINT_FILL_COLOR] = TEXT("ANNCHANGE_POINT_FILL_COLOR");
aChangeToString[ANNCHANGE_POINT_TRANSPARENT_FILL] = TEXT("ANNCHANGE_POINT_TRANSPARENT_FILL");
aChangeToString[ANNCHANGE_POINT_FIXED_SIZE] = TEXT("ANNCHANGE_POINT_FIXED_SIZE");
aChangeToString[ANNCHANGE_SHOW_DEFAULT_HANDLES] = TEXT("ANNCHANGE_SHOW_DEFAULT_HANDLES");
aChangeToString[ANNCHANGE_GAP_DEFAULT_HANDLES] = TEXT("ANNCHANGE_GAP_DEFAULT_HANDLES");
aChangeToString[ANNCHANGE_HYPERLINK] = TEXT("ANNCHANGE_HYPERLINK");
aChangeToString[ANNCHANGE_GAUGELENGTH] = TEXT("ANNCHANGE_GAUGELENGTH");
aChangeToString[ANNCHANGE_BITMAP_DPI_X] = TEXT("ANNCHANGE_BITMAP_DPI_X");
aChangeToString[ANNCHANGE_BITMAP_DPI_Y] = TEXT("ANNCHANGE_BITMAP_DPI_Y");
aChangeToString[ANNCHANGE_RULER_UNIT] = TEXT("ANNCHANGE_RULER_UNIT");
aChangeToString[ANNCHANGE_RULER_SHOW_FLAGS] = TEXT("ANNCHANGE_RULER_SHOW_FLAGS");
aChangeToString[ANNCHANGE_PROTRACTOR] = TEXT("ANNCHANGE_PROTRACTOR");
aChangeToString[ANNCHANGE_ENCRYPTOR_TYPE] = TEXT("ANNCHANGE_ENCRYPTOR_TYPE");
aChangeToString[ANNCHANGE_ENCRYPTOR_KEY] = TEXT("ANNCHANGE_ENCRYPTOR_KEY");
aChangeToString[ANNCHANGE_ENCRYPTOR_NEVER_ENCRYPTED] = TEXT("ANNCHANGE_ENCRYPTOR_NEVER_ENCRYPTED");
aChangeToString[ANNCHANGE_ENCRYPTOR_BITMAP] = TEXT("ANNCHANGE_ENCRYPTOR_BITMAP");
aChangeToString[ANNCHANGE_MOVE] = TEXT("ANNCHANGE_MOVE");
aChangeToString[ANNCHANGE_MOVE_POINT] = TEXT("ANNCHANGE_MOVE_POINT");
aChangeToString[ANNCHANGE_RESIZE] = TEXT("ANNCHANGE_RESIZE");
aChangeToString[ANNCHANGE_ROTATE] = TEXT("ANNCHANGE_ROTATE");
aChangeToString[ANNCHANGE_RESIZE_ROTATE] = TEXT("ANNCHANGE_RESIZE_ROTATE");
aChangeToString[ANNCHANGE_UNDO] = TEXT("ANNCHANGE_UNDO");
aChangeToString[ANNCHANGE_CUT] = TEXT("ANNCHANGE_CUT");
aChangeToString[ANNCHANGE_PASTE] = TEXT("ANNCHANGE_PASTE");
aChangeToString[ANNCHANGE_DELETE] = TEXT("ANNCHANGE_DELETE");
aChangeToString[ANNCHANGE_SELECT_ALL] = TEXT("ANNCHANGE_SELECT_ALL");
aChangeToString[ANNCHANGE_BRING_TO_FRONT] = TEXT("ANNCHANGE_BRING_TO_FRONT");
aChangeToString[ANNCHANGE_BRING_TO_BACK] = TEXT("ANNCHANGE_BRING_TO_BACK");
aChangeToString[ANNCHANGE_LOCK] = TEXT("ANNCHANGE_LOCK");
aChangeToString[ANNCHANGE_UNLOCK] = TEXT("ANNCHANGE_UNLOCK");
aChangeToString[ANNCHANGE_LOCK_SELECTED] = TEXT("ANNCHANGE_LOCK_SELECTED");
aChangeToString[ANNCHANGE_UNLOCK_SELECTED] = TEXT("ANNCHANGE_UNLOCK_SELECTED");
aChangeToString[ANNCHANGE_INSERT] = TEXT("ANNCHANGE_INSERT");
aChangeToString[ANNCHANGE_NOTE_BACKCOLOR] = TEXT("ANNCHANGE_NOTE_BACKCOLOR");
aChangeToString[ANNCHANGE_HILITE_BACKCOLOR] = TEXT("ANNCHANGE_HILITE_BACKCOLOR");
aChangeToString[ANNCHANGE_REDACT_BACKCOLOR] = TEXT("ANNCHANGE_REDACT_BACKCOLOR");
aChangeToString[ANNCHANGE_ENCRYPT_METAFILE] = TEXT("ANNCHANGE_ENCRYPT_METAFILE");
aChangeToString[ANNCHANGE_DECRYPT_METAFILE] = TEXT("ANNCHANGE_DECRYPT_METAFILE");
aChangeToString[ANNCHANGE_HOTSPOT_METAFILE] = TEXT("ANNCHANGE_HOTSPOT_METAFILE");
}

L_INT DebugLtAnnEvent_AutoItemChanging(HANNOBJECT hObject, L_TCHAR szMsg[], LPARAM lParam)
{
pANNCHANGEPARAM pAnnChangeParam = (pANNCHANGEPARAM)lParam;
L_UINT uType;
L_TCHAR szTemp[200];

L_AnnGetType(hObject, &uType);

wsprintf(szMsg, TEXT("LTANNEVENT_AUTOITEMCHANGING: uChange[%25s] "), aChangeToString[pAnnChangeParam->uChange]);
switch (pAnnChangeParam->uUnionType)
{
case ANNTYPE_NONE:
lstrcpy(szTemp, TEXT(""));
break;

case ANNTYPE_COLORREF:
wsprintf(szTemp, TEXT("crColor[0x%x]"), pAnnChangeParam->u.crColor);
break;

case ANNTYPE_UINT32:
wsprintf(szTemp, TEXT("uUint32[%d]"), pAnnChangeParam->u.uUint32);
break;

case ANNTYPE_BOOL:
wsprintf(szTemp, TEXT("bBool[%s]"), pAnnChangeParam->u.bBool ? TEXT("TRUE") : TEXT("FALSE"));
break;

case ANNTYPE_DOUBLE:
wsprintf(szTemp, TEXT("dDouble[%f]"), pAnnChangeParam->u.dDouble);
break;

case ANNTYPE_UINT:
wsprintf(szTemp, TEXT("uUint[%d]"), pAnnChangeParam->u.uUint);
break;

case ANNTYPE_LPCSTR:
wsprintf(szTemp, TEXT("pszString[%s]"), pAnnChangeParam->u.pszString);
break;

case ANNTYPE_ANNPOINT:
wsprintf(szTemp, TEXT("apt[%f, %f]"), pAnnChangeParam->u.apt.x, pAnnChangeParam->u.apt.y);
break;

case ANNTYPE_BITMAP:
wsprintf(szTemp, TEXT("pBitmapHandle Width[%d] Height[%d] BitsPerPixel[%d]"),
pAnnChangeParam->u.pBitmapHandle->Width,
pAnnChangeParam->u.pBitmapHandle->Height,
pAnnChangeParam->u.pBitmapHandle->BitsPerPixel
);
break;

case ANNTYPE_HMETAFILE:
wsprintf(szTemp, TEXT("hMetafile [0x%x]"), pAnnChangeParam->u.hMetafile);
break;

case ANNTYPE_RULER_UNIT:
{
L_TCHAR *pszUnit;
switch(pAnnChangeParam->u.AnnRulerUnit.uUnit)
{
case ANNUNIT_INCHES:
pszUnit = TEXT("ANNUNIT_INCHES");
break;
case ANNUNIT_FEET :
pszUnit = TEXT("ANNUNIT_FEET");
break;
case ANNUNIT_YARDS :
pszUnit = TEXT("ANNUNIT_YARDS");
break;
case ANNUNIT_MICROMETERS:
pszUnit = TEXT("ANNUNIT_MICROMETERS");
break;
case ANNUNIT_MILIMETERS:
pszUnit = TEXT("ANNUNIT_MILIMETERS");
break;
case ANNUNIT_CENTIMETERS:
pszUnit = TEXT("ANNUNIT_CENTIMETERS");
break;
case ANNUNIT_METERS:
pszUnit = TEXT("ANNUNIT_METERS");
break;
case ANNUNIT_TWIPS:
pszUnit = TEXT("ANNUNIT_TWIPS");
break;
case ANNUNIT_POINTS:
pszUnit = TEXT("ANNUNIT_POINTS");
break;
case ANNUNIT_PIXELS:
pszUnit = TEXT("ANNUNIT_PIXELS");
break;
default:
pszUnit = TEXT("Unknown Type");
break;
}
wsprintf(szTemp, TEXT("uUnit[%s] pAbbrev[%s] uPrecision[%d]"),
pszUnit,
pAnnChangeParam->u.AnnRulerUnit.pAbbrev ? pAnnChangeParam->u.AnnRulerUnit.pAbbrev: TEXT(""),
pAnnChangeParam->u.AnnRulerUnit.uPrecision
);
break;
}
case ANNTYPE_HYPERLINK:
{
L_TCHAR *pszType;
switch(pAnnChangeParam->u.AnnHyperlink.uLinkType)
{
case ANNLINK_NONE:
pszType = TEXT("ANNLINK_NONE");
break;
case ANNLINK_LTANNEVENT:
pszType = TEXT("ANNLINK_LTANNEVENT");
break;
case ANNLINK_USERMSG:
pszType = TEXT("ANNLINK_USERMSG");
break;
case ANNLINK_RUN:
pszType = TEXT("ANNLINK_RUN");
break;
case ANNLINK_WEBPAGE:
pszType = TEXT("ANNLINK_WEBPAGE");
break;
default:
pszType = TEXT("Unknown Type");
break;
}
wsprintf(szTemp, TEXT("uType[%s] uLinkMsg[%d] uLinkParam[%d] pLink[%s]"),
pszType,
pAnnChangeParam->u.AnnHyperlink.uLinkMsg,
pAnnChangeParam->u.AnnHyperlink.uLinkParam,
pAnnChangeParam->u.AnnHyperlink.pLinkText ? pAnnChangeParam->u.AnnHyperlink.pLinkText : TEXT("")
);
break;
}
case ANNTYPE_PROTRACTOR:
{
L_TCHAR *pszAngleUnit;
switch(pAnnChangeParam->u.AnnProtractor.uAngleUnit)
{
case ANNANGLE_DEGREES:
pszAngleUnit = TEXT("ANNANGLE_DEGREES");
break;
case ANNANGLE_RADIANS:
pszAngleUnit = TEXT("ANNANGLE_RADIANS");
break;
default:
pszAngleUnit = TEXT("Unknown Angle Unit");
break;
}
wsprintf(szTemp, TEXT("bAcute[%s] AngleUnit[%s] pszAbbrev[%s] uPrecision[%d] dArcRadius[%f]"),
pAnnChangeParam->u.AnnProtractor.bAcute ? TEXT("TRUE") : TEXT("FALSE"),
pszAngleUnit,
pAnnChangeParam->u.AnnProtractor.pszAbbrev ? pAnnChangeParam->u.AnnProtractor.pszAbbrev : TEXT(""),
pAnnChangeParam->u.AnnProtractor.uAnglePrecision,
pAnnChangeParam->u.AnnProtractor.dArcRadius
);
break;
}

case ANNTYPE_MOVE:
{
L_TCHAR *pszState;
switch(pAnnChangeParam->u.AnnMove.nState)
{
case STATE_BEGIN:
pszState = TEXT("STATE_BEGIN");
break;
case STATE_UPDATE:
pszState = TEXT("STATE_UPDATE");
break;
case STATE_END:
pszState = TEXT("STATE_END");
break;
default:
pszState = TEXT("Unknown State");
break;
}

wsprintf(szTemp, TEXT("State[%12s] (dx,dy)(%3d,%3d)"),
pszState,
pAnnChangeParam->u.AnnMove.pt.x,
pAnnChangeParam->u.AnnMove.pt.y
);
break;
}

case ANNTYPE_MOVE_POINT:
{
L_TCHAR *pszState;
switch(pAnnChangeParam->u.AnnMovePoint.nState)
{
case STATE_BEGIN:
pszState = TEXT("STATE_BEGIN");
break;
case STATE_UPDATE:
pszState = TEXT("STATE_UPDATE");
break;
case STATE_END:
pszState = TEXT("STATE_END");
break;
default:
pszState = TEXT("Unknown State");
break;
}

wsprintf(szTemp, TEXT("State[%s] Point(%f,%f) Index[%d] (dx,dy)(%d,%d)"),
pszState,
pAnnChangeParam->u.AnnMovePoint.apt.x,
pAnnChangeParam->u.AnnMovePoint.apt.y,
pAnnChangeParam->u.AnnMovePoint.uIndex,
pAnnChangeParam->u.AnnMovePoint.pt.x,
pAnnChangeParam->u.AnnMovePoint.pt.y
);
break;
}

case ANNTYPE_RESIZE_ROTATE:
{
L_TCHAR *pszState;
switch(pAnnChangeParam->u.AnnResizeRotate.nState)
{
case STATE_BEGIN:
pszState = TEXT("STATE_BEGIN");
break;
case STATE_UPDATE:
pszState = TEXT("STATE_UPDATE");
break;
case STATE_END:
pszState = TEXT("STATE_END");
break;
default:
pszState = TEXT("Unknown State");
break;
}

wsprintf(szTemp, TEXT("State[%s] AnnXForm\n\tr11[%10.3f] r12[%10.3f]\n\tr21[%10.3f] r22[%10.3f]\n\t tx[%10.3f] ty[%10.3f]\n\tdAngle[%10.3f]"),
pszState,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->r11,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->r12,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->r21,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->r22,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->tx,
pAnnChangeParam->u.AnnResizeRotate.pAnnXForm->ty,
pAnnChangeParam->u.AnnResizeRotate.dAngle
);
break;
}

case ANNTYPE_HANNOBJECT:
{
wsprintf(szTemp, TEXT("hContainer[0x%x]"), pAnnChangeParam->u.hObject);
break;
}

default:
lstrcpy(szTemp, TEXT("Unknown Type"));
}

lstrcat(szMsg, szTemp);
lstrcat(szMsg, pAnnChangeParam->bAfter ? TEXT("--After ") : TEXT("--Before"));

if (pAnnChangeParam->uFlags)
{
L_TCHAR szFlags[300];
wsprintf(szFlags, TEXT(" uFlags[0x%03x]"), pAnnChangeParam->uFlags);
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_UNDO)
lstrcat(szFlags, TEXT("ANNCHANGE_FLAG_UNDO,"));
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_CUT)
lstrcat(szFlags, TEXT("ANNCHANGE_FLAG_CUT,"));
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_PASTE)
lstrcat(szFlags, TEXT("ANNCHANGE_FLAG_PASTE,"));
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_SELECT_ALL)
lstrcat(szFlags, TEXT("ANNCHANGE_SELECT_ALL,"));
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_UNLOCK_SELECTED)
lstrcat(szFlags, TEXT("ANNCHANGE_FLAG_UNLOCK_SELECTED,"));
if (pAnnChangeParam->uFlags & ANNCHANGE_FLAG_LOCK_SELECTED)
lstrcat(szFlags, TEXT("ANNCHANGE_FLAG_LOCK_SELECTED,"));
lstrcat(szMsg, szFlags);
}
return SUCCESS_CHANGE;
}

L_VOID DebugLtAnnEvent(int nID, LPARAM lParam)
{
static int nCount = 0;
const L_TCHAR * pszMsg = NULL;
L_TCHAR szMsg[500];
HANNOBJECT hObject = (HANNOBJECT)lParam;
pANNCHANGEPARAM pAnnChangeParam;

if (!gbMessages)
return;

// This displays only the WM_LTANNEVENT LTANNEVENT_AUTOITEMCHANGING events
// Remove the line below to display ALL annotation messages
if (nID != LTANNEVENT_AUTOITEMCHANGING)
return;

pAnnChangeParam = (pANNCHANGEPARAM)lParam;
hObject = pAnnChangeParam->hObject;
pAnnChangeParam->nChange = DebugLtAnnEvent_AutoItemChanging(hObject, szMsg, lParam);
pszMsg = szMsg;

if (pszMsg)
{
L_TCHAR szMsg[300];
L_TCHAR *pszType= NULL;
L_UINT uObjectType=999;

if (hObject)
{
L_AnnGetType(hObject, &uObjectType);
pszType = annGetObjectString(uObjectType);
wsprintf(szMsg, TEXT("[%3d]*** [(%2d) %20s] %s\n"), nCount++, uObjectType, pszType, pszMsg);
}
else
{
wsprintf(szMsg, TEXT("[%3d]*** %s\n"), nCount++, pszMsg);
}
OutputDebugString(szMsg);
}
}


L_BITMAPCLASS Registered Class: Creation, Deletion, and Copying

L_BITMAPCLASS Registered Class:
Creation, Deletion, and Copying

L_BM_SETBITMAP

L_BM_FREE

L_BM_COPY

L_BM_PASTE

L_BM_COPYBITMAP


L_BITMAPCLASS Registered Class: Detecting Events

The L_BITMAPCLASS registered class receives the following messages when the specified events occur:

L_BN_CHANGE

L_BN_CLICKED

L_BN_DBLCLK

L_BN_HSCROLL

L_BN_KILLFOCUS

L_BN_PAINTED

L_BN_SETFOCUS

L_BN_UPDATE

L_BN_VSCROLL


L_BITMAPCLASS Registered Class: Displaying and Printing

L_BITMAPCLASS Registered Class:
Displaying and Printing

Displaying images:

L_BM_SETSTYLE

L_BM_SETIMAGERECT

L_BM_SETZOOM

L_BM_FOCUSEDZOOM

L_BM_SETBITMAPCLIP

L_BM_BITMAPCHANGED

Printing images:

L_BM_PRINT


L_BITMAPCLASS Registered Class: Doing Color Expansion or Reduction

L_BITMAPCLASS Registered Class:
Image Processing
Doing Color Expansion or Reduction

Main color resolution function:

L_BM_COLORRES

Specialized resolution functions:

L_BM_GRAYSCALE

L_BM_HALFTONE


L_BITMAPCLASS Registered Class: Doing Geometric Transformations

L_BITMAPCLASS Registered Class:
Image Processing
Doing Geometric Transformations

Resizing alternatives:

L_BM_RESIZE

L_BM_RESAMPLE

Other transformation functions:

L_BM_FLIP

L_BM_REVERSE

L_BM_ROTATE

L_BM_SHEAR

L_BM_DESKEW


L_BITMAPCLASS Registered Class: Filtering Images

L_BITMAPCLASS Registered Class:
Image Processing
Filtering Images

General Filters

L_BM_SPATIALFLT

L_BM_BINARYFLT

Specialized Filters

L_BM_ADDNOISE

L_BM_AVERAGE

L_BM_DESPECKLE

L_BM_INTENSITYDETECT

L_BM_MEDIAN

L_BM_MOSAIC

L_BM_POSTERIZE

L_BM_SHARPEN


L_BITMAPCLASS Registered Class: Getting Bitmap Information

L_BITMAPCLASS Registered Class:
Getting Bitmap Information

L_BM_INFO

L_BM_GETBITMAP


L_BITMAPCLASS Registered Class: Image Processing

L_BITMAPCLASS Registered Class:
Image Processing

Doing Color Expansion or Reduction

Doing Geometric Transformations

Modifying Intensity Values

Filtering Images

Setting Pixel Values


L_BITMAPCLASS Registered Class: Input and Output

L_BITMAPCLASS Registered Class:
Input and Output

L_BM_LOAD

L_BM_SAVE


L_BITMAPCLASS Registered Class: Modifying Intensity Values

L_BITMAPCLASS Registered Class:
Image Processing
Modifying Intensity Values

For overall brightness and contrast:

L_BM_INTENSITY

L_BM_GAMMACORRECT

L_BM_CONTRAST

L_BM_HISTOEQ

For color changes:

L_BM_HUE

L_BM_SATURATION

L_BM_INVERT

For filtering:

L_BM_INTENSITYDETECT


L_BITMAPCLASS Registered Class: Palettes

L_BITMAPCLASS Registered Class:
Palettes

L_BM_GETPALETTE


L_BITMAPCLASS Registered Class: Setting Pixel Values

L_BITMAPCLASS Registered Class:
Image Processing
Setting Pixel Values

L_BM_CLEAR

L_BM_FILL


L_BITMAPCLASS Registered Class: Window Styles

L_BITMAPCLASS Registered Class:
Window Styles

LEAD's Window styles specify how the window should be displayed. These can be used in conjunction with the existing WS_ styles.

Note:

If the WS_CAPTION style is not specified when you create the window (for example, if you specify WS_POPUP | L_BS_SIZEWINDOW), the L_BITMAPCLASS will use the title as the path and name of a bitmap file to be loaded during a WM_CREATE message.

The following are the additional windows styles:

Window Style | Meaning
L_BS_BKGNDPALETTE | Causes the window to always select the palette as a background palette.
L_BS_SIZEIMAGE | Specifies that the image should be resized to fit the window.
L_BS_ORDERRGB | Specifies that a true color (24-bit) image should be loaded in reverse (RGB) video order. The default is BGR.
L_BS_THUMBTRACK | Specifies that the window tracks the thumb position when using scroll bars.
L_BS_SIZEWINDOW | Specifies that the window should be resized to the image.
L_BS_CENTER | Specifies that the image should be centered in the window.
L_BS_FIXEDPALETTE | The image will be dithered to a fixed palette in 8-bit mode.
L_BS_NOPOSTQUIT | When the window is destroyed, it will not post a WM_QUIT message.
L_BS_MDICHILD | Specifies that the window is an MDI child.


LTIMAGELISTCLASS Registered Class: Styles

The following are LEAD ImageList Control styles:

Window Style | Meaning
L_ILS_OWNERDRAWITEM | This style must be used to make the ImageList Control an "Owner Draw" control. This style can be added when creating the ImageList control, using the L_CreateImageListControl function, or after it has been created by calling the Windows SetWindowLong function. When the ImageList Control is set to be "Owner Draw", then the parent window is responsible for drawing the contents of the control by processing L_ILM_DRAWITEM messages.
L_ILS_ZOOMSMALLITEMS | This style can be used to indicate that images that are smaller than the size of an ImageList Item will be zoomed to fit the ImageList Item. By default, images that are smaller than an ImageList Item are displayed at their natural dimensions.
L_ILS_CENTERVERTICAL | This style can be used to indicate that images should be centered vertically in an ImageList Item.
L_ILS_KEEPCOMPRESSED | This style can be used to indicate that images for ImageList Items are kept compressed in memory (to reduce memory usage).
L_ILS_ACCEPTDROPFILES | This style can be used to indicate that the ImageList Control can handle WM_DROPFILES messages. This allows users to add items to the ImageList Control by dragging and dropping supported image files from Explorer.


LTIMAGELISTCLASS Registered Class: Detecting Events

The LTIMAGELISTCLASS registered class receives the following messages when the specified events occur:

L_ILN_SETFOCUS

L_ILN_KEYDOWN

L_ILN_KILLFOCUS

L_ILN_HSCROLL

L_ILN_VSCROLL

L_ILN_CLICKED

L_ILN_DBLCLCK

L_ILN_ITEMSEL


LTIMAGELISTCLASS Registered Class: Getting/Setting Options

L_ILM_GETSELOPTIONS

L_ILM_SETSELOPTIONS

L_ILM_GETITEMOPTIONS

L_ILM_SETITEMOPTIONS

L_ILM_ENABLEKEYBOARD

L_ILM_SETDISPLAYFLAGS


LTIMAGELISTCLASS Registered Class: Getting ImageList Information

L_ILM_GETROWCOUNT

L_ILM_GETCOLCOUNT

L_ILM_GETITEMCOUNT

L_ILM_GETITEM

L_ILM_GETSELCOUNT

L_ILM_GETSELITEMS

L_ILM_GETBACKCOLOR

L_ILM_GETBORDERCOLOR

L_ILM_GETPAGE

L_ILM_GETPAGECOUNT

L_ILM_GETSCROLLSTYLE

L_ILM_HITTEST

L_ILM_ITEMSELECTED


LTIMAGELISTCLASS Registered Class: Modifying the ImageList

L_ILM_CLEAR

L_ILM_INSERT

L_ILM_INSERTAT

L_ILM_SETITEM

L_ILM_REMOVE

L_ILM_SORT

L_ILM_SETBACKCOLOR

L_ILM_SETBORDERCOLOR

L_ILM_SELECTALL


LTIMAGELISTCLASS Registered Class: Scrolling

L_ILM_ENSUREVISIBLE

L_ILM_GETSCROLLSTYLE

L_ILM_SETSCROLLSTYLE

L_ILM_SCROLLITEMS


Data Types

Basic Data Types and Keywords

Keywords Used in Declarations

LEADTOOLS Basic Data Types

Image and Toolkit Information Structures

BITMAPHANDLE

FILEINFO

FlashPix Comments

FlashPix Enumerated Types

FlashPix Structures

VERSIONINFO

Structures Used with Input and Output Functions

DIMENSION

FILEPDFOPTIONS

FILEPDFSAVEOPTIONS

FILEDJVOPTIONS

FILEPLTOPTIONS

FILEPTKOPTIONS

FILERTFOPTIONS

FILESAVEFORMAT

FILEJBIG2OPTIONS

FILETXTOPTIONS

LOADFILEOPTION

LOADINFO

PCDINFO

SAVEFILEOPTION

WINDOWS Structures

Image Processing Structures

ADDMESGINFO

ANNROTATEOPTIONS

BALANCEDATA

BINARYFLT

BORDERREMOVE

BUMPDATA

COLORDATA

COLORREPLACE

COMPDATA

DOTREMOVE

FILEOVERLAYCALLBACKDATA

FILETRANSFORMS

FTARRAY

GRAYCOLOR

HOLEPUNCH

HSIDATA

INVERTEDTEXT

JPEGCOLORSPACE

L_COMPLEX

LIGHTINFO

LIGHTPARAMS

LINEREMOVE

LVLCLRINF

LVLCLR

MAGGLASSOPTIONS

MAGGLASSPAINTOPTIONS

MEMICCPROFILE

MOSAICTILESINFO

OPTIMIZEIMAGEDIRINFO

OPTIMIZEIMAGEOPTIONS

OVERLAYATTRIBUTES

PLASMAINFO

SEARCHMARKS

SELCLRINF

SELCLR

SLICEBITMAPOPTIONS

SMOOTH

SPATIALFLT

STARINFO

STATISTICSINFO

USERFLT

VIGNETTEINFO

ZOOMVIEWPROPS

ImageList Control Structures

LILCLICK

LILEXPORTBITMAPLIST

LILIMPORTBITMAPLIST

LILDRAWITEM

LILITEM

LILITEMOPTIONS

LILITEMSEL

LILKEYDOWN

LILSELOPTION

LILSORTOPTIONS

Region Processing Structure

RGNXFORM

List and Animation Data Types

HBITMAPLIST

HPLAYBACK

Annotation Data Type and Structures (Document/Medical only)

ANNBUTTON

ANNCHANGEPARAM

ANNCHANGEPARAM

ANNCHANGETYPE

ANNCHANGETYPE

ANNENCRYPTOPTIONS

ANNFONT

ANNHANDLE

ANNHANDLE

ANNHANDLEINFO

ANNHILIGHT

ANNHITTESTINFO

ANNHYPERLINK

ANNMOUSEPOS

ANNMOVE

ANNMOVEPOINT

ANNNAMEOPTIONS

ANNPOINT

ANNPOINTOPTIONS

ANNPROTRACTOR

ANNRECT

ANNRESIZEROTATE

ANNRULERUNIT

ANNSMARTDISTANCE

ANNTEXTOPTIONS

ANNTEXTTOKEN

ANNTEXTTOKENTYPE

ANNTOOL

ANNTOOLBARINFO

ANNXFORM

HANNOBJECT

ICC Profile Structures

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICCTAG_UNKNOWN_TYPE

ICCTAG_XYZ_TYPE

ICC_XYZ_NUMBER

ICCTAG_VIEW_COND_TYPE

ICC_VIEW_COND

ICCTAG_UINT8_ARRAY_TYPE

ICCTAG_UINT64_ARRAY_TYPE

ICCTAG_UINT32_ARRAY_TYPE

ICCTAG_UINT16_ARRAY_TYPE

ICCTAG_U16_FIXED16_ARRAY_TYPE

ICCTAG_TEXT_TYPE

ICCTAG_SIGNATURE_TYPE

ICCTAG_S15_FIXED16_ARRAY_TYPE

ICCTAG_RESPONSE_CURVE_SET16_TYPE

ICC_RESPONSE_CURVE

ICC_CURVE_STRUCTURE

ICC_XYZ_ARRAY

ICC_RESPONSE_ARRAYS

ICC_RESPONSE_16_NUMBER

ICCTAG_PROFILE_SEQ_DESC_TYPE

ICC_PROFILE_SEQ_DESC

ICC_PROFILE_DESC

ICCTAG_PARAMETRIC_CURVE_TYPE

ICC_PARAMETRIC_CURVE

ICCTAG_NAMED_COLOR2_TYPE

ICC_NAMED_COLOR2

ICC_NAMED_COLOR2_DATA

ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

ICC_MULTI_LOCALIZED_UNICODE

ICC_NAME_RECORD

ICCTAG_MEASUREMENT_TYPE

ICC_MEASUREMENT

ICCTAG_LUT_A_TO_B_TYPE, ICCTAG_LUT_B_TO_A_TYPE

ICC_MATRIX

ICCTAG_LUT8_TYPE

ICC_LUT8

ICCTAG_LUT16_TYPE

ICC_LUT16

ICCTAG_DATE_TIME_TYPE

ICC_DATE_TIME_NUMBER

ICCTAG_DATA_TYPE

ICC_DATA

ICCTAG_CURVE_TYPE

ICC_CURVE

ICCTAG_COLORANT_TABLE_TYPE

ICC_COLORANT_TABLE_DATA

ICCTAG_COLORANT_ORDER_TYPE

ICCTAG_CHROMATICITY_TYPE

ICC_CHROMATICITY

ICC_CHANNEL_COORD

ICCTAG_BASE

ICCDATATYPEFLAGS

ICCCOLORANTTYPE

ICCMEASUREMENTSIGNATURE

ICCFUNCTIONTYPE

ICCMEASUREMENTFLARE

ICCMEASUREMENTGEOMETRY

ICCSTANDARDOBSERVER

ICCTAGTYPESIGNATURE

ICCTECHNOLOGYSIGNATURE

ICCTAGSIGNATURE

ICCPROFILECLASS

ICCCOLORSPACE

ICCRENDERINGINTENT

ICCPLATFORMSIGNATURE

Registered Class Structures

LEADBITMAPCOLORRES

LEADBITMAPFOCUSEDZOOM

LEADBITMAPINFO

LEADBITMAPLOAD

LEADBITMAPPRINT

LEADBITMAPSAVE

LEADBITMAPSHEAR


ANNBUTTON (Document/Medical only)

typedef struct _ANNBUTTON
{
L_UINT uStructSize;
L_UINT uFlags;
L_UINT uTool;
L_UINT uToolCount;
pANNTOOL pTools;
pBITMAPHANDLE pBitmapUp;
pBITMAPHANDLE pBitmapDown;
L_UINT uBitmapStructSize;
L_INT nToolTipTextID;
L_TCHAR L_FAR *pToolTipText;
} ANNBUTTON, L_FAR *pANNBUTTON;

The ANNBUTTON structure contains information about buttons contained in the annotation toolbar.

Member

Description

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.

uFlags

Flag that indicates whether this button contains multiple tools. Possible values are:

Value

Meaning

0

Only one tool is associated with this button.

ANNBUTTON_MULTIPLE

This button has more than one tool is associated with this button.

uTool

Value that indicates the tool associated with this button, if this button has only one tool. If this button has more than one tool, this is the default tool for the button.

uToolCount

The number of tools associated with this button if ANNBUTTON_MULTIPLE is set in uFlags.

pTools

An array of tools associated with this button if ANNBUTTON_MULTIPLE is set in uFlags.

pBitmapUp

Pointer to the bitmap handle that references the bitmap that is displayed when the button is not pressed. This bitmap must be specified. The bitmap should have one of the following sets of dimensions, depending on the toolbar style used:

Old style toolbar (TOOLBARIMAGECX,TOOLBARIMAGECY)

New XP style toolbar (TOOLBARIMAGEXP_CX, TOOLBARIMAGEXP_CY)

When using the old style toolbar, it is recommended that all bitmaps used for the annotation buttons should use the same palette.

pBitmapDown

Pointer to the bitmap handle that references the bitmap that is displayed when the button is pressed. You can use the same pointers for pBitmapUp and pBitmapDown.

uBitmapStructSize

Size, in bytes, of the structures pointed to by pBitmapUp and pBitmapDown. Use sizeof(BITMAPHANDLE).

nToolTipTextID

Index into the annotation menu dialog strings (ANNAUTOTEXT_XXX). If this value is -1, the text for the tool tip is in pToolTipText. 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.

pToolTipText

Character string that contains the text for the tool tip. This is only valid if nToolTipTextID is -1.

Comments

An array of ANNBUTTON structures is used both to retrieve information about tool buttons in the existing toolbar, and to set information about tool button to set in the tool bar. For an example showing the use of this structure, refer to L_AnnFreeToolBarButtons.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

When using the new style annotation toolbar, the dimensions of the bitmap should be TOOLBARIMAGEXP_CX x TOOLBARIMAGEXP_CY 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 more information on using the new style annotation toolbar, refer to L_AnnSetOptions.

See Also

Functions:

L_AnnFreeToolBarButtons, L_AnnGetToolBarButtons, L_AnnSetToolBarButtons, L_AnnSetOptions


ANNCHANGEPARAM

ANNCHANGEPARAM (Document/Medical only)

typedef struct tagANNCHANGEPARAM
{
L_UINT uStructSize; // size of this structure
HANNOBJECT hObject; // object being changed.
ANNCHANGETYPE uChange; // the type of change being performed
L_INT nChange; // set to SUCCESS_CHANGE to allow the modification,
// set to SUCCESS_NO_CHANGE cancel the change
L_UINT uUnionType; // field in the union that contains the value
L_BOOL bAfter; // FALSE--fired before the change
// TRUE --fired after the change
L_UINT uFlags; // Indicates if change is part of a
// Undo, Cut, Copy, Paste, Create, Delete
union
{
L_DOUBLE dDouble; // valid if the object is being rotated
COLORREF crColor;
L_BOOL bBool;
L_UINT32 uUint32;
L_UINT uUint;
L_TCHAR L_FAR* pszString;
ANNPOINT apt;
pBITMAPHANDLE pBitmapHandle;
HMETAFILE hMetafile;
HANNOBJECT hObject;
ANNHYPERLINK AnnHyperlink;
ANNRULERUNIT AnnRulerUnit;
ANNPROTRACTOR AnnProtractor;
ANNMOVE AnnMove;
ANNMOVEPOINT AnnMovePoint;
ANNRESIZEROTATE AnnResizeRotate;
}u;

} ANNCHANGEPARAM, L_FAR* pANNCHANGEPARAM;

The ANNCHANGEPARAM contains information about the changes to be made in automated mode to

the specified object.

Member | Description
uStructSize | Size of the ANNCHANGEPARAM structure. Use sizeof(ANNCHANGEPARAM).
hObject | Handle to the affected annotation object.
uChange | Type of change being performed. Possible values are:
 | Value | Meaning
 | ANNTYPE_NONE | [0] No part of the union is valid.
 | ANNTYPE_COLORREF | [1] The crColor field is valid.
 | ANNTYPE_UINT32 | [2] The uUint32 field is valid.
 | ANNTYPE_BOOL | [3] The bBool field is valid.
 | ANNTYPE_DOUBLE | [4] The dDouble field is valid.
 | ANNTYPE_UINT | [5] The uUint field is valid.
 | ANNTYPE_LPCSTR | [6] The pszString field is valid.
 | ANNTYPE_ANNPOINT | [7] The apt field is valid (type ANNPOINT).
 | ANNTYPE_BITMAP | [8] The pBitmapHandle field is valid (type pBITMAPHANDLE).
 | ANNTYPE_HMETAFILE | [9] The hMetafile field is valid.
 | ANNTYPE_HYPERLINK | [10] The AnnHyperlink field is valid (type ANNHYPERLINK).
 | ANNTYPE_RULER_UNIT | [11] The AnnRulerUnit field is valid (type ANNRULERUNIT).
 | ANNTYPE_PROTRACTOR | [12] The AnnProtractor field is valid (type ANNPROTRACTOR).
 | ANNTYPE_MOVE | [13] The AnnMove field is valid (type ANNMOVE).
 | ANNTYPE_MOVE_POINT | [14] The AnnMovePoint field is valid (type ANNMOVEPOINT).
 | ANNTYPE_RESIZE_ROTATE | [15] The AnnResizeRotate field is valid (type ANNRESIZEROTATE).
 | ANNTYPE_HANNOBJECT | [16] The hObject field is valid.
nChange | When the message is received, this value is set to SUCCESS_CHANGE.
 | If the bAfter field is set to FALSE (indicating that this message is sent prior to the change), then changing the value of nChange before processing the message affects the behavior. Possible values are:
 | Value | Meaning
 | SUCCESS_CHANGE | [1] Accept the change and allow the ‘after’ message to be sent.
 | SUCCESS_NO_CHANGE | [2] Cancel the change and cancel the ‘after’ message.
uUnionType | Indicates the part of the union that is valid. The union specifies additional information about the change.

bAfter | Value that indicates whether the message is being sent after the change. Possible values are
 | Value | Meaning
 | TRUE | The message is being sent after the change.
 | FALSE | The message is being sent prior to the change.

uFlags | Value that indicates if this change is part of another change. For example, an ANNCHANGE_SELECT_ALL change resuls in several individual ANNCHANGE_SELECT changes.
 | The uFlags can be one or more of the following (logically‘OR’ed together)
 | ANNCHANGE_FLAG_UNDO | [0x001]
 | ANNCHANGE_FLAG_CUT | [0x002]
 | ANNCHANGE_FLAG_PASTE | [0x008]
 | ANNCHANGE_FLAG_SELECT_ALL | [0x010]
 | ANNCHANGE_FLAG_LOCK_SELECTED | [0x020]
 | ANNCHANGE_FLAG_UNLOCK_SELECTED | [0x040]

Comments

By default, nChange will be set to SUCCESS_CHANGE for every object. To disable the change for a particular object, set nChange to SUCCESS_NOCHANGE for that change. When disabling a change, the corresponding ‘after’ message is cancelled. nChange will be reset to SUCCESS_CHANGE before the notification is called for the next object.

The union of ANNCHANGEPARAM specifies additional information about the change. For example, for the change ANNCHANGE_FORECOLOR, the uUnionType field will be ANNTYPE_COLORREF indicating that the crColor part of the union is valid. In this case, it contains the color that the foreground will be changed to (if bAfter is FALSE) or has already been changed to (if bAfter is TRUE).

See Also

Topics:

WM_LTANNEVENT


ANNCHANGETYPE (Document/Medical only)

typedef enum tagANNCHANGETYPE
{
ANNCHANGE_TAG [1] Tag L_AnnSetTag
ANNCHANGE_VISIBLE [2] Visible L_AnnSetVisible
ANNCHANGE_SELECTED [3] Selected L_AnnSetSelected
ANNCHANGE_FONT_BOLD [4] Font bold L_AnnSetFontBold
ANNCHANGE_FONT_ITALIC [5] Font italic L_AnnSetFontItalic
ANNCHANGE_FONT_STRIKETHROUGH [6] Font strike-through L_AnnSetFontStrikeThrough
ANNCHANGE_FONT_UNDERLINE [7] Font underline L_AnnSetFontUnderline
ANNCHANGE_LINEWIDTH [8] Line width L_AnnSetLineWidth
ANNCHANGE_LINESTYLE [9] Line style L_AnnSetLineStyle
ANNCHANGE_FILLPATTERN [10] Fill pattern L_AnnSetFillPattern
ANNCHANGE_FILLMODE [11] Fill mode L_AnnSetFillMode or L_AnnSetFillModeExt
ANNCHANGE_POLYFILLMODE [12] Poly fill mode L_AnnSetPolyFillMode
ANNCHANGE_FONT_SIZE [13] Font size L_AnnSetFontSize
ANNCHANGE_FORECOLOR [14] Foreground color L_AnnSetForeColor
ANNCHANGE_BACKCOLOR [15] Background color L_AnnSetBackColor
ANNCHANGE_TRANSPARENT_COLOR [16] Transparent color L_AnnSetTransparentColor
ANNCHANGE_TRANSPARENT [17] Transparent L_AnnSetTransparent
ANNCHANGE_FONT_NAME [18] Font name L_AnnSetFontName
ANNCHANGE_TEXT [19] Text L_AnnSetText
ANNCHANGE_ROP2 [20] ROP2 code L_AnnSetROP2
ANNCHANGE_BITMAP [21] Bitmap L_AnnSetBitmap
ANNCHANGE_BITMAP2 [22] Secondary bitmap L_AnnSetSecondaryBitmap
ANNCHANGE_METAFILE [23] Metafile L_AnnSetMetafile
ANNCHANGE_METAFILE2 [24] Decrypt metafile L_AnnSetMetafile
//
ANNCHANGE_NAME_FORECOLOR [30] Name foreground color L_AnnSetNameOptions
ANNCHANGE_NAME_BACKCOLOR [31] Name background color L_AnnSetNameOptions
ANNCHANGE_NAME_SHOWNAME [32] Name--show name L_AnnSetNameOptions
ANNCHANGE_NAME_OFFSET [33] Name offset L_AnnSetNameOptions
ANNCHANGE_NAME_RESTRICT [34] Name restrict L_AnnSetNameOptions
ANNCHANGE_NAME_BACKTRANSPARENT [35] Name background transparent L_AnnSetNameOptions
ANNCHANGE_NAME_TEXT [36] Name text L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_NAME [37] Name--font name L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_BOLD [38] Name--font bold L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_ITALIC [39] Name--font italic L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_STRIKEOUT [40] Name--font strikethrough L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_UNDERLINE [41] Name--font underline L_AnnSetNameOptions
ANNCHANGE_NAME_FONT_SIZE [42] Name--font size L_AnnSetNameOptions
//
ANNCHANGE_POINT_USE_BITMAP [50] Point--use bitmap L_AnnSetPointOptions
ANNCHANGE_POINT_RADIUS [51] Point--radius in pixels L_AnnSetPointOptions
ANNCHANGE_POINT_BORDER_COLOR [52] Point--border color L_AnnSetPointOptions
ANNCHANGE_POINT_FILL_COLOR [53] Point--fill color L_AnnSetPointOptions
ANNCHANGE_POINT_TRANSPARENT_FILL [54] Point--transparent fill L_AnnSetPointOptions
ANNCHANGE_POINT_FIXED_SIZE [55] Point--fixed size L_AnnSetPointOptions
//
ANNCHANGE_SHOW_DEFAULT_HANDLES [60] Show default handles L_AnnSetNodes
ANNCHANGE_GAP_DEFAULT_HANDLES [61] Handle gap L_AnnSetNodes
ANNCHANGE_HYPERLINK [62] Hyperlink options L_AnnSetHyperlink

// Ruler changes
ANNCHANGE_GAUGELENGTH [70] Gauge length L_AnnSetGaugeLength
ANNCHANGE_BITMAP_DPI_X [71] Bitmap DPI -- horizontal L_AnnSetBitmapDpiX
ANNCHANGE_BITMAP_DPI_Y [72] Bitmap DPI -- vertical L_AnnSetBitmapDpiY
ANNCHANGE_RULER_UNIT [73] Ruler unit, abreviation, precision L_AnnSetUnit
ANNCHANGE_RULER_SHOW_FLAGS [74] Ruler show flags L_AnnSetShowFlags
ANNCHANGE_PROTRACTOR [75] Protractor options L_AnnSetProtractorOptions

ANNCHANGE_ENCRYPTOR_TYPE [80] Encryptor type L_AnnSetEncryptOptions
ANNCHANGE_ENCRYPTOR_KEY [81] Encryptor key L_AnnSetEncryptOptions
ANNCHANGE_ENCRYPTOR_NEVER_ENCRYPTED [82] Indicates if never encrypted L_AnnSetEncryptOptions
ANNCHANGE_ENCRYPTOR_BITMAP [83] Bitmap to be encrypted L_AnnSetEncryptOptions
///
ANNCHANGE_MOVE [90] Object is moving
ANNCHANGE_MOVE_POINT [91] Point on object is moving
ANNCHANGE_RESIZE [92] Object resized
ANNCHANGE_ROTATE [93] Object rotated
ANNCHANGE_RESIZE_ROTATE [94] Object is being resized and rotated
//
ANNCHANGE_UNDO [100] Annotation undo L_AnnUndo
ANNCHANGE_CUT [101] Annotation cut to clipboard L_AnnCutToClipboard
ANNCHANGE_PASTE [102] Annotation paste L_AnnCopyFromClipboard
ANNCHANGE_DELETE [103] Object being deleted L_AnnDestroy
ANNCHANGE_SELECT_ALL [104] All objects being selected
ANNCHANGE_BRING_TO_FRONT [105] Menu: Bring To Front --Bring selected object to front of Z-order
ANNCHANGE_BRING_TO_BACK [106] Menu: Bring To Back -- Bring selected object to back of Z-Order
ANNCHANGE_LOCK [107] Lock one object L_AnnLock
ANNCHANGE_UNLOCK [108] Unlock one object L_AnnUnlock
ANNCHANGE_LOCK_SELECTED [109] Menu: Lock selected objects
ANNCHANGE_UNLOCK_SELECTED [110] Menu: Unlock selected objects
ANNCHANGE_INSERT [111] Insert object into container L_AnnInsert
ANNCHANGE_NOTE_BACKCOLOR [112] Menu: Default Properties->Note Background Color
ANNCHANGE_HILITE_BACKCOLOR [113] Menu: Default Properties->Hilite Background Color
ANNCHANGE_REDACT_BACKCOLOR [114] Menu: Default Properties->Redact Background Color
ANNCHANGE_ENCRYPT_METAFILE [115] Menu: Default Properties->Encrypt Metafile
ANNCHANGE_DECRYPT_METAFILE [116] Menu: Default Properties->Decrypt Metafile
ANNCHANGE_HOTSPOT_METAFILE [117] Menu: Default Properties->Hotspot Metafile
ANNCHANGE_LAST,
} ANNCHANGETYPE, L_FAR *pANNCHANGETYPE;

The following constants are used in the WM_LTANNEVENT message when wParam is LTANNEVENT_AUTOITEMCHANGING. In this case, lParam points to a structure of type ANNCHANGEPARAM, and the uChange fields is a constant from the following list.

In the comment below, the first word is a description of the annotation property that is changed. If there is a reference to an L_AnnXXXX function, see the documentation of the function for a complete description of the property.

Please note that formerly ANNCHANGE_DELETE had the value [0] and ANNCHANGE_ROTATE had the value [1].


ANNENCRYPTOPTIONS (Document/Medical only)

typedef struct tagANNENCRYPTOPTIONS
{
L_UINT32 uStructSize;
L_UINT uFlags;
L_BOOL bEncryptor;
L_UINT32 uKey;
L_BOOL bNeverEncrypted;
pBITMAPHANDLE pEncryptBitmap;
L_BOOL bSaveEncryptorKey;
L_BOOL bSaveDecryptorKey;
L_BOOL bClearEncryptorKey;
L_BOOL bClearDecryptorKey;
L_INT32 nReserved;
} ANNENCRYPTOPTIONS, L_FAR *pANNENCRYPTOPTIONS;

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNENCRYPTOPTIONS)
uFlags | Flags that identify which files to set or get. Possible values are one or more of the following constants "or"ed together:
 | Value | Meaning
 | ANNENCRYPT_TYPE | [0x001] Get or set the bEncryptor field.
 | ANNENCRYPT_KEY | [0x002] Get or set the uKey field.
 | ANNENCRYPT_RESERVED1 | [0x004] Reserved for future use.
 | ANNENCRYPT_NEVER_ENCRYPTED | [0x008] Get or set the bNeverEncrypted field.
 | ANNENCRYPT_ENCRYPT_BITMAP | [0x010] Get or set the pEncryptBitmap field.
 | ANNENCRYPT_ALL | [0x01F] Get or set all fields.

bEncryptor | Flag that indicates whether the object is an encryptor or decryptor. Possible values are:
 | Value | Meaning
 | TRUE | The object is an encryptor.
 | FALSE | The object is a decryptor.
uKey | Key that is used for the encryption/decryption. This is an unsigned integer with 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.
bNeverEncrypted | Flag that indicates whether you can change the key and location of the decryptor. This field is only relevant for decryptors (bEncryptor is FALSE). Possible values are:
 | Value | Meaning
 | TRUE | The decryptor has never been encrypted. This means that in automation, the key and location of the decryptor can be changed.
 | FALSE | The decryptor was originally an encryptor that was applied. You cannot change the key or location of this kind of decryptor.
pEncryptBitmap | Pointer to the bitmap that is being encrypted or decrypted
bSaveEncryptorKey | Flag that indicates if encryptor keys are saved. Possible values are:
 | Value | Meaning
 | TRUE | Encryptor keys are saved with L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnSaveTag.
 | FALSE | Encryptor keys are saved with a value of 0 with L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnSaveTag.
bSaveDecryptorKey | Flag that indicates if decryptor keys are saved. Possible values are:
 | Value | Meaning
 | TRUE | Decryptor keys are saved with L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnSaveTag.
 | FALSE | Decryptor keys are saved with a value of 0 with L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnSaveTag.
bClearEncryptorKey | Flag that indicates what happens to encrypt keys after calling L_AnnEncryptApply
 | Value | Meaning
 | TRUE | All encrypt objects whose state has become ‘encryptor’ have the key set to 0.
 | FALSE | All encrypt objects whose state has become ‘encryptor’ have the key unchanged.
bClearDecryptorKey | Flag that indicates what happens to encrypt keys after calling L_AnnEncryptApply.
 | Value | Meaning
 | TRUE | All encrypt objects whose state has become ‘decryptor’ have the key set to 0.
 | FALSE | All encrypt objects whose state has become ‘decryptor’ have the key unchanged.
nReserved | Reserved for future use. Must set this field to zero.

Comments

The ANNENCRYPTOPTIONS structure is used with the functions L_AnnSetEncryptOptions and L_AnnGetEncryptOptions to get or set options on an annotation encrypt object. This encrypt object may be in the encryptor state or the decryptor state.


ANNFILEINFO

typedef struct tagANNFILEINFO
{
L_UINT uStructSize;
L_INT32 nOffset;
L_INT32 nVersion;
L_UINT uFormat;
L_INT32 nTotalPages;
} ANNFILEINFO, L_FAR * pANNFILEINFO;

The ANNFILEINFO structure contains information retrieved from a LEAD annotation file.

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions.
nOffset | Position of the first byte to load. This must be set before passing this structure to the LEAD functions. Typically, this is set to 0.
nVersion | Version of the annotation file. If '12' is returned, this refers to version 12 or earlier.
uFormat | Flag that indicates the format of the annotation data in the file. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | LEAD text-based format for annotations.
 | ANNFMT_WMF | Windows WMF format.
 | ANNFMT_ENCODED | LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | XML text format. This is LEAD’s new text-based format which is upward-compatible.
nTotalPages | The total number of pages in the annotation file.
nReserved | Reserved for future use.

Comments

The ANNFILEINFO structure is updated by the L_AnnFileInfo, L_AnnFileInfoMemory and L_AnnFileInfoOffset functions with information about an annotation file. Before passing this structure to any of the LEAD functions, the nSize and nOffset fields must be filled.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


ANNFONT (Document/Medical only)

typedef struct tagANNFONT
{
L_UINT32 uStructSize;
L_TCHAR szFontName[LF_FACESIZE];
L_BOOL bFontBold;
L_BOOL bFontItalic;
L_BOOL bFontStrikeOut;
L_BOOL bFontUnderline;
L_DOUBLE dFontSize;
DWORD dwReserved;
} ANNFONT, L_FAR *pANNFONT;

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNFONT).
szFontName | Character string that contains the name of the font
bFontBold | Flag that indicates whether the font is bold. Possible values are:
 | Value | Meaning
 | TRUE | The font is bold
 | FALSE | The font is not bold
bFontItalic | Flag that indicates whether the font is italicized. Possible values are:
 | Value | Meaning
 | TRUE | The font is italicized
 | FALSE | The font is not italicized
bFontStrikeOut | Flag that indicates whether the font is drawn with a strikeout. Possible values are:
 | Value | Meaning
 | TRUE | The font is drawn with strikeout
 | FALSE | The font is drawn without strikeout
bFontUnderline | Flag that indicates whether the font is drawn with an underline. Possible values are:
 | Value | Meaning
 | TRUE | The font is drawn with an underline
 | FALSE | T he font is drawn without an underline
dFontSize | The size, in logical units, of the font's character cell or character.
dwReserved | Reserved for internal use. Must set this field to zero.

Comments

The ANNFONT structure is part of the ANNNAMEOPTIONS structure, and is used for setting or getting font characteristics of the annotation name.

For more information, refer to the documentation for ANNNAMEOPTIONS.

Note:

LF_FACESIZE is defined as

#define LF_FACESIZE 32


ANNHANDLE

ANNHANDLE (Document/Medical only)

typedef struct tagANNHANDLE
{
L_UINT32 uStructSize;
L_INT nID;
ANNPOINT aptContainer;
POINT ptClient;
L_BOOL bVisible;
COLORREF crPen;
COLORREF crFill;
L_INT nShape;
HCURSOR hCursor;
L_UINT uFlags;
} ANNHANDLE, L_FAR *pANNHANDLE;

The ANNHANDLE structure used for an annotation user handle and is used with the L_AnnAddUserHandle, L_AnnEnumerateHandles, L_AnnGetUserHandle, and L_AnnGetUserHandles functions.

Member | Description
uStructSize | Sizeof this structure. Use sizeof(ANNHANDLE)
nID | A unique ID associated with the 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 (L_AnnHitTestExt)
aptContainer | An ANNPOINT structure that gives 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.
 | Pass uFlags (ANNHANDLE_LOCATION | ANNHANDLE_CONTAINER_COORDINATES) to use this field.
ptClient | A POINT structure that gives the location of handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.
bVisible | A flag that indicates whether the handle is visible. Possible values are:
 | Value | Meaning
 | TRUE | Make the handle visible.
 | FALSE | Make the handle invisible.
 | Pass uFlags ANNHANDLE_VISIBLE to use this field. The default is visible.

crPen | A COLORREF value that defines the color of the pen used to draw the user handle (the outline of the handle).
 | Pass uFlags ANNHANDLE_PEN_COLOR to use this field. The default is black or RGB(0,0,0).
crFill | A COLORREF value that defines the color used to fill the user handle.
 | Pass uFlags ANNHANDLE_FILL_COLOR to use this field. The default is white or RGB(255,255,255).
nShape | A value that defines the shape of the user handle. Possible values are:
 | Value | Meaning
 | ANNHANDLE_SHAPE_SQUARE | The shape of the user handle is square
 | ANNHANDLE_SHAPE_CIRCLE | The shape of the user handle is a circle
 |  | Pass uFlags ANNHANDLE_SHAPE to use this field.
hCursor | Handle to a cursor. This is the cursor that appears when the mouse hovers over the user handle. Set this field to zero to get the default cursor.
uFlags | Flags that identify which members of this structure to use. If the corresponding flag for a field is absent, the default value for the field is used. Possible values are:
 | Value | Meaning
 | ANNHANDLE_ID | [0x0001] Use nID
 | ANNHANDLE_LOCATION | [0x0002] Use either aptContainer or ptClient
 | ANNHANDLE_CONTAINER_COORDINATES | [0x0004] Use aptContainer. Must be used in conjunction with flag ANNHANDLE_LOCATION
 | ANNHANDLE_VISIBLE | [0x0008] Use bVisible
 | ANNHANDLE_PEN_COLOR | [0x0010] Use crPen
 | ANNHANDLE_FILL_COLOR | [0x0020] Use crFill
 | ANNHANDLE_SHAPE | [0x0040] Use nShape

Comments

For an example showing the use of this structure, refer to L_AnnAddUserHandle.

See Also

Functions:

L_AnnHitTestExt, L_AnnAddUserHandle, L_AnnChangeUserHandle, L_AnnEnumerateHandles


ANNHANDLEINFO

ANNHANDLEINFO (Document/Medical only)

typedef struct tagANNHANDLEINFO
{
L_UINT uStructSize;
L_INT nType;
L_INT nID;
L_INT nIndex;
ANNPOINT ptLocationContainer;
POINT ptLocationClient;
L_BOOL bVisible;
COLORREF crPen;
COLORREF crFill;
L_INT nShape;
HCURSOR hCursor;
L_INT nTotalHandles;
L_INT nReserved;
} ANNHANDLEINFO, *pANNHANDLEINFO;

This structure is used in the callback function with L_AnnEnumerateHandles.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNHANDLEINFO)
nType | Type of handle. Possible values are:
 | Value | Meaning
 | ANNHANDLETYPE_DEFAULT_HANDLE | A default annotation handle.
 | ANNHANDLETYPE_USER_HANDLE | A user-defined annotation handle.
 | ANNHANDLETYPE_ROTATE_HANDLE | A rotate annotation handle
nID | Unique identifier of the annotation handle. If ‘nType’ is ANNHANDLETYPE_ROTATE_HANDLE, then nID specifies if this is a center rotate handle (ROTATE_HANDLE_CENTER_ID) or a gripper rotate handle (ROTATE_HANDLE_GRIPPER_ID)
nIndex | This is the index of the user handle of the privately maintained array of user handles. Use nIndex with L_AnnChangeUserHandle or L_AnnDeleteUserHandle. This is only valid if the type of the handle is ANNHANDLETYPE_DEFAULT_HANDLE.
ptLocationContainer | The location of the handle in container coordinates. Container coordinates are typically the same dimensions of the underlying bitmap, and are independent of zooming and scrolling.
ptLocationClient | The location of the handle in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

bVisible | Value that indicates whether the handle is visible. Possible values are:
 | Value | Meaning
 | TRUE | The handle is visible.
 | FALSE | The handle is invisible.
crPen | A COLORREF value that represents the color of the pen used to draw the user handle (the outline of the handle).
crFill | A COLORREF value that represents the color used to fill the user handle.

nShape | A value that indicates the shape of the handle. Possible values are:
 | Value | Meaning
 | ANNHANDLE_SHAPE_SQUARE | The shape of the user handle is square
 | ANNHANDLE_SHAPE_CIRCLE | The shape of the user handle is a circle
hCursor | Handle to a cursor. This is the cursor that appears when the mouse hovers over the user handle. If this value is zero, then a default cursor will appear.
nTotalHandles | The total number of annotation object handles. This includes both the default annotation handles and the user-defined annotation handles.
nReserved | Reserved for future use. Must set this field to zero.


ANNHILIGHT

ANNHILIGHT (Document/Medical only)

typedef struct tagANNHILIGHT
{
L_UINT uStructSize;
HANNOBJECT hObject;
L_UINT uCount;
LPPOINT ppts;
HWND hWnd;
} ANNHILIGHT, *pANNHILIGHT;

The ANNHILIGHT structure contains information about the annotation object about to be drawn with a highlight.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNHILIGHT).
hObject | Handle to the object being highlighted.
uCount | Number of points
ppts | Pointer to an array of POINT structures.
hWnd | Handle to the window to which the message should be sent

Comments

This structure is used with the WM_LTANNEVENT message LTANNEVENT_HIGHLIGHT in the lParam argument. This message is used when selecting the object (except for the rotated ellipse, protractor, ruler, and cross product objects), changing the object using automation, or changing the object by making calls to L_AnnDefine. The message is also useful for updating information about an annotation in real time.


ANNHITTESTINFO

ANNHITTESTINFO (Document/Medical only)

typedef struct tagANNHITTESTINFO
{
L_UINT uStructSize; //size of this structure
L_INT nHandleIndex;
L_INT nHandleID;
L_INT nReserved;
} L_FAR *pANNHITTESTINFO, ANNHITTESTINFO;

The ANNHITTESTINFO structure provides hit test information for the L_AnnHitTestExt function.

Member | Description
uStructSize | Size of this structure. Use sizeof(HITTESTINFO).
nHandleIndex | This is the zero-based index of the handle. This field is valid only if puResult of L_AnnHitTestExt is updated with either ANNHIT_HANDLE or ANNHIT_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". This index can be used with other annotation handle functions.
nHandleID | The unique ID associated with the user handle. The ID can be set with the L_AnnAddUserHandle, L_AnnChangeUserHandle, L_AnnEnumerateHandles functions.
nReserved | Reserved for future use. Set this field to zero.

Comments

For an example showing the use of this structure, refer to L_AnnHitTestExt.

See Also

Functions:

L_AnnHitTestExt, L_AnnAddUserHandle, L_AnnChangeUserHandle, L_AnnEnumerateHandles


ANNHYPERLINK

ANNHYPERLINK (Document/Medical only)

typedef struct tagANNHYPERLINK
{
L_UINT uStructSize;
L_UINT uLinkMsg;
L_UINT uLinkParam;
L_TCHAR *pLinkText;
L_UINT uLinkType;
} ANNHYPERLINK, L_FAR *pANNHYPERLINK;

The ANNHYPERLINK structure contains information about the changes to be made in automated mode to the specified object.

Member | Description
uStructSize | Size of the ANNHYPERLINK structure. Use sizeof(ANNHYPERLINK).
uLinkMsg | Value indicating a user-defined message that will be sent to the window associated with the annotation object if uType is ANNLINK_USERMSG.
uLinkParam | wParam value that is passed to the user-defined message if uType is ANNLINK_USERMSG.
pLinkText | Character string containing the program to run when the object is clicked, if uType is ANNLINK_RUN. If uType is ANNLINK_WEBPAGE, it is the URL to be accessed by the default browser. This string should be NULL terminated. This parameter is ignored if uType contains any other value.
uLinkType | Constant that specifies the object's hyperlink type. Possible values are:
 | Value | Meaning
 | ANNLINK_NONE | [0x0000] Object has no hyperlink.
 | ANNLINK_LTANNEVENT | [0x0001] WM_LTANNEVENT message will be sent with LTANNEVENT_HYPERLINK
 | ANNLINK_USERMSG | [0x0002] The user-defined message will be sent with wParam as the wParam message of this function and lParam containing the handle of the object.
 | ANNLINK_RUN | [0x0003] The program specified in pLink will be run. Both the program and the command line parameters have to be specified in pLink.
 | ANNLINK_WEBPAGE | [0x0004] The web page with the URL specified in pLink will be opened in the current browser. Note that not all web browsers accept a page on the command line. Some will simply go to their default home page.

Comments

This structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

See Also

Topics:

WM_LTANNEVENT


ANNMOUSEPOS (Document/Medical only)

typedef struct _ANNMOUSEPOS
{
L_BOOL fDoubleClick;
POINT pt;
L_UINT uKeyFlags;
L_BOOL fUpdatePos;
} ANNMOUSEPOS, L_FAR *pANNMOUSEPOS;

The ANNMOUSEPOS structure contains information about the mouse position and status.

Member | Description
fDoubleClick | Flag that indicates whether the mouse button has been double clicked. This value is valid only during the LTANNEVENT_LBUTTONDOWN message. Possible values are:
 | Value | Meaning
 | TRUE | The left mouse button has been double clicked.
 | FALSE | The left button has only been clicked once.
pt | A POINT structure that contains the mouse position, in client area coordinates. These coordinates can be changed. If these coordinates are changed, the mouse cursor will be updated only if fUpdatePos is TRUE.
uKeyFlags | Flags that indicate the combination of keys pressed. Possible values are given below, and may be combined.
 | Value | Meaning
 | MK_LBUTTON | [0x0001] Left mouse button is down.
 | MK_RBUTTON | [0x0002] Right mouse button is down.
 | MK_SHIFT | [0x0004] Shift key is down.
 | MK_CONTROL | [0x0008] Control button is down.
 | MK_MBUTTON | [0x0010] Middle mouse button is down.
fUpdatePos | Flag that indicates whether to update the mouse cursor with any changes made to pt. Possible values are:
 | Value | Meaning
 | TRUE | Update the mouse cursor with changes to pt.
 | FALSE | Do not update the mouse cursor with changes to pt.

Comments

Please note that if you set fUpdatePos to FALSE and change pt during an LTANNEVENT_MOUSEMOVE, you must update the cursor each time a change in pt occurs during LTANNEVENT_MOUSEMOVE. You must also update the cursor at the LTANNEVENT_LBUTTONUP message.

The MK_XXXX values are defined in the Window header files (WINDOWS.H for 16-bit MSVC compilers or WINUSER.H for 32-bit MSVC compilers).

See Also

Topics:

WM_LTANNEVENT


ANNMOVE (Document/Medical only)

typedef struct tagANNMOVE
{
L_UINT uStructSize;
L_INT nState;
POINT pt;
} ANNMOVE, L_FAR *pANNMOVE;

The ANNMOVE structure contains information about an annotation object when moving the object in automated mode.

Member | Description
uStructSize | Size of the ANNMOVE structure. Use sizeof(ANNMOVE).
nState | Value that indicates the state of the move. Possible values are:
 | Value | Meaning
 | STATE_BEGIN | [1]
 | STATE_UPDATE | [2]
 | STATE_END | [3]
pt | Current move location (in client coordinates)

Comments

The ANNMOVE structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

An annotation object can be moved in automated mode by dragging the object with the mouse. Doing so causes a WM_LTANNEVENT message to be sent where wParam is ANNCHANGE_MOVE and lParam points to a structure of type ANNCHANGEPARAM. In this case, the union of ANNCHANGEPARAM is type ANNMOVE. This message is sent when one of the following events occurs:

Starting the move (with a mouse click): Two messages are sent, one before and one after the initial mouse click. The nState field is set to STATE_BEGIN. The pt field contains the location of the mouse click, in client coordinates.

Moving the object (by dragging the mouse): Pairs of messages (one before and one after) are sent for each mouse move. The nState field is set to STATE_UPDATE, and the pt field contains the location of the mouse.

Ending the move (by releasing the mouse): One pair of messages is sent (one before and one after) for the mouse up. The nState field is set to STATE_END, and the pt field contains the location of the mouse when released.

See Also

Topics:

WM_LTANNEVENT


ANNMOVEPOINT

ANNMOVEPOINT (Document/Medical only)

typedef struct tagANNMOVEPOINT
{
L_UINT uStructSize;
L_INT nState;
POINT pt;
L_UINT uIndex;
ANNPOINT apt;
} ANNMOVEPOINT, L_FAR *pANNMOVEPOINT;

The ANNMOVEPOINT structure contains information about an annotation object when moving a point of the object in automated mode.

Member | Description
uStructSize | Size of the ANNCHANGEPARAM structure. Use sizeof(ANNCHANGEPARAM).
nState | Value that indicates the state of the move. Possible values are:
 | Value | Meaning
 | STATE_BEGIN | [1]
 | STATE_UPDATE | [2]
 | STATE_END | [3]
pt | Current move location (in client coordinates)
uIndex | Index of the point (handle) being moved. The index can be used with other functions like L_AnnGetUserHandle, L_AnnChangeUserHandle, L_AnnDeleteUserHandle, and L_AnnEnumerateHandles.
apt | Current location of point being moved, in container coordinates.

Comments

The ANNMOVEPOINT structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

A handle of an annotation object can be moved in automated mode by dragging the handle with the mouse. Doing so causes a WM_LTANNEVENT message to be sent where wParam is ANNCHANGE_ ANNCHANGE_MOVE_POINT and lParam points to a structure of type ANNCHANGEPARAM. In this case, the union of ANNCHANGEPARAM is type ANNMOVEPOINT. This message is sent when one of the following events occurs:

Starting the move point (with a mouse click): two messages are sent, one before and one after the initial mouse click. The nState field is set to STATE_BEGIN. The pt field contains the location of the mouse click, in client coordinates.

Moving the point of the object (by dragging the mouse): Pairs of messages (one before and one after) are sent for each mouse move. The nState field is set to STATE_UPDATE, and the pt field contains the location of the mouse.

Ending the move point (by releasing the mouse): One pair of messages is sent (one before and one after) for the mouse up. The nState field is set to STATE_END, and the pt field contains the location of the mouse when released.

See Also

Topics:

WM_LTANNEVENT


ANNNAMEOPTIONS (Document/Medical only)

typedef struct tagANNNAMEOPTIONS
{
L_UINT32 uStructSize;
L_UINT uFlags;
L_BOOL bShowName;
L_TCHAR *pszName;
L_UINT uNameLen;
ANNPOINT ptNameOffset;
L_BOOL bNameRestrict;
COLORREF crNameFore;
COLORREF crNameBack;
ANNFONT NameFont;
L_BOOL bNameBackTransparent;
L_INT32 nReserved;
} ANNNAMEOPTIONS, L_FAR *pANNNAMEOPTIONS;

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNNAMEOPTIONS)
uFlags | Identifies which fields are valid. Possible values are one or more of the following constants "or"ed together. Possible values are:
 | Value | Meaning
 | ANNNAME_SHOW_NAME | [0x0001] bShowName field is valid.
 | ANNNAME_NAME | [0x0002] pszName field is valid.
 | ANNNAME_NAME_LENGTH | [0x0004] uNameLen is valid.
 | ANNNAME_OFFSET | [0x0008] ptNameOffset is valid.
 | ANNNAME_RESTRICT | [0x0010] bNameRestrict is valid.
 | ANNNAME_FORECOLOR | [0x0020] crNameFore is valid.
 | ANNNAME_BACKCOLOR | [0x0040] crNameBack is valid.
 | ANNNAME_BACK_TRANSPARENT | [0x0080] bNameBackTransparent is valid.
 | ANNNAME_FONT_BOLD | [0x0100] NameFont.bFontBold is valid.
 | ANNNAME_FONT_ITALIC | [0x0200] NameFont.bFontItalic is valid.
 | ANNNAME_FONT_STRIKEOUT | [0x0400] NameFont.bFontStrikeOut is valid.
 | ANNNAME_FONT_UNDERLINE | [0x0800] NameFont.bFontUnderline is valid.
 | ANNNAME_FONT_NAME | [0x1000] NameFont.szFontName is valid.
 | ANNNAME_FONT_SIZE | [0x2000] NameFont.dFontSize is valid.
 | ANNNAME_FONT_INFO | (ANNNAME_FONT_BOLD | .// The entire NameFont field is valid
 |  | ANNNAME_FONT_ITALIC |
 |  | ANNNAME_FONT_STRIKEOUT |
 |  | ANNNAME_FONT_UNDERLINE |
 |  | ANNNAME_FONT_SIZE |
 |  | ANNNAME_FONT_NAME)
 | ANNNAME_ALL | (ANNNAME_SHOW_NAME | All fields are valid
 |  | ANNNAME_NAME |
 |  | ANNNAME_NAME_LENGTH |
 |  | ANNNAME_OFFSET |
 |  | ANNNAME_RESTRICT |
 |  | ANNNAME_FORECOLOR |
 |  | ANNNAME_BACKCOLOR |
 |  | ANNNAME_BACK_TRANSPARENT |
 |  | ANNNAME_FONT_INFO)

bShowName | Flag that indicates whether to show or hide the annotation object name. Possible values are:
 | Value | Meaning
 | TRUE | Show the annotation object name
 | FALSE | Hide the annotation object name
pszName | Null terminated character string containing the name
uNameLen | Length of string, including the NULL terminator
ptNameOffset | Offset of name. The name offset is the x and y offset (in pixels viewed at 100%) relative to the upper left corner of the bounding box of the annotation object.
bNameRestrict | Flag that indicates whether the annotation object name is restricted to appear fully within the bitmap. Possible values are:
 | Value | Meaning
 | TRUE | Restrict the annotation name to within the bitmap. (Annotation container).
 | FALSE | Allow the annotation name to be moved outside the container.
crNameFore | Foreground color of the name text
crNameBack | Background color of the name text
NameFont | Font used to display the name text. For more information, refer to the documentation for ANNFONT.
bNameBackTransparent | Flag that indicates whether the background text color is transparent. Possible values are:
 | Value | Meaning
 | TRUE | Background text color is transparent.
 | FALSE | Use crNameBack for the background color of the text.
nReserved | Reserved for future use. Use zero.

Comments

The ANNNAMEOPTIONS structure is used with the functions L_AnnSetNameOptions and L_AnnGetNameOptions to get or set the name options on any annotation object.

When calling L_AnnGetNameOptions, the uFlags field identifies which fields to retrieve. When calling L_AnnSetNameOptions, the uFlags field identifies which fields to set.

When you create an object in the automation mode, the values for bShowName, ptNameOffset, and bNameRestrict are taken from the automation object. The name of the object is also taken from the automation object, specifically from the ANNAUTOTEXT_ITEM_DEFAULTNAME item. This is just like the annotation text, which is by default "AaBbYyZz" and is taken from ANNAUTOTEXT_ITEM_DEFAULTTEXT item.

The default name is "", which means that the objects will not show a name when you create them. To set a default name, call L_AnnSetAutoText with uItem set to ANNAUTOTEXT_ITEM_DEFAULTNAME, and pText set to your desired default string. For example:

L_AnnSetAutoText(hAutomation, ANNAUTOTEXT_ITEM_DEFAULTNAME, TEXT("Default_name"));

The name offset of an annotation object (value pointed to by pNameOffset) is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset values (pNameOffset.x, pNameOffset.y) are in pixels, where the image is viewed at 100%. The name offset can be changed in any of the following ways:

1. | Programmatically using L_AnnSetNameOptions.
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.

The name of an annotation object may be restricted so that it fully appears on the bitmap. For example, if the variable pointed to by pbNameRestrict is TRUE for an object, the name offset cannot be set so that the object name is outside the bitmap (annotation container). Suppose you have a 200x200 bitmap with a 100x100 button in the lower right corner. The name of the button is "BUTTON". Attempting to set the name offset to anything larger than (43,100) by any of the above methods will result in the name offset being set to (43,100). Also, 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.

When retrieving the name text, you must first call L_AnnGetNameOptions to determine the length of the character string. Then, you must allocate a character string of this length, and call L_AnnGetNameOptions again.

The sample illustrates this.

Example

For an example, refer to L_AnnSetNameOptions.


ANNPOINT (Document/Medical only)

typedef struct _ANNPOINT
{
L_DOUBLE x;
L_DOUBLE y;
} ANNPOINT, L_FAR *pANNPOINT;

The ANNPOINT structure defines coordinates of an annotation object relative to its container. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

Member | Description
x | The x coordinate, expressed as a double-precision floating point value.
y | The x coordinate, expressed as a double-precision floating point value.

Comments

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

The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.


ANNPOINTOPTIONS (Document/Medical only)

typedef struct tagANNPOINTOPTIONS
{
L_UINT32 uStructSize;
L_UINT uFlags;
L_BOOL bPointUseBitmap;
pBITMAPHANDLE pPointBitmap;
L_BOOL bPointBitmapTransparent;
COLORREF crPointBitmapTransparentColor;
L_INT32 nPointRadius;
COLORREF crPointBorderColor;
L_BOOL bPointTransparentFill;
COLORREF crPointFillColor;
L_BOOL bPointFixedSize;
L_INT32 nReserved;
} ANNPOINTOPTIONS, L_FAR *pANNPOINTOPTIONS;

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNENCRYPTOPTIONS)
uFlags | Flag that indicates which fields are valid. Possible values are one or more of the following constants "or"ed together.
 | Value | Meaning
 | ANNPOINT_USE_BITMAP | [0x001] bPointUseBitmap field is valid.
 | ANNPOINT_BITMAP | [0x002] pPointBitmap field is valid.
 | ANNPOINT_BITMAP_TRANSPARENT | [0x004] bPointBitmapTransparent field is valid
 | ANNPOINT_BITMAP_TRANSPARENT_COLOR | [0x008] crPointBitmapTransparentColor field is valid.
 | ANNPOINT_RADIUS | [0x010] nPointRadius field is valid.
 | ANNPOINT_BORDER_COLOR | [0x020] crPointBorderColor field is valid.
 | ANNPOINT_FILL_COLOR | [0x040] crPointFillColor field is valid.
 | ANNPOINT_TRANSPARENT_FILL | [0x080] bPointTransparentFill field is valid.
 | ANNPOINT_FIXED_SIZE | [0x100] bPointFixedSize field is valid.
 | ANNPOINT_ALL | [0x1ff] All fields are valid.

bPointUseBitmap | Flag that indicates whether to draw the point using the current point bitmap or as a circle. Possible values are:
 | Value | Meaning
 | TRUE | Draw the point using the current point bitmap.
 | FALSE | Draw the point as a circle.
pPointBitmap | Pointer to a BITMAPHANDLE structure that gets or sets the point bitmap.
bPointBitmapTransparent | Flag that indicates whether there is a transparent color. Possible values are:
 | Value | Meaning
 | TRUE | If the point is drawn using a bitmap, draw with a transparent color.
 | FALSE | If the point is drawn using a bitmap, there is no transparent color.
crPointBitmapTransparentColor | If the point is drawn as a bitmap, and bPointBitmapTransparent is TRUE, this specifies the transparent color.
nPointRadius | If the point is drawn as a circle, this specifies the radius in pixels (assuming no zooming).
crPointBorderColor | If the point is drawn as a circle, this is the outline color
bPointTransparentFill | Flag for a point drawn as a circle that indicates whether the inside is transparent or uses the fill color. Possible values are:
 | Value | Meaning
 | TRUE | If the point is drawn as a circle, the inside is transparent.
 | FALSE | If the point is drawn as a circle, the fill color is crPointFillColor.
crPointFillColor | If the point is drawn as a circle, this is the fill color.
bPointFixedSize | Flag for a point drawn as a circle that indicates whether the point is a fixed size. Possible values are:
 | Value | Meaning
 | TRUE | If the point is drawn as a circle, the size does not change, regardless of the zoom factor
 | FALSE | If the point is drawn as a circle, the size changes with the zoom factor.
nReserved | Reserved for future use. Must set this field to zero.

Comments

The ANNPOINTOPTIONS structure is used with the functions L_AnnSetPointOptions and L_AnnGetPointOptions to get or set options on an annotation point object.

When calling L_AnnGetPointOptions, the uFlags field identifies which fields to retrieve. When calling L_AnnSetPointOptions, the uFlags field identifies which fields to set.

To get the bitmap of the current point object (hObject), do the following:

memset(&PointOptions, 0, sizeof(ANNPOINTOPTIONS));
PointOptions.nSize = sizeof(ANNPOINTOPTIONS);
PointOptions.uFlags = ANNPOINT_BITMAP;
PointOptions. pPointBitmap = &PointBitmap;
L_AnnGetPointOptions(hObject, &PointOptions);

If the call to L_AnnGetPointOptions is successful, PointBitmap now contains the point bitmap. You must call L_FreeBitmap (&PointBitmap) when you are finished with the bitmap.

If the point is being drawn using a bitmap, the current default point bitmap is used. This can be changed by making the pPointBitmap field point to a valid LEAD bitmap handle, adding the ANNPOINT_BITMAP flag to the uFlags field, and calling L_AnnSetPointOptions.

If bPointBitmapTransparent is TRUE, then the point bitmap is displayed with transparency, where crPointBitmapTransparentColor is the transparent color.

If the point is not being drawn using a bitmap, it is displayed as a circle with the following properties:

Radius is nPointRadius

Outline color is crPointBorderColor

If bPointTransparentFill is TRUE, then the inside of the point is transparent

If bPointTransparentFill is FALSE, then the inside of the point is drawn with color crFillColor

If bPointFixedSize is TRUE, the size of the point remains constant, regardless of the zoom factor

If bPointFixedSize is FALSE, the size of the point changes with the zoom factor


ANNPROTRACTOR

ANNPROTRACTOR (Document/Medical only)

typedef struct tagANNPROTRACTOR
{
L_UINT uStructSize;
L_BOOL bAcute;
L_UINT uAngleUnit;
L_UINT uAnglePrecision;
L_DOUBLE dArcRadius;
L_TCHAR *pszAbbrev;
} ANNPROTRACTOR, L_FAR *pANNPROTRACTOR;

The ANNPROTRACTOR structure contains information about the changes to be made in automated mode to the specified object.

Member | Description
uStructSize | Size of the ANNPROTRACTOR structure. Use sizeof(ANNPROTRACTOR).
bAcute | Flag that indicates which angle to set. Possible values are:
 | Value | Meaning
 | TRUE | Set the acute angle. (<180 degrees)
 | FALSE | Set the obtuse angle. (>180 degrees)

uAngleUnit | Flag that indicates the units of the angle. Possible values are:
 | Value | Meaning
 | ANNANGLE_DEGREES | Measure the angle in degrees.
 | ANNANGLE_RADIANS | Measure the angle in radians.
uAnglePrecision | The number of digits after the decimal. ( "." ) dArcRadius The arc radius.
pszAbbrev | Character string that contains the abbreviation to be put after the angle. Use NULL to set the default abbreviation for the specified unit.

Comments

This structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

See Also

Topics:

WM_LTANNEVENT


ANNRECT (Document/Medical only)

typedef struct _ANNRECT
{
L_DOUBLE left;
L_DOUBLE top;
L_DOUBLE right;
L_DOUBLE bottom;
} ANNRECT, L_FAR *pANNRECT;

The ANNRECT structure defines coordinates of an annotation object's defining rectangle. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

Member | Description
left | The left coordinate, expressed as a double-precision floating point value.
top | The top coordinate, expressed as a double-precision floating point value.
right | The right coordinate, expressed as a double-precision floating point value.
bottom | The bottom coordinate, expressed as a double-precision floating point value.

Comments

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

The ANNRECT structure is like a Windows RECT structure, except that it uses double-precision floating point values.


ANNRESIZEROTATE (Document/Medical only)

typedef struct tagANNRESIZEROTATE
{
L_UINT uStructSize;
L_INT nState;
pANNXFORM pAnnXForm;
L_DOUBLE dAngle;
} ANNRESIZEROTATE, L_FAR *pANNRESIZEROTATE;

The ANNRESIZEROTATE structure contains information about an annotation object when resizing and/or rotating an object in automated mode.

Member | Description
uStructSize | Size of the ANNCHANGEPARAM structure. Use sizeof(ANNCHANGEPARAM).
nState | Value that indicates the state of the move. Possible values are:
 | Value | Meaning
 | STATE_BEGIN | [1]
 | STATE_UPDATE | [2]
 | STATE_END | [3]
pAnnXForm | Pointer to a structure of type ANNXFORM.
dAngle | Angle of rotation in degrees. Positive is clockwise, and negative is counter-clockwise.

Comments

The ANNRESIZEROTATE structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

When doing any of the following (in automated mode or by calling L_AnnDefine explicitly)

Rotate—Shift-clicking a handle in automated mode

Resizing—dragging a vertex of a rectangular object

Resize/Rotate—by calling L_AnnDefine with ANNDEFINE_BEGINMOVEPOINT for a rectangular object (one of the following objects)

ANNOBJECT_RECT

ANNOBJECT_ELLIPSE

ANNOBJECT_HILITE

ANNOBJECT_REDACT

ANNOBJECT_TEXT

ANNOBJECT_NOTE

ANNOBJECT_STAMP

ANNOBJECT_HOTSPOT

A WM_LTANNEVENT message is sent where wParam is ANNCHANGE_RESIZE, ANNCHANGE_ROTATE, or ANNCHANGE_RESIZE_ROTATE.

The lParam field points to a structure of type ANNCHANGEPARAM. In this case, the union of ANNCHANGEPARAM is type ANNRESIZEROTATE. This message is sent when one of the following events occurs:

Starting the resize/rotate (with a mouse click): two messages are sent, one before and one after the initial mouse click. The nState field is set to STATE_BEGIN. The dAngle field is zero intially, regardless of the orientation of the object.

Updating the resize/rotate (by dragging the mouse): Pairs of messages (one before and one after) are sent for each mouse move. The nState field is set to STATE_UPDATE, and the dAngle field contains angle of rotation relative to the original angle. For example, if the original object was already rotated 15 degrees, and the object is rotated 20 degrees more, dAngle would be 20 degrees.

Ending the resize/rotate (by releasing the mouse): One pair of messages is sent (one before and one after) for the mouse up. The nState field is set to STATE_END, and the dAngle field contains the final angle, relative to the original angle.

The pANNXFORM is a pointer to a structure of type ANNXFORM. In each of the three cases above, the ANNXFORM contains a matrix that is about to be (when bAfter is FALSE) or already has been (when bAfter is TRUE) applied to the object.

See Also

Topics:

WM_LTANNEVENT


ANNRULERUNIT

ANNRULERUNIT (Document/Medical only)

typedef struct tagANNRULERUNIT
{
L_UINT uStructSize;
L_UINT uUnit;
L_TCHAR L_FAR *pAbbrev;
L_UINT uPrecision;
} ANNRULERUNIT, L_FAR *pANNRULERUNIT;

The ANNRULERUNIT structure contains information about the changes to be made in automated mode to the specified object.

Member | Description
uStructSize | Size of the ANNRULERUNIT structure. Use sizeof(ANNRULERUNIT).
uUnit | The unit of measure of the ruler. Possible values are:
 | Value | Meaning
 | ANNUNIT_INCH | [0x0000] Inches
 | ANNUNIT_FEET | [0x0001] Feet
 | ANNUNIT_YARDS | [0x0002] Yards
 | ANNUNIT_MICROMETERS | [0x0003] Micrometers
 | ANNUNIT_MILIMETERS | [0x0004] Millimeters
 | ANNUNIT_CENTIMETERS | [0x0005] Centimeters
 | ANNUNIT_METERS | [0x0006] Meters
 | ANNUNIT_TWIPS | [0x0007] Twips
 | ANNUNIT_POINTS | [0x0008] Points
 | ANNUNIT_PIXELS | [0x0009] Pixels
pAbbrev | Address of the character string containing the unit abbreviation string to be displayed after the distance.
uPrecision | Number of digits to be displayed after the decimal place.

Comments

This structure is part of the union of the ANNCHANGEPARAM structure. For more information, see the documentation for ANNCHANGEPARAM.

See Also

Topics:

WM_LTANNEVENT


ANNSMARTDISTANCE (Document/Medical only)

typedef struct tagANNSMARTDISTANCE
{
L_UINT uStructSize;
L_DOUBLE dDistance;
L_UINT uRulerUnit;
L_UINT uSmartUnit;
} ANNSMARTDISTANCE, *pANNSMARTDISTANCE;

The ANNSMARTDISTANCE contains information about the unit to be used for a ruler.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNSMARTDISTANCE)
dDistance | Distance in appropriate units. The field uSmartUnit identifies the unit.
uRulerUnit | Value that specifies the type of measurement. Can be any one of the following constants:
 | Value | Meaning
 | ANNUNIT_INCHES | [0] Inches.
 | ANNUNIT_FEET | [1] Feet.
 | ANNUNIT_YARDS | [2] Yards.
 | ANNUNIT_MICROMETERS | [3] Micrometers.
 | ANNUNIT_MILLIMETERS | [4] Millimeters.
 | ANNUNIT_CENTIMETERS | [5] Centimeters.
 | ANNUNIT_METERS | [6] Meters.
 | ANNUNIT_TWIPS | [7] Twips.
 | ANNUNIT_POINTS | [8] Points.
 | ANNUNIT_PIXELS | [9] Pixels.
 | ANNUNIT_SMART_METRIC | [10] Smart Metric.
 | ANNUNIT_SMART_ENGLISH | [11] Smart English.
 | If uRulerUnit is ANNUNIT_SMART_METRIC or ANNUNIT_SMART_ENGLISH, then the actual units can be found in the uSmartUnit member. If uRulerUnit is not one ANNUNIT_SMART_METRIC or ANNUNIT_SMART_ENGLISH, then uRulerUnit contains the unit constant.
uSmartUnit | Value that specifies the base unit of measure. Always contains the unit constant. This can be any of the ANNUNIT_XXX constants EXCEPT ANNUNIT_SMART_METRIC or ANNUNIT_SMART_ENGLISH.

Comments

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 ANNUNIT_INCHES, then the length is 13. However, if the units of the ruler are ANNUNIT_SMART_ENGLISH, then the length of the ruler is automatically promoted to feet. The length in this case would be 1.0833 feet.

For more information, see the documentation for L_AnnGetDistance2.

See Also

Functions: | L_AnnGetDistance2
Topics: | Using Rulers in Annotation Objects


ANNTEXTOPTIONS (Document/Medical only)

typedef struct tagANNTEXTOPTIONS

{
L_UINT uStructSize; // size of this structure
L_UINT uFlags;
L_BOOL bShowText; // TRUE if you want to show the text
L_BOOL bShowBorder; // TRUE if you want to show the border
COLORREF crText;
L_INT32 nReserved;
} ANNTEXTOPTIONS, L_FAR*pANNTEXTOPTIONS;

Provides information about the text options for text annotation objects, including the Automation object.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNTEXTOPTIONS)
uFlags | Flags that identify which fields 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
 | ANNTEXT_SHOW_TEXT (0x001) | The bShowText field is valid.
 | ANNTEXT_SHOW_BORDER (0x002) | The bShowBorder field is valid.
 | ANNTEXT_TEXTCOLOR (0x002) | The crText field is valid.
 | ANNTEXT_ALL | Logical or of all above flags.

bShowText | 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.
bShowBorder | 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.
crText | A COLORREF value that represents the color to be used for the text.
nReserved | Reserved for future use. Use zero.

Comments

The ANNTEXTOPTIONS structure is used with the L_AnnSetTextOptions and the L_AnnGetTextOptions functions to get or set the text options for text annotation objects, including the Automation object.

When calling the L_AnnGetTextOptions function, the uFlags field identifies which fields to retrieve. When calling the L_AnnSetTextOptions function, the uFlags field identifies which fields to set.

When you create an object in the automation mode, the values for bShowText, bShowBorder, and crText are taken from the Automation object.

The default value for bShowText is TRUE, which means that text objects will show text. The default value for crText is red (RGB(255,0,0). This flag applies to all text objects including:

ANNOBJECT_CONTAINER

ANNOBJECT_AUTOMATION

ANNOBJECT_TEXT

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_TEXT

ANNOBJECT_STAMP

ANNOBJECT_PUSHPIN

ANNOBJECT_TEXTPOINTER

The default value for bShowBorder is TRUE. This flag affects the following objects:

ANNOBJECT_TEXT

ANNOBJECT_STAMP

These values can be changed through automation by right clicking the object, and choosing Properties->Text.

Note that in version 14.5, the L_AnnSetTextOptions function and the L_AnnGetTextOptions function must first be enabled using the L_AnnSetOptions function before they can be used.

Example

For an example, refer to L_AnnGetTextOptions.


ANNTEXTTOKEN (Document/Medical only)

typedef struct tagANNTEXTTOKEN
{
L_UINT uStructSize;
L_TCHAR cToken;
L_TCHAR *pszDesc;
L_TCHAR *pszTokenString;
ANNTEXTTOKENTYPE nTokenType;
L_INT nReserved;
} ANNTEXTTOKEN, *pANNTEXTTOKEN;

The ANNTEXTTOKEN structure contains information about the tokens for an annotation object.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNTEXTTOKEN)
cToken | Character representing the token. This can be ANY ascii character EXCEPT ‘#’, because the token ## is reserved to display the # character.
pszDesc | Pointer to a text 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.
pszTokenString | This member is used only if nTokenType is ANNTOKEN_TEXT. If nTokenType is not ANNTOKEN_TEXT, then pszTokenString is ignored. The pszTokenString can be any combination of existing token strings, or any new string.
nTokenType | Identifies the type of token. Must be one of the constants in the following:
 | 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 (i.e. January)
 | ANNTOKEN_DATE_DAY_OF_WEEK | [8] Current day of week (i.e. 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)
 | nReserved | Reserved for future use. Set this member to 0.

Comments

The ANNTEXTTOKEN structure is used in the following functions:

L_AnnInsertTextTokenTable ()

L_AnnEnumerateTextTokenTable()

For more information, see the topic The Annotation Text Token Table.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnDeleteTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnGetTextExpandTokens, L_AnnInsertTextTokenTable, L_AnnSetTextExpandTokens
Topics: | The Annotation Text Token Table


ANNTEXTTOKENTYPE (Document/Medical only)

typedef enum{
ANNTOKEN_NONE = 0,
ANNTOKEN_SEPARATOR = 1,
ANNTOKEN_TEXT = 2,
ANNTOKEN_DATE_YYYY = 3,
ANNTOKEN_DATE_YY = 4,
ANNTOKEN_DATE_MM = 5,
ANNTOKEN_DATE_DD = 6,
ANNTOKEN_DATE_MONTH_NAME = 7,
ANNTOKEN_DATE_DAY_OF_WEEK = 8,
ANNTOKEN_TIME_HH_12 = 9,
ANNTOKEN_TIME_HH_24 = 10,
ANNTOKEN_TIME_MM = 11,
ANNTOKEN_TIME_SS = 12,
ANNTOKEN_TIME_MILLISECONDS = 13,
ANNTOKEN_AM_PM = 14,
} ANNTEXTTOKENTYPE, *pANNTEXTTOKENTYPE;

Comments

The ANNTEXTTOKENTYPE enumeraion is used in the following structure:

ANNTEXTTOKEN


ANNTOOL (Document/Medical only)

typedef struct _ANNTOOL
{
L_UINT uStructSize;
L_UINT uTool;
L_INT nMenuTextID;
L_TCHAR L_FAR pMenuText;
} ANNTOOL, L_FAR *pANNTOOL;

The ANNTOOL structure contains information about a tool associated with a button in the annotation toolbar.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uTool | Constant that specifies an annotation tool. For a list of available tools, refer to Annotation Toolbar Buttons.
nMenuTextID | Index into the annotation menu dialog strings. If this value is -1, the menu text for the associated tool is in pMenuText. If this value is >= 0, the menu text for the associated tool comes the corresponding set of dialog strings.
pMenuText | Character string that contains the menu text for the associated tool. This is only valid if nMenuTextID is -1.

Comments

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

See Also

Topics:

ANNBUTTON


ANNTOOLBARINFO (Document/Medical only)

typedef struct _ANNTOOLBARINFO
{
L_UINT uStructSize;
L_UINT uButtons;
L_UINT uRows;
L_UINT uColumns;
} ANNTOOLBARINFO, L_FAR *pANNTOOLBARINFO;

The ANNTOOLBARINFO structure contains information about the layout of the annotation toolbar.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uButtons | Number of buttons in the toolbar.
uRows | Number of rows in the toolbar.
uColumns | Number of columns in the toolbar.

Comments

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

To retrieve information about the layout of the toolbar, call L_AnnGetToolBarInfo.

To modify the layout of the toolbar, call L_AnnSetToolBarColumns and L_AnnSetToolBarRows.

See Also

Functions:

L_AnnGetToolbarInfo, L_AnnSetToolBarColumns, L_AnnSetToolBarRows


ANNXFORM (Document/Medical only)

typedef struct _ANNXFORM {
L_DOUBLE r11;
L_DOUBLE r12;
L_DOUBLE r21;
L_DOUBLE r22;
L_DOUBLE tx;
L_DOUBLE ty;
} ANNXFORM, L_FAR *pANNXFORM;

The ANNXFORM structure is used to store a matrix that represents a combination of translates, rotates, shears, and scales.

Member | Description
r11 | See comments.
r12 | See comments.
r21 | See comments.
r22 | See comments.
tx | Horizontal translation
ty | Vertical translation

Comments

The ANNXFORM structure is used to store an arbitrary combination of translations, rotations, scales, and shears.

It is used with the WM_LTANNEVENT message when wParam is LTANNEVENT_AUTOITEMCHANGING and the type of change is ANNTYPE_RESIZE_ROTATE. In this case, one of the fields of the ANNCHANGEPARAM structure is a pANNXORM, which indicates the changes that is about to take place, or already has taken place.

The fields tx and ty are used for horizontal and vertical translation. The fields tx, ty, r11, r12, r21, and r22 are used as follows:

Matrix:

r11 | r12 | 0
r21 | r22 | 0
tx | ty | 1

Translation:

1 | 0 | 0
0 | 1 | 0
tx | ty | 1

Rotation: (‘a’ is angle of rotation)

cos(a) | sin(a) | 0
-sin(a) | cos(a) | 0
0 | 0 | 1

Scale: Sx is horizontal scaling, Sy is vertical scaling

Sx | 0 | 0
0 | Sy | 0
0 | 0 | 1

Operations are combined by multiplying the corresponding matrices.

For more information, see the documentation for the similar structure RGNXFORM, or the Microsoft MSDN documentation for the similar structure XFORM.


Keywords Used in Declarations

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

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


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

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


BITMAPHANDLE

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

Note:

Fields intended for internal use, such as the pointer to the bitmap, are omitted from the table. If necessary, you can refer to the LTKRN.H header file, which describes the entire structure.

Member | Data Type | Description
uStructSize | L_UINT | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Width | L_INT | Image width in pixels.
Height | L_INT | Image height in pixels.
BitsPerPixel | L_INT | Number of bits per pixel.
BytesPerLine | L_UINT | Bytes per line, rounded upward to the nearest multiple of four.
Flags.Allocated | L_BITFIELD | TRUE if the bitmap is allocated.
Flags.ConventionalMemory | L_BITFIELD | TRUE if the bitmap is allocated using conventional memory.
Flags. DiskMemory | L_BITFIELD | TRUE if the bitmap is allocated using LEAD's own virtual memory.
Flags.LockedMemory | L_BITFIELD | TRUE if the bitmap memory is locked down.
Flags.Progressive | L_BITFIELD | TRUE if an image is being loaded from a progressive JPEG file.
Flags.Tiled | L_BOOL | TRUE if the bitmap is a tiled bitmap.
Flags.WaitUserInput | L_BITFIELD | TRUE if the animation playback waits for user input.
Flags.Transparency | L_BITFIELD | TRUE if the animation playback uses transparency.
Flags.Compressed | L_BITFIELD | TRUE if the current bitmap is in 1-bit RLE-compressed format. For information about this format, refer to Speeding Up 1-Bit Documents.
Flags.Signed | L_BITFIELD | TRUE if the pixel values in the bitmap are signed.
Flags.SuperCompressed | L_BITFIELD | TRUE if the bitmap is in super compressed format. The bitmap can be 24-bit or 1-bit. For more information, refer to Super Compressed Bitmaps.
Flags.UseLUT | L_BITFIELD | TRUE if the LUT is used in all image processing functions, including save. FALSE if the LUT is used only when painting. If this is FALSE, the LUT is ignored when an image processing function is applied or when a file is saved.
nColors | L_INT | Number of colors (256 or less) that the bitmap has. If the image has more than 256 colors, this value is zero.

pPalette

L_RGBQUAD L_FAR*

Array of palette colors.

ViewPerspective | L_INT | Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective.
Order | L_INT | Color order of the bitmap. Possible values are ORDER_RGB, ORDER_BGR, ORDER_GRAY and ORDER_ROMM.
Size | L_UINT32 | Size of the bitmap image data, in bytes.
DitheringMethod | L_UINT | Dithering method (referenced by some functions). For possible values, refer to the L_DefaultDithering function.
XResolution | L_INT | Horizontal resolution, in dots per inch. Some file formats save this value in the file header.
YResolution | L_INT | Vertical resolution, in dots per inch. Some file formats save this value in the file header.
Left | L_INT | Left offset for animation playback.
Top | L_INT | Top offset for animation playback, based on a TOP_LEFT view perspective.
Delay | L_UINT32 | Animation playback delay in milliseconds (ms).
Background | COLORREF | Background color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
Transparency | COLORREF | Transparent color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
DisposalMethod | L_UINT | Animation playback disposal method. For possible values, refer to Animation Disposal Methods.
LowBit | L_INT | Value indicating the low bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as 0.
HighBit | L_INT | Value indicating the high bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as BitsPerPixel -1.
MinVal | L_INT32 | Minimum grayscale value. For every value between 0 and MinVal, Black (RGB(0,0,0)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal).(See * below)
MaxVal | L_UINT | Maximum grayscale value. For every value larger than MaxVal, White (RGB(255,255,255)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal). (See * below)

* index is the intensity value of the pixel. If the intensity value is > MaxVal, the color will be White. If the intensity value is < MinVal, the color will be Black. For those intensity values between MinVal and MaxVal, the above equation is used to determine the color, with index equal to the intensity value.

Comments

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

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

In most cases, the values of fields in the BITMAPHANDLE structure are maintained by LEADTOOLS functions.

Note: A 16-bpp image may be color or grayscale. If you are working with a 16-bit grayscale image, explicitly set BITMAPHANDLE.Order to ORDER_GRAY. By default, the Order for a 16-bit image will be set to ORDER_BGR.

Please note that tiled bitmaps will have Flags.ConventionalMemory set, since the bitmap is allocated in conventional memory. To determine whether a bitmap is "regular memory", do the following:

if (!pBitmap->Flags.Compressed && !pBitmap->Flags.Tiled)
{
// regular bitmap. It is not compressed and it is not tiled.
}

Support for super compressing bitmaps is available only in the Document/Medical toolkits.


FILEINFO

The FILEINFO structure, which is loaded by the L_FileInfo function, provides information about the specified file.

Note: The LTFIL.H header file describes the entire FILEINFO structure.

Member

Data Type

Description

uStructSize

L_UINT

Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.

Format

L_INT

File format. For possible values, refer to Formats of Input Files.

Name[16]

L_TCHAR

A 16-character array containing the null-terminated string that is the DOS file name. In WIN32, the name is truncated if it exceeds 15 characters.

Width

L_INT

Image width, in pixels.

Height

L_INT

Image height, in pixels.

BitsPerPixel

L_INT

Bits per pixel.

SizeDisk

L_INT32

Size of the file on disk (in bytes).

SizeMem

L_INT32

Amount of memory (in bytes) required to load the file.

Compression[20]

L_TCHAR

A 20-character array containing the null-terminated string that describes the compression method.

ViewPerspective

L_INT

Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective.

Order

L_INT

Color order of the bitmap. This field is meaningful if the image does not have a palette. It indicates whether the color values are in red-green-blue or blue-green-red order. Possible values are ORDER_RGB, ORDER_BGR and ORDER_GRAY.

PageNumber

L_INT

The page number in a multi-page file. To determine the total number of pages in a file, call L_FileInfo with uFlags set to FILEINFO_TOTALPAGES.

TotalPages

L_INT

The total number of pages present in a file. To update this field, call L_FileInfo with uFlags set to FILEINFO_TOTALPAGES. If you do not want this field updated, call L_FileInfo with uFlags set to 0.

XResolution

L_INT

Horizontal resolution, in dots per inch. Some file formats save this value in the file header.

YResolution

L_INT

Vertical resolution, in dots per inch. Some file formats save this value in the file header.

Flags

L_INT32

For possible values, refer to FILEINFO Flags.

GlobalLoop

L_UINT

Global animation loop count. 0 = infinity. This field is valid only if the FILEINFO_HAS_GLOBALLOOP flag is set.

GlobalWidth

L_INT

Global width for animation playback

GlobalHeight

L_INT

Global height for animation playback

GlobalBackground

COLORREF

Global background color for animation playback (FILEINFO Flags)

GlobalPalette[256]

RGBQUAD

Global palette for animation playback (FILEINFO Flags).

IFD

L_UINT32

Offset within a TIFF file where a page starts. This member is updated when L_FileInfo is called.

Layers

L_INT

Number of layers in the file. If this value is 0, then the file does not contain any layers. Only PSD files can have layers.

ColorSpace

L_INT

Color space of the file. The 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

Comments

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

Some functions which take this structure as a parameter require that the structure must be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

Note:

For more information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

Please note that if FILEINFO.Format is FILE_JPEG or FILE_TIF_JPEG and FILEINFO.BitsPerPixel is 8, then the image is 4:0:0 color space, not 4:4:4 color space.

Currently only PSD files support layers.


FlashPix Comments

Comments in FlashPix files are one contiguous block of memory, a Comments Block. Within the Comments Block are individual Comments which consist of a Comment header and Comment data. The Comment header contains information on the size and type of the Comment. The Comment header may be a FPXCOMMENT_HEADER_ELEMENT, if the Comment consists of a single item (a float or a short for example), or it may be a FPXCOMMENT_HEADER_ARRAY if the Comment consists of an array of items (an array of shorts, an array of chars, or an array of strings for example). These structures are as follows:

********************************************************************************************************************************************************************************************************************************

FPXCOMMENT_HEADER_ELEMENT

typedef struct _ FPXCOMMENT_HEADER_ELEMENT
{
L_UINT32 size;
L_UINT32 type;
} FPXCOMMENT_HEADER_ELEMENT;

Member | Description
size | size of the comment.
type | type of comment stored.

Comments

Size is given in bytes. Type refers to a value within the enumerated type FPXTYPE_DATA.

********************************************************************************************************************************************************************************************************************************

FPXCOMMENT_HEADER_ARRAY

typedef struct _ FPXCOMMENT_HEADER_ARRAY
{
L_UINT32 size;
L_UINT32 type;
L_UINT32 elements;
} FPXCOMMENT_HEADER_ARRAY;

Member | Description
size | size of the comment.
type | type of comment stored.
elements | number of elements in the array.

Comments

Size is given in bytes. Type refers to a value within the enumerated type FPXTYPE_DATA. Elements provides the number of elements in the array.

********************************************************************************************************************************************************************************************************************************

Following the Comment header is the Comment data. Comment data may consist of simple data such as a float value, sub-comments, or a combination of one or more simple data and one or more sub-comments. The sections making up a sub-comment will be referred to as sub-comment header and sub-comment data. Both Comments and sub-comments must be of a Comment type.

For example, a Comment of Comment type FlashPixLong would contain a Comment header FPXCOMMENT_HEADER_ELEMENT. This would be followed by the Comment data, consisting of a L_UINT32 (4 bytes) which holds the long value. A Comment of Comment type FlashPixCFAPatternBlock, however, has Comment data consisting of two integer values and a comment of Comment type FlashPixString. A list of FlashPix Comment types is provided at the end of this section. To better understand FlashPix file Comment organization, look through the following example.

Each cell in the graph below indicates 1 byte of memory. Therefore a L_UINT32 is 4 bytes in size.

The values given above the cells indicate the value stored in that segment of memory.

The Comment type is given in brackets beside the Comment name.

Wide characters are 2 bytes in size and are indicated by a character followed by a blank byte.

The example given here contains the Comments present in the "Content Description Group" (CMNT_FPXCONTENTDESCRIPTIONGROUP see FlashPix File Comments.). The first Comment, CMNT_FPXTESTTARGETINTHEIMAGE is of Comment type FlashPixLong. It consists of the FPXCOMMENT_HEADER_ELEMENT and a single Comment data element of type long. Within the Comment header, the leftmost L_UINT32 stores the size of the entire Comment. The 4 bytes of the long data element and the 8 bytes for the 2 L_UINT32 members in the Comment header gives a total of 12 bytes. The right L_UINT32 member in the Comment header stores the value 3 for the Comment type of this Comment [FlashPixLong]. Finally, the last L_UINT32 (data) holds the value of the Comment data itself ( 0x0 ).

The next Comment, CMNT_FPXGROUPCAPTION is very similar. The Comment header stores the size of the entire Comment (34 bytes) as well as the Comment type (FlashPixWideString) and the number of elements (11) in the string. The Comment data contains the string itself (MY FRIENDS). Notice that since the array is made up of wide characters, each character within the string is followed by an empty byte to indicate that the wide characters are 2 bytes in size. The space between words and the final '\0' are included in the number of wide characters.

The next Comment is almost identical to CMNT_FPXGROUPCAPTION.

The next Comment CMNT_FPXPEOPLEINTHEIMAGE gives an example Comment of Comment type FlashPixWideStringArray. This Comment header is FPXCOMMENT_HEADER_ARRAY. The first L_UINT32 stores the size of the entire Comment, including the entire array (52 bytes). Again the next L_UINT32 indicates the Comment type is FlashPixWideStringArray (10). The rightmost L_UINT32 member in the Comment header stores the number of elements present in the array (2). The Comment data consists of multiple sub-comments of Comment type FlashPixWideString which make up the array. Again, these sub-comments consist of a sub-comment header and sub-comment data. The sub-comment header for the first FlashPixWideString sub-comment in the array begins with a L_UINT32 which stores the size of that one string within the array (20 bytes). The next L_UINT32 indicates the Comment type of the sub-comment which follows (9 or FlashPixWideString). Please note that the entire Comment is of type FlashPixWideStringArray, but each member of that array is of Comment type FlashPixWideString. The next L_UINT32 member in the sub-comment header of each wide string stores the number of elements in the string (4). Finally, the sub-comment data of each sub-comment contains the string BOB and TED.

The rest of the Comments may be explained similarly. It is important to note that all of the 1 byte cells seen here represent a contiguous block of memory and therfore would fall side by side in memory. The "exploded" view of the Comment organization is done only to show the individual members of the header and the data section.

Comments and sub-comments must be of certain Comment types. The Comment types available are listed below.

************************************************************************************************************************************************************************************

The following declarations pertain to the examples included in the Comment type definitions:

FPXCOMMENT_HEADER_ELEMENT L_FAR | *pElement;
FPXCOMMENT_HEADER_ARRAY L_FAR | *pArray;
L_UCHAR L_FAR | *pChar;
L_UINT16 L_FAR | *pShort;
L_UINT32 L_FAR | *pLong;
L_FLOAT L_FAR | *pFloat;
L_DOUBLE L_FAR | *pDouble;
L_UINT | i, j, uBytes;
L_UCHAR | Buffer[1024], String[] = "String";

FlashPixCFAPatternBlock ( Comment type)

This comment is used to store the number of rows, number of columns and data array which describe a color pattern. Refer to CMNT_FPXCFAPATTERN in FlashPix File Comments.

L_UNIT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT16 cfa_repeat_rows
L_UINT16 cfa_repeat_cols
FlashPixString cfa_array

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_CFA_PATTERN_BLOCK
cfa_repeat_rows | data value containing the number of rows defining the color pattern
cfa_repeat_col | data value containing the number of columns defining the color pattern
cfa_array | data array of color pattern values

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT16) +
sizeof(L_UINT16) +
sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UCHAR) * sizeof(String);

pElement->type = FPXENUM_CFA_PATTERN_BLOCK;
uBytes = pElement->size;
pShort = (L_UINT16 L_FAR *) (pElement + 1);

pShort[0] = 1234;
pShort[1] = 4321;

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)&pShort[2];
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UCHAR) * sizeof(String);
pArray->type = FPXENUM_STRING;
pArray->elements = sizeof(String);
pChar = (L_UCHAR L_FAR *) (pArray + 1);

for ( j = 0; j < sizeof(String); j++)
{
pChar[j] = String[j];
}

L_SetComment(CMNT_FPXCFAPATTERN, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixDate( Comment type)

This comment is used to store information concerning the revision date of the scanning software. Refer to CMNT_FPXSCANSOFTWAREREVISIONDATE in FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_DOUBLE date

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_DATE
date | data value containing the date

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_DOUBLE);
pElement->type = FPXENUM_DATE;
uBytes = pElement->size;
pDouble = (L_DOUBLE L_FAR *) (pElement + 1);
*pDouble = 1234.5678;

L_SetComment(CMNT_FPXSCANSOFTWAREREVISIONDATE, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixLong( Comment type)

This comment is used to store a long value. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 long

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_LONG
long | data value containing a long

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT32);
pElement->type = FPXENUM_LONG;
uSize = pElement->size;
pLong = (L_UINT32 L_FAR *) (pElement + 1);
*pLong = 12345678;

L_SetComment(CMNT_TESTTARGETINTHEIMAGE, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixLongArray( Comment type)

This comment is used to store an array of long values. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_longs
L_UINT32 long[0]
L_UINT32 long[1]
.
.
.
L_UINT32 long[number_of_longs - 1]

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_LONG_ARRAY
number_of_longs | length of array stored in this comment
long[0] | data value containing the first long value in the array
long[1] | data value containing the second long value in the array

Example

#define MAX_VECTOR 10

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *) Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof((L_UINT32) * MAX_VECTOR;
pArray->type = FPXENUM_LONG_ARRAY;
pArray->elements = MAX_VECTOR;
uBytes = pArray->size;
pLong = (L_UINT32 L_FAR *) (pArray + 1);

for (i = 0; i < MAX_VECTOR; i++)
{
pLong[i] = 12345678;
}

L_SetComment(CMNT_FPXCREATIONPATH, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixOECFBlock( Comment type)

This comment is used to store information of a table which provides information concerning the relationship between optical input and the image file value output from an electronic camera. Data is stored concerning exposure, ouput levels for red, output levels for green and output levels for blue. Refer to CMNT_FPXOECF in FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT16 number_of_columns
L_UINT16 number_of_rows
FlashPixWideStringArray column_headings
FlashPixFloatArray data

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_OECF_BLOCK
number_of_columns | data value containing the number of columns in the table
number_of_rows | data value containing the number of rows in the table
column_headings | data array containing the column headings for the table
data | data array containing a list of table entries

Example

#define MAX_VECTOR 10

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT16) +
sizeof(L_UINT16) +
sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(FPXCOMMENT_HEADER_ARRAY) * MAX_VECTOR +
sizeof(L_UINT16) * sizeof(String) * MAX_VECTOR;
sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_FLOAT) * MAX_VECTOR;

pElement->type = FPXENUM_OECF_BLOCK;
uBytes = pElement->size;
pShort = (L_UINT16 L_FAR *) (pElement + 1);

pShort[0] = 1234;
pShort[1] = 4321;

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)&pShort[2];
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(FPXCOMMENT_HEADER_ARRAY) * MAX_VECTOR +
sizeof(L_UINT16) * sizeof(String) * MAX_VECTOR;
pArray->type = FPXENUM_WIDE_STRING_ARRAY;
pArray->elements = MAX_VECTOR;

pArray++;

for ( i = 0; i < MAX_VECTOR); i++)
{
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
= sizeof(L_UINT16) * sizeof(String);
pArray->type = FPXENUM_WIDE_STRING;
pArray->elements = sizeof(String);
pShort = (L_UINT16 L_FAR *) (pArray + 1);

for (j = 0; j < sizeof(String); j++)
{
pShort[j] = String[j];
}
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *) ((L_UCHAR L_FAR *)pArray + pArray->size);
}

pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_FLOAT) * MAX_VECTOR;
pArray->type = FPXENUM_FLOAT_ARRAY;
pArray->elements = MAX_VECTOR;
pFloat = (L_FLOAT L_FAR *) (pArray + 1);

for (i = 0; i < MAX_VECTOR; i++)
{
pFloat[i] = 12.34;
}

L_SetComment(CMNT_FPXOECF, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixFloat( Comment type)

This comment is used to store a float value. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_FLOAT float

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_FLOAT
float | data value containing a float

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_FLOAT);
pElement->type = FPXENUM_FLOAT;
uBytes = pElement->size;
pFloat = (L_FLOAT L_FAR *) (pElement + 1);
*pFloat = 12.34;

L_SetComment(CMNT_FPXFNUMBER, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixFloatArray( Comment type)

This comment is used to store an array of float values. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_floats
L_FLOAT float[0]
L_FLOAT float[1]
.
.
.
L_FLOAT float[number_of_floats - 1]

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_FLOAT_ARRAY
number_of_floats | data value containing the number of float values stored in the array
float[0] | data value containing the first float value stored
float[1] | data value containing the second float value stored, etc.

Example

#define MAX_VECTOR 10

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *) Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_FLOAT) * MAX_VECTOR;
pArray->type = FPXENUM_FLOAT_ARRAY;
pArray->elements = MAX_VECTOR;
uBytes = pArray->size;
pFloat = (L_FLOAT L_FAR *) (pArray + 1);

for (i = 0; i < MAX_VECTOR; i++)
{
pFloat[i]= 12.34;
}

L_SetComment(CMNT_FPXSUBJECTDISTANCE, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixScannedImageSizeBlock( Comment type)

This comment is used to store information concerning the dimensions of original scanned images and original documents. refer to CMNT_FPXORIGINALSCANNEDIMAGESIZE or CMNT_FPXORIGINALDOCUMENTSIZE in FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_FLOAT original_size_x
L_FLOAT original_size_y
L_UINT32 original_size_unit

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_SCANNED_IMAGE_SIZE_BLOCK
original_size_x | data value containing the width of the image
original_size_y | data value containing the height of the image
original_size_unit | data value indicating the unit of measurement, mm, inches, etc.(This must be filled with a value from FPXTYPE_RESOLUTION_UNIT.)

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_FLOAT) +
sizeof(L_FLOAT) +
sizeof(L_UINT32);
pElement->type = FPXENUM_SCANNED_IMAGE_SIZE_BLOCK;
uBytes = pElement->size;
pFloat = (L_FLOAT L_FAR *) (pElement + 1);
pFloat[0] = 12.34;
pFloat[1] = 43.21;
pLong = (L_UINT32 L_FAR *)&pFloat[2];
pLong[0] = 12345678;

L_SetComment(CMNT_FPXORIGINALSCANNEDIMAGESIZE, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixShort( Comment type)

This comment is used to store a short value. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT16 short

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_SHORT
short | data value containing a short

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *)Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT16);
pElement->type = FPXENUM_SHORT;
uBytes = pElement->size;
pShort = (L_UINT16 L_FAR *) (pElement + 1);
*pShort = 1234;

L_SetComment(CMNT_FPXFILMROLLNUMBER, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixShortArray( Comment type)

This comment is used to store an array of short values. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure /* header information */
L_UNIT32 type_of_structure = FPXENUM_SHORT_ARRAY
/* header information */
L_UINT32 number_of_shorts /* header information */
L_UINT16 short[0] /* data */
L_UINT16 short[1] /* data */
.
.
.
L_UINT16 short[number_of_shorts - 1] /* data */

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_SHORT_ARRAY
number_of_shorts | data value containing the number of short values stored in the array
short[0] | data value containing the first short value stored in the array
short[1] | data value containing the second short value stored in the array, etc.

Example

#define MAX_VECTOR 10

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UINT16) * MAX_VECTOR;
pArray->type = FPXENUM_SHORT_ARRAY;
pArray->elements = MAX_VECTOR;
uBytes = pArray->size;
pShort = (L_UINT16 L_FAR *) (pArray + 1);

for (i = 0; i < MAX_VECTOR; i++)
{
pShort[i] = 1234;
}

L_SetComment(CMNT_FPXISOSPEEDRATINGS, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixSpacialFrequencyResponseBlock( Comment type)

This comment is used to store information of a table which provides information concerning the spatial frequency response of a camera (SFR). The data stored concerns spatial frequency,and horizontal, vertical and diagonal SFR. Refer to CMNT_FPXSPATIALFREQUENCY in FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_columns
L_UINT32 number_of_rows
FlashPixWideStringArray column_headings
FlashPixFloatArray data

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_SPACIAL_FREQUENCY_RESPONSE_BLOCK
number_of_columns | data value containing the number of columns in the table
number_of_rows | data value containing the number of rows in the table
column_headings | data array containing the column headings for the table
data | data array containing a list of table entries

Example

#define MAX_VECTOR 10

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT32) +
sizeof(L_UINT32) +
sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(FPXCOMMENT_HEADER_ARRAY) * MAX_VECTOR +
sizeof(L_UINT16) * sizeof(String) * MAX_VECTOR;
sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_FLOAT) * MAX_VECTOR;

pElement->type = FPXENUM_SPACIAL_FREQUENCY_RESPONSE_BLOCK;
uBytes = pElement->size;
pLong = (L_UINT32 L_FAR *) (pElement + 1);

pLong[0] = 12345678;
pLong[1] = 87654321;

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)&pLong[2];
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(FPXCOMMENT_HEADER_ARRAY) * MAX_VECTOR +
sizeof(L_UINT16) * sizeof(String) * MAX_VECTOR;
pArray->type = FPXENUM_WIDE_STRING_ARRAY;
pArray->elements = MAX_VECTOR;

pArray++;

for ( i = 0; i < MAX_VECTOR); i++)
{
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
= sizeof(L_UINT16) * sizeof(String);
pArray->type = FPXENUM_WIDE_STRING;
pArray->elements = sizeof(String);
pShort = (L_UINT16 L_FAR *) (pArray + 1);

for (j = 0; j < sizeof(String); j++)
{
pShort[j] = String[j];
}
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *) ((L_UCHAR L_FAR *)pArray + pArray->size);
}

pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_FLOAT) * MAX_VECTOR;
pArray->type = FPXENUM_FLOAT_ARRAY;
pArray->elements = MAX_VECTOR;
pFloat = (L_FLOAT L_FAR *) (pArray + 1);

for (i = 0; i < MAX_VECTOR; i++)
{
pFloat[i] = 12.34;
}

L_SetComment(CMNT_FPXSPATIALFREQUENCY, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixString( Comment type)

This comment is used to store a string value. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_chars
L_UCHAR char[0]
L_UCHAR char[1]
.
.
.
L_UCHAR char[number_of_chars - 1]

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_STRING
number_of_chars | data value containing the number of characters stored in the array
char[0] | data value containing the first character stored in the array
char[1] | data value containing the second character stored in the array, etc.

Example

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UCHAR) * sizeof(String);
pArray->type = FPXENUM_ STRING;
pArray->elements = sizeof(String);
uBytes = pArray->size;
pChar = (L_UCHAR L_FAR *) (pArray + 1);

for ( j = 0; j < sizeof(String); j++)
{
pChar[j] = String[j];
}

L_SetComment(CMNT_FPXTITLE, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixSystemTime( Comment type)

This comment is used to store time values. Refer to CMNT_FPXEDITTIME, CMNT_FPXLASTPRINTED, CMNT_FPXCREATEDTM, CMNT_FPXLASTSAVEDTM, CMNT_FPXCAPTUREDATE, CMNT_FPXSCANDATE, or CMNT_FPXLASTMODIFIEDDATE in FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT16 year
L_UINT16 month;
L_UINT16 day_of_week
L_UINT16 day
L_UINT16 hour
L_UINT16 minute
L_UINT16 second
L_UINT16 milliseconds

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_SYSTEM_TIME
year | data value containing the year
month | data value containing the month
day_of_week | data value containing the day of the week
day | data value containing the day of the month
hour | data value containing the hour
minute | data value containing the minute
second | data value containing the seconds past the minute
milliseconds | data value containing the milliseconds

Example

pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *)Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) +
sizeof(L_UINT16) * 8;
pElement->type = FPXENUM_SYSTEM_TIME;
uBytes = pElement->size;
pShort = (L_UINT16 L_FAR *) (pElement + 1);

pShort[0] = 1965; // Year
pShort[1] = 12; // Month
pShort[2] = 0; // Day of week
pShort[3] = 11; // Day
pShort[4] = 1; // Hour
pShort[5] = 2; // Minute
pShort[6] = 3; // Second
pShort[7] = 4; // Milliseconds

L_SetComment(CMNT_FPXEDITTIME, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixWideString( Comment type)

This comment is used to store a wide string. In a wide string each character stored is two bytes in size. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_wide_chars
L_UINT16 wide_char[0]
L_UINT16 wide_char[1]
.
.
.
L_UINT16 wide_char[number_of_wide_chars - 1]

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_WIDE_STRING
number_of_wide_chars | data value containing the number of wide characters stored in the string
wide_char[0] | data value containing the first wide character stored in the string
wide_char[1] | data value containing the second wide character stored in the string, etc.

Example

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UINT16) * sizeof(String);
pArray->type = FPXENUM_WIDE_STRING;
pArray->elements = sizeof(String);
uBytes = pArray->size;
pShort = (L_UINT16 L_FAR *) (pArray + 1);

for ( j = 0; j < sizeof(String); j++)
{
pShort[j] = String[j];
}

L_SetComment(CMNT_FPXCOPYRIGHT, Buffer, uBytes);

************************************************************************************************************************************************************************************

FlashPixWideStringArray( Comment type)

This comment is used to store an array of wide strings. For a full list of the FlashPix file comments, refer to FlashPix File Comments.

L_UINT32 size_of_structure
L_UNIT32 type_of_structure
L_UINT32 number_of_wide_strings
FlashPixWideString wide_string[0]
FlashPixWideString wide_string[1]
.
.
.
FlashPixWideString wide_string[number_of_wide_strings - 1]

Member | Description
size_of_structure | size of this comment
type_of_structure | type of this comment = FPXENUM_WIDE_STRING_ARRAY
number_of_wide_strings | data value containing the number of wide strings stored in the array
wide_string[0] | data values containing the first wide string stored in the array
wide_string[1] | data values containing the second wide string stored in the array, etc.

Example

#define MAX_VECTOR 10

pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)Buffer;
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(FPXCOMMENT_HEADER_ARRAY) * MAX_VECTOR +
sizeof(L_UINT16) * sizeof(String) * MAX_VECTOR;
pArray->type = FPXENUM_WIDE_STRING_ARRAY;
pArray->elements = MAX_VECTOR;
uBytes = pArray->size;
pArray++;

for ( i = 0; i < MAX_VECTOR; i++)
{
pArray->size = sizeof(FPXCOMMENT_HEADER_ARRAY) +
sizeof(L_UINT16) * sizeof(String);
pArray->type = FPXENUM_WIDE_STRING;
pArray->elements = sizeof(String);
pShort = (L_UINT16 L_FAR *) (pArray + 1);

for ( j = 0; j < sizeof(String); j++ )
{
pShort[j] = String[j];
}
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *) ((L_UCHAR L_FAR *)pArray + pArray->size);

}

L_SetComment(CMNT_FPXPEOPLEINTHEIMAGE, Buffer, uBytes);


FlashPix Enumerated Types

Enumerated types are used in FlashPix files to designate which Comment type is being stored. One of the values listed in FPXTYPE_DATA must be used when designating the Comment type in a Comment or in a sub-comment. (See FlashPix Comments.) The rest of the enumerated types are used for Comments or sub-comments which require that the data stored there belong to a particular group type. The enumerated types listed below provide a reference to those Comments using that enumerated type. In addition, an explanation, when needed, is given for each value of an enumerated type.

************************************************************************************************************************************************************************************

FPXTYPE_DATA

These values are used by the comment headers and comment blocks to designate the type of comment stored.

typedef enum

{
FPXENUM_BOOL = 0,
FPXENUM_SHORT,
FPXENUM_SHORT_ARRAY,
FPXENUM_LONG,
FPXENUM_LONG_ARRAY,
FPXENUM_FLOAT,
FPXENUM_FLOAT_ARRAY,
FPXENUM_STRING,
FPXENUM_STRING_ARRAY,
FPXENUM_WIDE_STRING,
FPXENUM_WIDE_STRING_ARRAY,
FPXENUM_THUMBNAIL,
FPXENUM_SPACIAL_FREQUENCY_RESPONSE_BLOCK,
FPXENUM_OECF_BLOCK,
FPXENUM_CFA_PATTERN_BLOCK,
FPXENUM_SCANNED_IMAGE_BLOCK_SIZE,
FPXENUM_SYSTEM_TIME,
FPXENUM_DATE
} FPXTYPE_DATA;

************************************************************************************************************************************************************************************

FPXTYPE_BACK_LIGHT

Designates camera's evaluation of lighting conditions used during image capture. It may be undefined (FPXENUM_NOT_A_CAMERA_FEATURE_BACKLIGHT), illuminated from the front (FPXENUM_FRONT_LIT), exposed for subject center when brightness between subject center and the surrounding area differ (FPXENUM_BACK_LIT1) or exposed for surrounding area when brightness between subject center and the surrounding area differ (FPXENUM_BACK_LIT2) Refer to CMNT_FPXBACKLIGHT in FlashPix File Comments

typedef enum

{
FPXENUM_NOT_A_CAMERA_FEATURE_BACKLIGHT = 0,
FPXENUM_FRONT_LIT,
FPXENUM_BACK_LIT1,
FPXENUM_BACK_LIT2
} FPXTYPE_BACK_LIGHT;

************************************************************************************************************************************************************************************

FPXTYPE_EXPOSURE_PROGRAM

Designates the category of exposure program used by the camera which captured the image. Refer to CMNT_FPXEXPOSUREPROGRAM in FlashPix File Comments

typedef enum

{
FPXENUM_UNIDENTIFIED_EXPOSURE_PROGRAM = 0,
FPXENUM_MANUAL,
FPXENUM_PROGRAM_NORMAL,
FPXENUM_APERTURE_PRIORITY,
FPXENUM_SHUTTER_PRIORITY,
FPXENUM_PROGRAM_CREATIVE,
FPXENUM_PROGRAM_ACTION,
FPXENUM_PROTRAIT_MODE,
FPXENUM_LANDSCAPE_MODE
} FPXTYPE_EXPOSURE_PROGRAM;

************************************************************************************************************************************************************************************

FPXTYPE_FILM_CATEGORY

Designates the category of film used when capturing the image. Refer to CMNT_FPXFILMCATEGORY in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFIED = 0,
FPXENUM_NEGATIVE_BW,
FPXENUM_NEGATIVE_COLOR,
FPXENUM_REVERSAL_BW,
FPXENUM_REVERSAL_COLOR,
FPXENUM_CHROMAGENIC,
FPXENUM_INTERNEGATIVE_BW,
FPXENUM_INTERNEGATIVE_COLOR
} FPXTYPE_FILM_CATEGORY;

************************************************************************************************************************************************************************************

FPXTYPE_FLASH

Designates whether or not a flash was used, or if it is unknown. Refer to CMNT_FPXFLASH in FlashPix File Comments.

typedef enum

{
FPXENUM_FLASH_USE_UNKNOWN = 0,
FPXENUM_NO_FLASH_USED,
FPXENUM_FLASH_USED
} FPXTYPE_FLASH;

************************************************************************************************************************************************************************************

FPXTYPE_FLASH_RETURN

Designates whether the camera determined the flash to be effective or not at the time of exposure. This feature may be undefined (FPXENUM_NOT_A_CAMERA_FEATURE_FLASH_RETURN). Refer to CMNT_FPXFLASHRETURN in FlashPix File Comments.

typedef enum

{
FPXENUM_NOT_A_CAMERA_FEATURE_FLASH_RETURN = 0,
FPXENUM_SUBJECT_OUTSIDE_FLASH_RANGE,
FPXENUM_SUBJECT_INSIDE_FLASH_RANGE
} FPXTYPE_FLASH_RETURN;

************************************************************************************************************************************************************************************

FPXTYPE_METERING_MODE

Designates the method by which the camera spatially weighs scene illuminance values, in order to determine sensor exposure. Refer to CMNT_FPXMETERINGMODE in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFED_METERING_MODE = 0,
FPXENUM_AVERAGE,
FPXENUM_CENTER_WEIGHTED_AVERAGE,
FPXENUM_SPOT,
FPXENUM_MULTI_SPOT
} FPXTYPE_METERING_MODE;

************************************************************************************************************************************************************************************

FPXTYPE_ORIGINAL_MEDIUM

Designates the medium of the original photo or document. Refer to CMNT_FPXORIGINALMEDIUM in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFIED_ORIGINAL_MEDIUM = 0,
FPXENUM_CONTINUOUS_TONE_IMAGE,
FPXENUM_HALFTONE_IMAGE,
FPXENUM_LINE_ART
} FPXTYPE_ORIGINAL_MEDIUM;

************************************************************************************************************************************************************************************

FPXTYPE_RESOLUTION_UNIT

Designates the unit of measurement for film size and focal plane resolution. Refer to CMNT_FPXFOCALPLANERESOLUTIONUNIT or CMNT_FPXFILMSIZEUNIT in FlashPix File Comments.

typedef enum

{
FPXENUM_INCHES = 0,
FPXENUM_METERS,
FPXENUM_CENTIMETERS,
FPXENUM_MILLIMETERS
} FPXTYPE_RESOLUTION_UNIT;

************************************************************************************************************************************************************************************

FPXTYPE_SCENE

Designates the type of scene captured. Original scenes are images directly captured from real-world scenes. Second-generation scenes are images captured from hardcopy images. Digital-scene generation applies to those images created digitally. Refer to CMNT_FPXSCENETYPE in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFIED_SCENE = 0,
FPXENUM_ORIGINAL_SCENE,
FPXENUM_SECOND_GENERATION_SCENE,
FPXENUM_DIGITAL_SCENE_GENERATION
} FPXTYPE_SCENE;

************************************************************************************************************************************************************************************

FPXTYPE_SCENE_ILLUMINANT

Designates the light source used when the image was captured. Refer to CMNT_FPXSCENEILLUMINANT in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFIED_SCENE_ILLUMINANT = 0,
FPXENUM_DAYLIGHT,
FPXENUM_FLUORESCENT_LIGHT,
FPXENUM_TUNGSTEN_LAMP,
FPXENUM_FLASH,
FPXENUM_STANDARD_ILLUMINANT_A,
FPXENUM_STANDARD_ILLUMINANT_B,
FPXENUM_STANDARD_ILLUMINANT_C,
FPXENUM_D55_ILLUMINANT,
FPXENUM_D65_ILLUMINANT,
FPXENUM_D75_ILLUMINANT
} FPXTYPE_SCENE_ILLUMINANT;

************************************************************************************************************************************************************************************

FPXTYPE_SENSING_METHOD

typedef enum

Designates type of image sensor used by the camera, or by some other device used to capture the image. Refer to CMNT_FPXSENSINGMETHOD in FlashPix File Comments.

{
FPXENUM_UNDEFINED = 0,
FPXENUM_MONOCHROME_AREA_SENSOR,
FPXENUM_ONE_CHIP_COLOR_AREA_SENSOR,
FPXENUM_TWO_CHIP_COLOR_AREA_SENSOR,
FPXENUM_THREE_CHIP_COLOR_AREA_SENSOR,
FPXENUM_COLOR_SEQUENCIAL_AREA_SENSOR,
FPXENUM_MONOCHROME_LINEAR_SENSOR,
FPXENUM_TRILINEAR_SENSOR,
FPXENUM_COLOR_SEQUENCIAL_LINEAR_SENSOR
} FPXTYPE_SENSING_METHOD;

************************************************************************************************************************************************************************************

FPXTYPE_SOURCE

Designates the device used to create the digital image. Refer to CMNT_FPXFILESOURCE in FlashPix File Comments.

typedef enum
{
FPXENUM_UNIDENTIFIED_SOURCE = 0,
FPXENUM_FILM_SCANNER,
FPXENUM_REFLECTION_PRINT_SCANNER,
FPXENUM_DIGITAL_CAMERA,
FPXENUM_STILL_FROM_VIDEO,
FPXENUM_COMPUTER_GRAPHICS
} FPXTYPE_SOURCE;

************************************************************************************************************************************************************************************

FPXTYPE_TYPE_OF_REFLECTION_ORIGINAL

Designates the type of the original photo or document. Refer to CMNT_FPXTYPEOFREFLECTIONORIGINAL in FlashPix File Comments.

typedef enum

{
FPXENUM_UNIDENTIFIED_TYPE_OF_REFLECTION_ORIGINAL = 0,
FPXENUM_BW_PRINT,
FPXENUM_COLOR_PRINT,
FPXENUM_BW_DOCUMENT,
FPXENUM_COLOR_DOCUMENT
} FPXTYPE_TYPE_OF_REFLECTION_ORIGINAL;

************************************************************************************************************************************************************************************


FlashPix Structures

Non-image data in FlashPix files are treated as comments by LEADTOOLS. They are one contiguous block of memory, hereafter referred to as "Comments Block". Within the Comments Block are one or more individual comments. An individual comment will hereafter be referred to as "Comment". In FlashPix files a Comment consists of a "Comment header" and "Comment data". Further information on individual Comments may be found in FlashPixComments.

Reading the Comments stored in the Comments Block requires the use of the following structure.

********************************************************************************************************************************************************************************************************************************

FILECOMMENTS, LPFILECOMMENTS;

typedef struct _FILECOMMENTS
{
L_INT count;
L_UCHAR L_FAR **pointer;
L_UINT L_FAR *size;
} FILECOMMENTS, L_FAR * LPFILECOMMENTS;

The FILECOMMENTS structure, which is necessary for the L_ReadFileCommentExt function, provides information about and access to the FlashPix comments.

Member | Description
count | Number of comments. Must be CMNT_LAST + 1.
pPointer | Pointer to an array of pointers. Each pointer within the array points to a single comment.
size | Pointer to an array of sizes. Each member of the array indicates the length of the corresponding comment.

Comments

Presently, this structure is used with L_ReadFileCommentExt.

The FILECOMMENTS structure must be filled before using L_ReadFileCommentExt:

FILECOMMENTS | FileComments;
L_UCHAR L_FAR | *pPointer[CMNT_LAST + 1];
L_UINT | Size[CMNT_LAST + 1];
FileComments.count | =CMNT_LAST + 1;
FileComments.pointer | =pPointer;
FileComments.size | =Size;

For a full example showing the use of this structure when reading Comments, refer to L_ReadFileCommentExt.

********************************************************************************************************************************************************************************************************************************

In the above structure, count indicates the number of individual Comments which can be stored in the Comments Block. Generally, the memory allocated for a Comments Block is large enough to store all FlashPix Comments, even if not all FlashPix Comments may actually be stored. **Pointer points to an array of pointers. Each pointer within the array points to the beginning of a Comment. Size points to the beginning of an array of integers. Each integer indicates the length of the corresponding Comment. The graph below shows the structure of FILECOMMENTS and its relationship to Comments Block, the array of pointers into Comments Block and the array of integers containing the lengths of the Comments in Comments Block. The following declarations pertain to the graph:

FILECOMMENTS FileComments;

L_UCHAR L_FAR *pPointerComments[CMNT_LAST + 1];

L_UINT LengthComments[CMNT_LAST + 1];

L_CHAR L_FAR *pTextToGet;

FileComments is an instance of FILECOMMENTS. The data member count is set to CMNT_LAST + 1 indicating that the Comments Block contains all the FlashPix Comments. pPointer points to the beginning of the array of pointers, pPointerComments. Size points to the beginning of the integer array LengthComments. In this graph you can see that the first pointer in pPointerComments points to the beginning of the first Comment in pTextToGet, the Comments Block. The first entry in LengthComments contains the length of this Comment. You can also see that the first Comment consists of a Comment header and Comment data.

The second pointer in pPointerComments points to the second Comment in the Comments Block, adjacent to the first Comment. The second entry in LengthComments contains the data value 16, indicating that the second Comment is 16 bytes in length. Again, the second Comment consists of a Comment header and Comment data. This continues for each Comment in the Comment Block.


VERSIONINFO

typedef struct struct_version_information
{
L_UINT uStructSize;
L_UCHAR Product[60];
L_INT Level;
L_INT MajorNumber;
L_INT MinorNumber;
L_UCHAR Date[16];
L_UCHAR Time[16];
} VERSIONINFO, L_FAR * pVERSIONINFO;

The VERSIONINFO structure, which is filled in using the L_VersionInfo function, provides information about the LEADTOOLS toolkit.

Member | Description |
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
Product | Product name, expressed as a character string. |
Level | Toolkit level. The following are possible values: |
 | TOOLKIT_LEVEL_DOCUMENT | [0x00] Document Toolkit
 | TOOLKIT_LEVEL_RASTER | [0x01] Raster Toolkit
 | TOOLKIT_LEVEL_MEDICAL | [0x02] Medical Toolkit
MajorNumber | Major version number. |
MinorNumber | Minor version number. |
Date | Date of the build, expressed as a character string. |
Time | Time of the build, expressed as a character string. |

Comments

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

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


ADDMESGINFO

typedef struct _ADDMESGINFO
{
L_UINT uStructSize;
L_TCHAR L_FAR * pStrMsg;
L_UCHAR L_FAR * pPassword;
L_TCHAR L_FAR * pFileName;
L_TCHAR L_FAR * pDirectory;
LPPOINT pStart;
} ADDMESGINFO, L_FAR * LPADDMESGINFO;

The ADDMESGINFO structure contains information about the message being added to or extracted from the bitmap and is used by the L_ExtractMessageFromBitmap and L_AddMessageToBitmap functions.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
pStrMsg | Pointer to text that will be added to or extracted from an image. When adding a message to a bitmap this pointer refers to the text message that will be added. If you want to add a file, set this pointer to NULL. When extracting a message from a bitmap there is no need to allocate this pointer, the extract function will allocate it if the embedded message is text, otherwise it remains NULL.
pPassword | Pointer to the password that will be used when adding the message to or extracting the message from the bitmap. To use the default password set this parameter to NULL. The default password is, "LEAD Technologies".
pFileName | Pointer to the name of the file that will be added to or extracted from an image. When adding a message to a bitmap this pointer refers to the name of the file that will be added, and the pStrMsg member must be set to NULL, otherwise this parameter has no effect. When extracting a message from a bitmap there is no need to allocate this pointer, the extract function will allocate it if the embedded message is a file otherwise it remains NULL.
pDirectory | Pointer to the full path name of the directory in which to save the extracted file. This parameter is used only by the L_ExtractMessageFromBitmap function. 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 parameter to NULL. If the extracted message is text this parameter has no effect.
pStart | Pointer to a structure that contains 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.

Comments

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


ANNROTATEOPTIONS (Document/Medical only)

typedef struct tagANNROTATEOPTIONS
{
L_UINT uStructSize;
L_UINT uFlags;
L_BOOL bShowRotateHandles;
L_INT32 nReserved;
} ANNROTATEOPTIONS, L_FAR *pANNROTATEOPTIONS;

The ANNROTATEOPTIONS structure contains information about the rotation options for a specific annotation object.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNROTATEOPTIONS).
uFlags | Flag that identifies which fields are valid, or to execute an operation that does not depend on a field. 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
 | ANNROTATE_SHOW_ROTATE_HANDLES | [1] bShowRotateHandles field is valid.
 | ANNROTATE_RESET_ROTATE_HANDLES | [2] Reset the rotate handles to the original orientation.

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.
nReserved | Reserved for future use. Use zero.

Comments

The ANNROTATEOPTIONS structure is used with the functions L_AnnSetRotateOptions and L_AnnGetRotateOptions to get or set the rotate options on any annotation object, including the automation object.

When calling L_AnnGetRotateOptions, the uFlags field identifies which fields to retrieve. When calling L_AnnSetRotateOptions, the uFlags field identifies which fields to set, or in the case of the flag ANNROTATE_RESET_ROTATE_HANDLES, causes the annotation object to reset the rotate handles to the original orientation.

When you create an object in the automation mode, the value for bShowRotateHandles is taken from the automation object.

The default value for bShowRotateHandles is FALSE, which means that the objects will not show rotate handles when selected.

Example

For an example, refer to L_AnnGetRotateOptions.


BALANCEDATA

typedef struct tagBALANCEDATA
{
L_UINT uStructSize;
L_INT nRed;
L_INT nGreen;
L_INT nBlue;
}
BALANCEDATA, L_FAR * LPBALANCEDATA;

The BALANCEDATA structure provides the balance tone information used in L_ColorIntensityBalance function.

Member | Description
uStructSize | Size of the structure. Should be set to sizeof(BALANCEDATA).
nRed | Value to be used for adjusting or balancing the red channel. 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.
nGreen | Value to be used for adjusting or balancing the Green channel. Valid values range from –100 to 100. Values > 0 increase the green component value. Values < 0 decrease the green component value. Using 0 leaves the green component unchanged.
nBlue | Value to be used for adjusting or balancing the blue channel. Valid values range from –100 to 100. Values > 0 increase the blue component value. Values < 0 decrease the blue component value. Using 0 leaves the blue component unchanged.


BINARYFLT

typedef struct tagBINARYFLT
{
L_UINT uStructSize; /* size of this structure. Use the sizeof() macro to calculate it */
L_BOOL bfltMax; /* select maximum value */
L_UINT bfltDim; /* filter dimensions */
L_INT bfltMatrix[1]; /* array of filter coefficients */
} BINARYFLT, L_FAR * LPBINARYFLT;

The BINARYFLT structure is used internally by LEADTOOLS, and the meanings of its fields are not published. For the list of built-in filters, refer to the L_BinaryFilterBitmap function. LPBINARYFLT is a pointer to a BINARYFLT structure.


BUMPDATA

typedef struct tagBUMPDATA
{
L_UINT uStructSize;
L_INT nAzimuth;
L_UINT uElevation;
L_UINT uDepth;
L_INT nXOffset;
L_INT nYOffset;
L_INT nXDst;
L_INT nYDst;
L_BOOL bTile;
L_INT nBright;
L_INT nIntensity;
L_UINT L_FAR * pLut;
} BUMPDATA, L_FAR * LPBUMPDATA;

The BUMPDATA structure contains information about the bump map parameter.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
nAzimuth | The Azimuth describes the light source's angular position in the horizontal plane. The valid range is between –360 to 360.
uElevation | The elevation describes the light source's angular position in the vertical plane. The valid range is between 0 to 180.
uDepth | The apparent depth of this three-dimensional effect. Valid values are 0 to 1000, with 500 as normal.
nXOffset | The X coordinate of the origin of the Bump rectangle.
nYOffset | The Y coordinate of the origin of the Bump rectangle.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
bTile | Boolean flag that indicates whether to use tiling. Possible values are:
 | Value | Meaning
 | TRUE | use tiling.
 | FALSE | do not to use tiling.
nBright | 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.
nIntensity | 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.
pLut | Table of 256 integers containing lookup values that re-map bump bitmap data.

Comments

If the bTile member is set to TRUE, the nXOffset and nYOffset members represent the offset in the bump image. If there is a region on the bump image, this region rectangle will represent the bump bitmap.

If the bTile member is set to FALSE, the nXOffset and nYOffset members represent the position in the bump image. If a region is defined for either the bump or destination bitmap, or both bitmaps, the effect applies only to the intersection of regions.


BORDERREMOVE

typedef struct tagBORDERREMOVE
{
L_UINT uStructSize;
L_UINT32 uFlags;
L_UINT32 uBorderToRemove;
L_INT32 iBorderPercent;
L_INT32 iWhiteNoiseLength;
L_INT32 iVariance;
HRGN hRgn;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
} BORDERREMOVE, L_FAR *LPBORDERREMOVE;

The BORDERREMOVE structure provides border removal information for the L_BorderRemoveBitmap function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | 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 encountered by L_BorderRemoveBitmap, if the BORDERREMOVECALLBACK function returns SUCCESS_REMOVE, the removed border is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the border is not added to the single region. When L_BorderRemoveBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed borders. If BORDER_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed borders. If BORDER_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed borders. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | BORDER_LEAD_REGION | When L_BorderRemoveBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed lines. This flag must be used in conjunction with BORDER_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Then set uFlags to BORDER_SINGLE_REGION | BORDER_LEAD_REGION. This variable will be updated when L_BorderRemoveBitmap returns.
 | BORDER_IMAGE_UNCHANGED | The original image is unchanged.
 | BORDER_CALLBACK_REGION | BORDERREMOVECALLBACK 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 borders by combining the regions received by the callback function, if the callback function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when BORDER_SINGLE_REGION is set in uFlags. For an example, refer to L_BorderRemoveBitmap. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().
 | BORDER_USE_VARIANCE | Consider border variance when performing border removal. If this flag is passed, the iVariance field of the structure is used. If this flag is not passed, the iVariance field of the structure is ignored.
uBorderToRemove | 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.
iBorderPercent | 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.
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.
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.
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If BORDER_SINGLE_REGION | BORDER_LEAD_REGION have been set in uFlags, then when L_BorderRemoveBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed borders. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (BORDER_SINGLE_REGION | BORDER_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn() when it is no longer needed. Refer to the L_BorderRemoveBitmap example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_BorderRemoveBitmap returns, this is updated with a single windows region corresponding to all changes, only if BORDER_SINGLE_REGION has been set in uFlags and BORDER_LEAD_REGION has not been set. To use this, set the flags field to (BORDER_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.

Comments

To "fine-tune" the performance of L_BorderRemoveBitmap, try modifying the values for iWhiteNoiseLength, iBorderPercent and iVariance.


COLORDATA

typedef struct tagCOLORDATA
{
L_UINT uStructSize;
L_INT nRedFactor;
L_INT nGreenFactor;
L_INT nBlueFactor;
L_INT nConstant;
} COLORDATA, L_FAR * pCOLORDATA;

The COLORDATA structure provides color-balancing information to the L_ChannelMix function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
nRedFactor | Value that represents the percentage of the red color value that should be distributed to the red component. Valid values are –200 to 200.
nGreenFactor | Value that represents the percentage of the green color value that should be distributed to the green component. Valid values are –200 to 200.
nBlueFactor | Value that represents the percentage of the blue color value that should be distributed to the blue component. Valid values are –200 to 200.
nConstant | Value that represents the color value that should be added to the whole image. Valid values are –200 to 200.

Comments

For a more detailed description of how this works, refer to L_ChannelMix.


COLORREPLACE

typedef struct _COLORREPLACE
{
L_UINT uStructSize;
COLORREF crColor;
L_UINT uFuzziness;
} COLORREPLACE, L_FAR * LPCOLORREPLACE;

The COLORREPLACE structure provides information about the replacement color for the L_ColorReplaceBitmap function.

Member | Description
uStructSize | Must contain the size of COLORREPLACE structure. Should be set to sizeof(COLORREPLACE).
crColor | The COLORREF value that specifies replaced colored value.
 | You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFuzziness | Value to be used in designating the + or - range of the color being replaced. This must be a nonzero value.


COMPDATA

typedef struct tagCOMPDATA
{
L_UINT uStructSize;
L_INT nMinRange;
L_INT nMaxRange;
L_UINT uFlags;
}
COMPDATA, L_FAR * LPCOMPDATA;

The COMPDATA structure contains the values to be used for thresholding and redistributing the bitmap's color component values for the L_ColorThresholdBitmap function.

Member | Description
uStructSize | Size of the structure. Should be set to sizeof(COMPDATA).
nMinRange | Value that represents the minimum boundary used to threshold the specific color.
nMaxRange | Value that represents the maximum boundary used to threshold the specific color.
uFlags | Value that represents the value that should be distributed to the thresholded component. Possible values are:
 | The following are the flags that define treatment of the values between the min and max threshold range:
 | 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 define treatment of the thresholded pixel:
 | Value | Meaning
 | CLTH_MOD_CHANNEL | [0x00000000] Each channel component is modified independently.
 | CLTH_MOD_ALL | [0x00000010] The pixel is rejected the test if one of the component is rejected.
 |  | The following are the flags that define 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 that nMin go to the minimum value in the used color space component and the rejected component values greater than nMax go to the maximum value in the used color space component. This works only with the CLTH_MOD_CHANNEL flag.


CURVE

typedef struct tagCurve
{
L_UINT uStructSize;
L_INT32 nType;
L_INT32 nPointCount;
POINT *pPoints;
L_UINT uFillMode;
L_DOUBLE dTension;
L_INT nClose;
L_INT32 nReserved;
} CURVE, L_FAR * pCURVE;

The CURVE structure defines a curve for the L_SetBitmapRgnCurve function and the L_CurveToBezier function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nType | Flag that indicates the type of curve defined. Possible values are:
 | Value | Meaning
 | CURVE_BEZIER | The points specified in the pPoints field define a Bezier curve.
 | CURVE_STANDARD | The points specified in the pPoints field define a standard curve.
nPointCount | Number of points in the pPoints array.
 | If nType is CURVE_BEZIER, nPointCount must be 3n + 1, where n >= 1. For example, nPointCount can be 4, 7, 10, 13, and so on.
 | If nType is CURVE_STANDARD, nPointCount must be greater than or equal to 3. For example, nPointCount can be 3, 4, 5, 6, and so on.
pPoints | Pointer to an array of POINT structures that contain the points that define the curve.
uFillMode | 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.
dTension | Value that indicates the "straightness" of the curves that connect points. This value is used only when nType is 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 for dTension is 0.5.
nClose | Value that indicates how the curve is closed. This value is used only when nType is 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.
nReserved | Reserved for future use.

Comments

The CURVE structure is used by the L_SetBitmapRgnCurve function to draw a curve using an array of POINT items. It is also used by the L_CurveToBezier function to convert a curve to a Bezier. The CURVE structure can define two types of curves:

nType is CURVE_STANDARD: A smooth curve that goes through all of the points. In this case, nPointCount must be at least three.

nType is CURVE_BEZIER: A series of Bezier curves that use the points as control points. In this case, nPointCount must be 3n + 1, where n >= 1. For example, nPointCount 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.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


DOTREMOVE

typedef struct tagDOTREMOVE
{
L_UINT uStructSize;
L_UINT32 uFlags;
L_INT32 iMinDotWidth;
L_INT32 iMinDotHeight;
L_INT32 iMaxDotWidth;
L_INT32 iMaxDotHeight;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
HRGN hRgn;
} DOTREMOVE, L_FAR *LPDOTREMOVE;

The DOTREMOVE structure provides dot removal information for the L_DotRemoveBitmap function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | 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 encountered by L_DotRemoveBitmap, if the DOTREMOVECALLBACK function returns SUCCESS_REMOVE, the removed dot is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the dot is not added to the single region. When L_DotRemoveBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed dots. If DOT_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed dots. If DOT_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed borders. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | DOT_LEAD_REGION | When L_DotRemoveBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed dots. This flag must be used in conjunction with DOT_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. This variable will be updated when L_DotRemoveBitmap returns.
 | DOT_IMAGE_UNCHANGED | The original image is unchanged.
 | DOT_USE_DPI | The unit of measure for all fields of the DOTREMOVE structure 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 fields of the DOTREMOVE structure is pixels.
 | DOT_CALLBACK_REGION | DOTREMOVECALLBACK 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 callback function, if the callback function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when DOT_SINGLE_REGION is set in uFlags. For an example, refer to L_DotRemoveBitmap. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().
 | DOT_USE_SIZE | Use the iMinDotWidth, iMinDotHeight, iMaxDotWidth, iMaxDotHeight members of the DOTREMOVE structure 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).
iMinDotWidth | The minimum width of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMinDotHeight | The minimum height of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMaxDotWidth | The maximum width of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMaxDotHeight | The maximum height of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If DOT_SINGLE_REGION | DOT_LEAD_REGION have been set in uFlags, then when L_DotRemoveBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed dots. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (DOT_SINGLE_REGION | DOT_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn() when it is no longer needed. Refer to the L_DotRemoveBitmap example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_DotRemoveBitmap returns, this is updated with a single windows region corresponding to all changes, only if DOT_SINGLE_REGION has been set in uFlags and DOT_LEAD_REGION has not been set. To use this, set the flags field to (DOT_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.


FILEOVERLAYCALLBACKDATA

The FILEOVERLAYCALLBACKDATA structure passed to the OVERLAYCALLBACK function contains information about the overlay image found in the file. Some members of this structure are for input some are for output as follows:

Note:

The LTFIL.H header file describes the entire FILEOVERLAYCALLBACKDATA structure.

Member | Data Type | Description
pszFilename | L_TCHAR L_FAR* | (input) String containing the name of the file containing the overlay bitmap.
nPageNumber | L_INT | (input) Page number of the requested overlay image.
bInfo | L_BOOL | (input) Determines whether overlay image info or actual bitmap is needed as follows:
 |  | Value | Meaning
 |  | TRUE | Only the information about the overlay image is needed. You must now in the nInfoWidth, nInfoHeight, nInfoXResolution and nInfoYResolution members of this structure.
 |  | FALSE | The actual overlay bitmap is needed. You must now load the overlay bitmap into the pLoadBitmap member of this structure.
nInfoWidth | L_INT | (output) Overlay image width in pixels. If the bInfo member of this structure is TRUE, you need to set this member to the overlay bitmap width, otherwise, ignore.
nInfoHeight | L_INT | (output) Overlay image height in pixels. If the bInfo member of this structure is TRUE, you need to set this member to the overlay bitmap height, otherwise, ignore.
nInfoXResolution | L_INT | (output) Overlay image horizontal resolution in pixels per inch. If the bInfo member of this structure is TRUE, you need to set this member to the overlay bitmap horizontal resolution, otherwise ignore.
nInfoYResolution | L_INT | (output) Overlay image vertical resolution in pixels per inch. If the bInfo member of this structure is TRUE, you need to set this member to the overlay bitmap vertical resolution, otherwise ignore.
pLoadBitmap | pBITMAPHANDLE | (output) Pointer to a BITMAPHANDLE structure into which the overlay bitmap will be loaded. If the bInfo member is FALSE, you need to load the overlay bitmap into this member. Otherwise ignore. You do not need to call L_FreeBitmap on this bitmap. LEADTOOLS will free it for you once its done overlaying it on the image.

Example

For an example, refer to the OVERLAYCALLBACK function.


FILETRANSFORMS

Transforms may be used to manipulate images in a number of ways. The transforms discussed below, for use with FlashPix files, may be used to manipulate spatial orientation, color and tone, contrast, and filtering. In some cases, such as contrast manipulation or filtering, a single value may be needed, whereas, with spatial orientation and color and tone manipulation, a matrix of values is required to accomplish the transformation. The values used to accomplish this are stored in the FILETRANSFORMS structure listed below. It is this structure that is written to the file for storage with the image using the L_WriteFileTransforms. The next time the image is loaded, you may examine the transforms stored with the image using the L_ReadFileTransforms function and decide whether to load the image in its original state, or in any of three transformed states. If you elect to load the image unchanged, you must make sure both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags have been set in the Flags data member of LOADFILEOPTION structure before loading the file. (Note: By setting these flags you are telling the system to ignore the transforms.) To load the image with only the effects of the color transforms incorporated, you must set the ELO_IGNOREVIEWTRANSFORMS flag, and clear the ELO_IGNORECOLORTRANSFORMS flag. To load the image with only the effects of the viewing transforms incorporated, you must set the ELO_IGNORECOLORTRANSFORMS flag and clear the ELO_IGNOREVIEWTRANSFORMS flag. Finally, to load the image with both the color transforms and the view transforms incorporated, clear both the ELO_IGNOREVIEWTRANSFORMS and the ELO_IGNORECOLORTRANSFORMS flags. Examples of all four loading options may be seen in"Example" under L_LoadFile. Further explanation of spatial orientation, color and tone manipulation, contrast manipulation and filtering is provided below.

************************************************************************************************************************************************************************************

typedef struct _FILETRANSFORMS
{
// AffineMatrix translation, rotation, shear, skew, scale ...
L_FLOAT a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44;
/* matrix values */
// ColorTwistMatrix
L_FLOAT byy, byc1, byc2, bc1y, bc1c1, bc1c2, bc2y, bc2c1, bc2c2; /* matrix values */
// Contrast Adjustment
L_FLOAT fContrastAdjustment; /* adjustment factor */
L_FLOAT fFilteringValue; /* Sharpness adjustment */
} FILETRANSFORMS, L_FAR * pFILETRANSFORMS;

Comments

The FILETRANSFORM structure is used by L_ReadFileTransforms and L_WriteFileTransforms to read or write FlashPix transforms.

********************************************************************************************************************************************************************************************************************************

Spatial Orientation - Affine matrices

FlashPix supports a number of methods for transforming the spatial orientation of an image. These include shearing, translation, rotation, and scaling and are described using a 4x4 matrix. Image points from the displayed image are mapped to the original image. A generic 4x4 matrix may be seen below:

|¯x'¯| |  | |¯a11 | a12 | a13 | a14¯| |  | |¯x¯|
| y' | | = | | a21 | a22 | a23 | a24 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1 _| |  | |_1_|

where x' and y' are the new, transformed coordinates and x and y are the old coordinates. The values placed in variables a11 through a24 determine what transformation you are performing and the degree of change. The new values are obtained as follows:

x' = a11*x + a12*y + a13*1 + a14*1

y' = a21*x + a22*y + a23*1 + a24*1

First, is the identity matrix, given below. This performs no manipulation of the image data, so the image itself results.

|¯x'¯| |  | |¯1 | 0 | 0 | 0¯| |  | |¯x¯|
| y' | | = | | 0 | 1 | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To translate a point use the following matrix:

|¯x'¯| |  | |¯1 | 0 | 0 | +/-X0¯| |  | |¯x¯|
| y' | | = | | 0 | 1 | 0 | +/-Y0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

where X0 and Y0 indicate the change in X and the change in Y for each point.

To rotate a point about the origin counterclockwise, by the angle ßr, use the following matrix:

|¯x'¯| |  | |¯cos(ßr) | -sin(ßr) | 0 | 0¯| |  | |¯x¯|
| y' | | = | | sin(ßr) | cos(ßr) | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To shear an image horizontally, by an angle of ßhh counterclockwise about the origin, use the following matrix:

|¯x'¯| |  | |¯1 | -tan(ßhh) | 0 | 0¯| |  | |¯x¯|
| y' | | = | | 0 | 1 | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To shear an image vertically, by an angle of ßhv counterclockwise about the origin, use the following matrix:

|¯x'¯| |  | |¯1 | 0 | 0 | 0¯| |  | |¯x¯|
| y' | | = | | tan(ßhv) | 1 | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To skew(or flip) an image horizontally, by an angle of ßsh counterclockwise about the origin, use the following matrix:

|¯x'¯| |  | |¯1 | -tan(ßsh) | 0 | 0¯| |  | |¯x¯|
| y' | | = | | 0 | 1/cos(ßsh) | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To skew(or flip) an image vertically, by an angle of ßsh counterclockwise about the origin, use the following matrix:

|¯x'¯| |  | |¯1/cos(ßsv) | 0 | 0 | 0¯| |  | |¯x¯|
| y' | | = | | tan(ßsv) | 1 | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To scale an image about the origin by sx horizontally and sy vertically, use the following matrix:

|¯x'¯| |  | |¯1/sx | 0 | 0 | 0¯| |  | |¯x¯|
| y' | | = | | 0 | 1/sy | 0 | 0 | | X | | y |
| 1 | |  | | 0 | 0 | 1 | 0 | |  | | 1 |
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

For uniform scaling in both directions, sx = sy.

Multiple transformations may be combined into a single affine transformation. This is not usually commutative; the order of application is important. The example below shows the process of multiplying a linear translation matrix, a rotation matrix, and another linear translation matrix. Basically, the image is translated from its original center point to the origin (0, 0) at the upper left, rotated about the origin and then translated back to the original center. For the purpose of the example, the following are true:

C = the cosine of the angle.

S = the sine of the angle.

X^ = image width / 2. The image width may be obtained using either the L_FileInfo or the L_GetExtFileOption .Examples of retrieving information may be found under "Example" in each of these entries.

Y^ = image height / 2. The image height may be obtained using either the L_FileInfo or the L_GetExtFileOption .Examples of retrieving information may be found under "Example" in each of these entries.

X = the x coordinate of the point being manipulated.

Y = the y coordinate of the point being manipulated.

X' = the new x coordinate.

Y' = the new y coordinate.

The negative symbol before X^ and Y^ in the rightmost 4x4 matrix indicates the translation to the origin. Since this is the first step in the process, this matrix is closest to the 4x1 matrix representing the point being manipulated. Conversely, the translation back to the original center is performed last, by the leftmost 4x4 matrix, and the X^ and Y^ are positive.

Once the order of the three transformation matrices is established, the multiplication of these three matrices is commutative. Here the multiplication will be done left to right, multiplying the leftmost and middle matrices first.

|¯X'¯| |  | |¯1 | 0 | 0 | X^¯| | |¯C | -S | 0 | 0¯| | |¯1 | 0 | 0 | -X^¯| | |¯X¯|
| Y' | | = | | 0 | 1 | 0 | Y^ | x | | S | C | 0 | 0 | x | | 0 | 1 | 0 | -Y^ | x | | Y |
| 1 | |  | | 0 | 0 | 1 | 0 | | | 0 | 0 | 1 | 0 | | | 0 | 0 | 1 | 0 | | | 1 |
|_1 _| |  | |_0 | 0 | 0 | 1 _| | |_0 | 0 | 0 | 1_| | |_0 | 0 | 0 | 1 _| | |_1_|

Multiplying the first row of the leftmost 4x4 matrix above by the first column of the middle matrix above provides the top left entry in the left matrix given below. Multiplying the first row of the leftmost matrix above by the second column of the middle matrix above provides the second entry in the top row of the left matrix below. This continues throughout the entire matrix. The result is the left matrix below, which will then be multiplied by the right matrix to obtain the final 4x4 matrix.

|¯C | -S | 0 | X^¯| | |¯1 | 0 | 0 | -X^¯| | |¯X¯|
| S | C | 0 | Y^ | x | | 0 | 1 | 0 | -Y^ | x | | Y |
| 0 | 0 | 1 | 0 | | | 0 | 0 | 1 | 0 | | | 1 |
|_0 | 0 | 0 | 1 _| | |_0 | 0 | 0 | 1 _| | |_1_|

The multiplication process is carried out as before, multiplying the row of the left matrix by the column of the right matrix. Once this is completed, the 4x4 matrix shown below results. This one matrix will translate, rotate and translate the original image.

|¯C | -S | 0 | (C*(-X^)) + (S*Y^) + X^ | ¯| |  | |¯X¯|
| S | C | 0 | -(S*X^) - (C*Y^) + Y^ | | | x | | Y |
| 0 | 0 | 1 | 0 | | |  | | 1 |
|_0 | 0 | 0 | 1 | _| |  | |_1_|

The new coordinates are determined as follows:

X' = (C*X) - (S*Y) + (C*(-X^)) + (S*Y^) + X^

Y' = (S*X) + (C*Y) - (S*X^) - (C*Y*) + Y^

Color and Tone Manipulation - Color Twist matrices

The FlashPix format uses a Color Twist matrix to allow the user to modify the tone and/or color of an image. This is also accomplished through the use of a matrix. The general form of the matrix is given below:

|¯L'¯| |  | |¯byy | byc1 | byc2 | 0¯| |  | |¯L¯|
|C1' | | = | | bc1y | bc1c1 | bc1c2 | 0 | | X | | C1|
|C2' | |  | | bc2y | bc2c1 | bc2c2 | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

where <L, C1, C2, 1> is a vector of normalized YCC values which is used to modify lightness, saturation and color. The three left-most entries of the bottom row must remain 0. All conversion to the proper colorspace is handled internally.

First, is the identity matrix, given below. This performs no manipulation of the image data, so the image itself results.

|¯L'¯| |  | |¯1 | 0 | 0 | 0¯| |  | |¯L¯|
|C1' | | = | | 0 | 1 | 0 | 0 | | X | | C1|
|C2' | |  | | 0 | 0 | 1 | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To lighten an image by a factor of L1', set L1 equal to the sqrt of L1' and use the following matrix:

|¯L'¯| |  | |¯L1 | 0 | 0 | 0¯| |  | |¯L¯|
| C1'| | = | | 0 | L1 | 0 | 0 | | X | | C1|
| C2'| |  | | 0 | 0 | L1 | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

Values of L1' between 0 and 1 darken the image, while values > 1 lighten the image. Therefore, if you wish to lighten the image by 10%, set L1' = 1.1.

To alter the saturation of an image, use the following matrix:

|¯L'¯| |  | |¯1 | 0 | 0 | 0¯| |  | |¯L¯|
|C1' | | = | | 0 | Sa | 0 | 0 | | X | | C1|
|C2' | |  | | 0 | 0 | Sa | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

where Sa is the saturation factor. Saturation factors between 0 and 1 decrease saturation, which creates a more gray scale image, while values greater than 1 increase saturation. Therefore, if you wish to increase the saturation by 10%, set Sa = 1.1.

To modify the color balance in red, green, or blue:

C = sqrt(C') - 1 where C' is the desired factor of the exposure level. To increase a color by 20%, set C' = 1.2.

To modify the red color balance of an image,

|¯L'¯| |  | |¯1 | 0 | 0.299*C | 0¯| |  | |¯L¯|
|C1' | | = | |-0.299*C | 1 - 0.299*C | 0.299*C | 0 | | X | | C1|
|C2' | |  | |0.701*C | 0 | 1 + 0.402*C | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To modify the green color balance of an image,

|¯L'¯| |  | |¯1 | -0.114*C | -0.299*C | 0¯| |  | |¯L¯|
|C1' | | = | |-0.587*C | 1 - 0.473*C | 0.299*C | 0 | | X | | C1|
|C2' | |  | |-0.587*C | 0.114*C | 1 - 0.288*C | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

To modify the blue color balance of an image,

|¯L'¯| |  | |¯1 | 0.114*C | 0 | 0¯| |  | |¯L¯|
|C1' | | = | |0.886*C | 1 + 0.772*C | 0 | 0 | | X | | C1|
|C2' | |  | |-0.114*C | -0.114*C | 1 - 0.114*C | 0 | |  | | C2|
|_1_| |  | |_0 | 0 | 0 | 1_| |  | |_1_|

Contrast modification

The contrast in an image may be modified using a contrast factor(fContrastAdjustment in the structure). A factor less than one will decrease the contrast, darkening the image, while a factor greater than 1.0 increases the contrast, lightening the image. To increase the contrast by 20%, set fContrastAdjustment = 1.2.

Sharpness modification

The sharpness factor(fFilteringValue) sharpens or softens an image. A positive value results in image sharpening, while a negative value results in softening or blurring of the image.


FTARRAY

typedef struct tagFTARRAY
{
L_UINT uStructSize;
L_UINT uWidth;
L_UINT uHeight;
L_COMPLEX acxData[1];
} FTARRAY, L_FAR * pFTARRAY;

The FTARRAY structure contains information about the complex 2D array that will hold the frequency components of the image.

Parameter | Description
uStructureSize | FTARRAY structure size. Should be set to sizeof(FTARRAY).
uWidth | 2D array width in pixels.
uHeight | 2D array height in pixels.
acxData | The 2D data array. Note that, although only one element is declared in the array, the array contains uWidth * uHeight elements. The frequency component for the pixel (row, col) is acxData[row * uWidth + col].

Comments

This structure is used only by the Fourier Transform functions:

L_AllocFTArray

L_DFTBitmap

L_FFTBitmap

L_FreeFTArray

L_FTDisplayBitmap

L_FrqFilterBitmap

L_FrqFilterMaskBitmap


GRAYCOLOR

typedef struct tagGRAYCOLOR
{
L_UINT uStructSize;
RGBQUAD crColor;
L_UINT uThreshold;
}
GRAYCOLOR, L_FAR * pGRAYCOLOR;

The GRAYCOLOR structure contains information about gray color intensities (uThreshold) and the associated colors (crColor) used in coloration function L_ColorizeGrayBitmap.

Member | Description
uStructSize | Size of the structure. Use sizeof(GRAYCOLOR).
crColor | The RGB color used for coloring the specified range of intensities set in uThreshold. crColor.rgbReserved is ignored.
uThreshold | The maximum value of the pixels which will be colored with this color. The pixels with a value smaller than this will have the color crColor. If the GRAYCOLOR structure is the last in the pGrayColors array, then this value is ignored and the maximum possible value will be used instead.
 | 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.

Comments

L_ColorizeGrayBitmap uses an array of these structures with its length being a user-defined number. If the array has N entries, then:

Intensity Range | Color
0 ~ uThreshold[0] | crColor[0]
uThreshold[0] + 1 ~ uThreshold[1] | crColor[1]
uThreshold[1] + 1 ~ uThreshold[2] | crColor[2]
… |
uThreshold[N-3] + 1 ~ uThreshold[N-2] | crColor[N-2]
uThreshold[N-2] + 1 ~ uThreshold[N-1] | crColor[N-1]

Notice that the uThreshold[N-1] value will be ignored and instead will be treated as a value equal to 255, 4095 and 65535 for 8, 12 and 16-bit images respectively.

Although it is not a requirement, it is recommended that uThreshold[0] < uThreshold[1] < uThreshold[2] < … < uThreshold[N-2] < uThreshold[N-1]. Consider the following example with a GRAYCOLOR structure of 4 entries for a 12-Bit gray bitmap, where this recommendation is not followed:

uThreshold[0] = 1000; crColor is Red.

uThreshold[1] = 3000; crColor is Green.

uThreshold[2] = 2000; crColor is Blue. // Notice the threshold here.

uThreshold[3] = 4000; crColor is Yellow.

In this case, pixel intensities from 0 to 1000 will be colored as Red, pixels 1001 to 3000 will be colored as Green, pixels 3001 to 4000 will be colored as Yellow, pixels from 4001 till the last possible intensity will be colored as Yellow too.

This structure is used by L_ColorizeGrayBitmap function.


HANNOBJECT (Document/Medical only)

LEADTOOLS has defined the following data types for referencing annotation objects:

Data Type | Definition and Usage
HANNOBJECT | Defined as HANDLE; used as a handle to the annotation object.
pHANNOBJECT | Defined as HANNOBJECT L_FAR *; used as a pointer to a HANNOBJECT variable.


HOLEPUNCH

typedef struct tagHOLEPUNCH
{
L_UINT uStructSize;
L_UINT32 uFlags;
L_INT32 iMinHoleCount;
L_INT32 iMaxHoleCount;
L_INT32 iMinHoleWidth;
L_INT32 iMinHoleHeight;
L_INT32 iMaxHoleWidth;
L_INT32 iMaxHoleHeight;
L_INT32 iLocation;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
HRGN hRgn;

} HOLEPUNCH, L_FAR * LPHOLEPUNCH;

The HOLEPUNCH structure provides hole punch removal information for the L_HolePunchRemoveBitmap function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | Flags that determine the behavior of the hole punch removal process. Flags may be combined using a bitwise OR (|). Possible values are:
 | Value | Meaning
 | HOLEPUNCH_SINGLE_REGION | For each hole punch encountered by L_HolePunchRemoveBitmap, if the HOLEPUNCHREMOVECALLBACK function returns SUCCESS_REMOVE, the removed hole punch is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the hole punch is not added to the single region. When L_HolePunchRemoveBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed hole punches. If HOLEPUNCH_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed hole punch. If HOLEPUNCH_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed hole punches. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | HOLEPUNCH_LEAD_REGION | When L_HolePunchRemoveBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed hole punches. This flag must be used in conjunction with HOLEPUNCH_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to HOLEPUNCH_SINGLE_REGION | HOLEPUNCH_LEAD_REGION. This variable will be updated when L_HolePunchRemoveBitmap returns.
 | HOLEPUNCH_IMAGE_UNCHANGED | The original image is unchanged.
 | HOLEPUNCH_USE_DPI | The unit of measure for all fields of the HOLEPUNCH structure 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 fields of the HOLEPUNCH structure is pixels.
 | HOLEPUNCH_CALLBACK_REGION | HOLEPUNCHREMOVECALLBACK 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 callback function, if the callback function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when HOLEPUNCH_SINGLE_REGION is set in uFlags. For an example, refer to L_HolePunchRemoveBitmap. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().
 | HOLEPUNCH_USE_SIZE | Use the iMinHoleWidth, iMinHoleHeight, iMaxHoleWidth, iMaxHoleHeight members of the HOLEPUNCH structure 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 members of the HOLEPUNCH structure 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 member of the HOLEPUNCH structure to indicate the location of the hole punches to remove. If this flag is not set, a default of HOLEPUNCH_LEFT will be used.

iMinHoleCount | Minimum number of holes to detect. This member is valid only if HOLEPUNCH_USE_COUNT is set in uFlags.
iMaxHoleCount | Maximum number of holes to detect. This member is valid only if HOLEPUNCH_USE_COUNT is set in uFlags.
iMinHoleWidth | The minimum width of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if HOLEPUNCH_USE_SIZE is set in uFlags.
iMinHoleHeight | The minimum height of one of the holes of the hole punch configuration to be removed.. If HOLEPUNCH_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if HOLEPUNCH_USE_SIZE is set in uFlags.
iMaxHoleWidth | The maximum width of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if HOLEPUNCH_USE_SIZE is set in uFlags.
iMaxHoleHeight | The maximum height of one of the holes of the hole punch configuration to be removed. If HOLEPUNCH_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if HOLEPUNCH_USE_SIZE is set in uFlags.
iLocation | 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
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If HOLEPUNCH_SINGLE_REGION | HOLEPUNCH_LEAD_REGION have been set in uFlags, then when L_HolePunchRemoveBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the hole punches. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (HOLEPUNCH_SINGLE_REGION | HOLEPUNCH_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn() when it is no longer needed. Refer to the L_HolePunchRemoveBitmap example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_HolePunchRemoveBitmap returns, this is updated with a single windows region corresponding to all changes, only if HOLEPUNCH_SINGLE_REGION has been set in uFlags and HOLEPUNCH_LEAD_REGION has not been set. To use this, set the flags field to (HOLEPUNCH_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.


HSIDATA

typedef struct tagHSIDATA
{
L_UINT uStructSize;
L_INT nHue;
L_INT nSaturation;
L_INT nIntensity;
L_INT nOuterLow;
L_INT nOuterHigh;
L_INT nInnerLow;
L_INT nInnerHigh;
}
HSIDATA, L_FAR * LPHSIDATA;

The HSIDATA structure provides the color range information used in L_ChangeHueSatIntBitmap function.

Member | Description
uStructSize | Size of the structure. Should be set to sizeof(HSIDATA).
nHue | Angular amount to change the hue, in hundredths of degrees. Valid values range from –18000 through 18000. This value is divided internally by 100.
nSaturation | Percentage amount to change saturation, in tenths of percent. Valid values range from –1000 through 1000. This value is divided internally by 10.
nIntensity | Percentage amount to change the intensity , in tenths of percent. Valid values range from –1000 through 1000. This value is divided internally by 10.
nOuterLow | Specifies the start of the color range to be changed. Valid values range from –359 through 359.
nOuterHigh | Specifies the end of the color range to be changed. Valid values range is from –359 through 359.
nInnerLow | Specifies the start of the color range to be fully changed. The valid range is between the nOuterLow and nOuterHigh values.
nInnerHigh | Specifies the end of the color range to be fully changed. The valid range is between the nOuterLow and nOuterHigh values.

The hue values for the inner and outer ranges are expressed as degrees in the HSB color space. Values inside the inner range are changed fully and those within the outer range are changed partially, as described below.


HSVREF

typedef struct _HSVREF
{
L_UCHAR uH;
L_UCHAR uS;
L_UCHAR uV;
L_UCHAR uReserved;
} HSVREF, L_FAR * pHSVREF;

The HSVREF structure contains the Hue, Saturation and Value of a specific color.

Member | Description
uH | Hue of the color.
uS | Saturation of the color.
uV | Value of the color.

Comments

pHSVREF is a pointer to an HSVREF structure.

The HSV value is the Hue ,Saturation, Value color space. Traditionally, hue ranges from 0 to 359. However, the hue component of the HSVREF is represented by an unsigned byte. Therefore, 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 ranges from 0 to 255 where 0 means the highest amount of white and 255 means no white.

Value ranges from 0 to 255 where 0 means highest amount of black and 255 means no black.

This structure is used by both the L_HSVtoRGB and L_RGBtoHSV functions.


INVERTEDTEXT

typedef struct tagINVERTEDTEXT
{
L_UINT uStructSize;
L_UINT32 uFlags;
L_INT32 iMinInvertWidth;
L_INT32 iMinInvertHeight;
L_INT32 iMinBlackPercent;
L_INT32 iMaxBlackPercent;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
HRGN hRgn;
} INVERTEDTEXT, L_FAR*LPINVERTEDTEXT;

The INVERTEDTEXT structure provides information for the L_InvertedTextBitmap function to find and modify inverted text.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | 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 encountered by L_InvertedTextBitmap, if the INVERTEDTEXTCALLBACK function returns SUCCESS_REMOVE, the removed inverted text is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the inverted text is not added to the single region. When L_InvertedTextBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed inverted text. If INVERTEDTEXT_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed inverted text. If INVERTEDTEXT_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed inverted text. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | INVERTEDTEXT_LEAD_REGION | When L_InvertedTextBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed inverted text. This flag must be used in conjunction with INVERTEDTEXT_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION. This variable will be updated when L_InvertedTextBitmap returns.
 | INVERTEDTEXT_IMAGE_UNCHANGED | The original image is unchanged.
 | INVERTEDTEXT_USE_DPI | The unit of measure for all fields of the INVERTEDTEXT structure 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 fields of the INVERTEDTEXT structure is pixels.
 | INVERTEDTEXT_CALLBACK_REGION | INVERTEDTEXTCALLBACK receives a Windows region that contains the current inverted text to be removed. Setting this flag lets the user create his or her own composite of removed inverted text by combining the regions received by the callback function, if the callback function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when INVERTEDTEXT_SINGLE_REGION is set in uFlags. For an example, refer to L_InvertedTextBitmap. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().
 | INVERTEDTEXT_USE_DIAGONALS | Considers pixels that are diagonal to the inverted text as part of the inverted text.
iMinInvertWidth | The minimum width of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMinInvertHeight | The minimum height of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMaxInvertWidth | The maximum width of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMaxInvertHeight | The maximum height of an area that is considered to be inverted text. If INVERTEDTEXT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
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.
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.
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION have been set in uFlags, then when L_InvertedTextBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed inverted text. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn when it is no longer needed. Refer to the L_InvertedTextBitmap example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_InvertedTextBitmap returns, this is updated with a single windows region corresponding to all changes, only if INVERTEDTEXT_SINGLE_REGION has been set in uFlags and INVERTEDTEXT_LEAD_REGION has not been set. To use this, set the flags field to (INVERTEDTEXT_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.


JPEGCOLORSPACE

typedef enum tagJPEGCOLORSPACE
{
JPEG_COLORSPACE_411 = 0, // optimizing with YUV 4:1:1 color space.
JPEG_COLORSPACE_422 = 1 // optimizing with YUV 4:2:2 color space.
} JPEGCOLORSPACE, *pJPEGCOLORSPACE;

This data type is used within the OPTIMIZEIMAGEOPTIONS structure to specify which color space is used when optimizing a JPEG Image.


L_COMPLEX

typedef struct tagCOMPLEX
{
L_DOUBLE r;
L_DOUBLE i;
}L_COMPLEX, L_FAR * LPCOMPLEX;

The COMPLEX structure contains a complex number representing a specific frequency component in Fourier Transform functions.

Member | Description
r | Real part of a complex number.
i | Imaginary part of a complex number.

Comments

This structure is used only by the Fourier Transform functions:

L_AllocFTArray

L_DFTBitmap

L_FFTBitmap

L_FreeFTArray

L_FTDisplayBitmap

L_FrqFilterBitmap

L_FrqFilterMaskBitmap


LIGHTINFO

typedef struct _LIGHTINFO
{
L_UINT uStructSize;
POINT ptCenter;
L_UINT uWidth;
L_UINT uHeight;
L_INT nAngle;
L_UINT uBright;
L_UINT uEdge;
COLORREF crFill;
L_UINT uOpacity;
L_UINT uFlag;
} LIGHTINFO, L_FAR * LPLIGHTINFO;

The LIGHTINFO structure provides light source information used in L_LightBitmap function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
ptCenter | POINT structure that contains the center of the ellipse used to represent the light.
uWidth | Value that represents the width of the ellipse used to represent the light.
uHeight | Value that represents the height of the ellipse used to represent the light.
nAngle | 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.
uBright | Intensity or brightness of the light.
uEdge | Percentage by which to smooth the light border. The valid range is from 0 to 100.
crFill | Color of the light.
uOpacity | Opacity of the light.
uFlag | 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 uWidth, uHeight, nAngle and uEdge members.
 | LGT_DIRELIGHT | [0x0001] The light will be applied to the whole image. If this flag is used, the uWidth, uHeight, nAngle, uEdge members will be ignored.


LIGHTPARAMS

typedef struct tagLIGHTPARAMS
{
L_UINT uStructSize;
L_UINT uFreq;
L_UINT uRAmp;
L_UINT uGAmp;
L_UINT uBAmp;
L_UINT uShape;
L_UINT uOperand;
L_INT nAngle;
L_UINT uXOrigin;
L_UINT uYOrigin;
L_INT nPhase;
L_INT L_FAR * pBuff;
L_UINT uBuffCount;
L_UINT uFlags;
}LIGHTPARAMS, L_FAR * LPLIGHTPARAMS;

The LIGHTPARAMS structure provides the information needed for the L_FunctionalLightBitmap Function.

Member | Description
uStructSize | This member must be set to sizeof(LIGHTPARAMS).
uFreq | Value that represents the frequency factor. This member used if the uFlags 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).
uRAmp | If the bitmap is grayscale, this parameter represents the amplitude of the master channel. If the bitmap is color and FL_MUL or FL_LINEAR_QUADRATIC are set, this parameter represents the amplitude of each channel. If the bitmap is color and FLB_ADD is used, 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, user buffer , …). The results of the multiplications are then added to the pixel values. These functions as well as the real buffer values are from –1 to 1.
 | Possible values for uRAmp are from 0–100.
uGAmp | Value that represents the amplitude of the green color when the addition operation is used (FL_ADD is set). This value is ignored when grayscale images are used or when the multiplication operation is used (FL_MUL is set). This value is also ignored if uFlags contains FL_LINEAR_QUADRATIC
 | Possible values for uGAmp are from 0–100.
uBAmp | Value that represents the amplitude of the blue color when the addition operation is used (FL_ADD is set). This value is ignored when grayscale images are used or when the multiplication operation is used (FL_MUL is set). This value is also ignored if uFlags contains FL_LINEAR_QUADRATIC
 | Possible values for uBAmp are from 0 –100.
nAngle | Value that represents the angle, in hundredths of degrees. This member is used if uFlags is set to FL_TRIGONOMETRY or to FL_FREEHAND. Valid values for nAngle range from -18000 to 18000. This value is divided internally by 100.
uXOrigin | Value that represents the X coordinate of the origin, in pixels. This member used if the uFlags is set to FL_TRIGONOMETRY and FL_CIRCLES or to FL_LINEAR_QUADRATIC.
uYOrigin | Value that represents the Y coordinate of the origin, in pixels. This member used if the uFlags is set to FL_TRIGONOMETRY and FL_CIRCLES or to FL_LINEAR_QUADRATIC.
nPhase | Value that represents the phase shift angle, in hundredths of degrees, this member used if the uFlags is set to FL_TRIGONOMETRY. Possible values for nPhase are from -18000 to 18000. This value will be divided internally by 100.
pBuff | Pointer holds all points that represents the shape that drawn by the user. This member is used only if uFlags 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.
uBuffCount | Number of points stored in pBuff. This member is used only if uFlags is set to FL_FREEHAND.
uFlags | This member has the following values:
 | Value | Meaning
 | FL_LINEAR_QUADRATIC | [0x1000] If this flag is set, the light will be computed according to distance from the center which is represented by uXOrigin and uYOrigin parameters, 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, 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, uFreq, nAngle, uXOrigin and uYOrigin 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 pBuff parameter. If this flag is set, the nAngle, pBuff and nBuffCount will be used. The nAngle 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 (uXOrigin, uYOrigin) and will decreases outwards. 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 (uXOrigin, uYOrigin). This flag is valid only if FL_LINEAR_QUADRATIC is also set.
 | FL_QUADRATIC_INNER | [0x0004] The Quadrate light will be concentrated at the center (uXOrigin, uYOrigin) and will decrease outwards. This flag is valid only if FL_LINEAR_QUADRATIC is also set.
 | FL_QUADRATIC_OUTER | [0x0008] The Quadrate light will be concentrated at the far points from the center and will decrease inwards towards the center (uXOrigin, uYOrigin). 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 nAngle 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 (uXOrigin, uYOrigin).
 |  | This flag is valid only if FL_TRIGONOMETRY is also set.
 | FL_ADD | [0x0040] The amplitude parameters value (uRAmp, uGAmp, and uBAmp) 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 are also set.
 | FL_MUL | [0x0080] Multiply the color factor specified by the uRAmp 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 are also set.

Example

For an example, refer to L_FunctionalLightBitmap


LINEREMOVE

typedef struct tagLINEREMOVE
{
L_UINT uStructSize;
L_UINT32 uFlags;
L_INT32 iMinLineLength;
L_INT32 iMaxLineWidth;
L_INT32 iWall;
L_INT32 iMaxWallPercent;
L_INT32 iGapLength;
L_INT32 iLineVariance;
L_UINT32 uRemoveFlags;
HRGN hRgn;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
} LINEREMOVE, L_FAR *LPLINEREMOVE;

The LINEREMOVE structure provides line removal information for the L_LineRemoveBitmap function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | 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 L_LineRemoveBitmap, if the LINEREMOVECALLBACK function returns SUCCESS_REMOVE, the removed line is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the line is not added to the single region. When L_LineRemoveBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed lines. If LINE_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed lines. If LINE_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed lines. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | LINE_LEAD_REGION | When L_LineRemoveBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed lines. This flag must be used in conjunction with LINE_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Then set uFlags to LINE_SINGLE_REGION | LINE_LEAD_REGION. This variable will be updated when L_LineRemoveBitmap returns.
 | LINE_IMAGE_UNCHANGED | The original image is unchanged.
 | LINE_USE_DPI | The unit of measure for all fields of the LINEREMOVE structure is thousandths of an inch. Use the images 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 fields of the LINEREMOVE structure is pixels.
 | LINE_CALLBACK_REGION | LINEREMOVECALLBACK 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 callback function, if the callback function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when LINE_SINGLE_REGION is set in uFlags. For an example, refer to L_LineRemoveBitmap. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().
 | 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 field of the LINEREMOVE structure is used. If this flag is not passed, the iGapLength field is ignored.
 | LINE_USE_VARIANCE | Consider line variance when performing line removal. If this flag is passed, the iLineVariance field of the structure is used. If this flag is not passed, the iLineVariance field of the structure is ignored.
iMinLineLength | Minimum length of a line considered for removal. Lines less than this length are not removed. If LINE_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.
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 uFlags, units are in thousandths of an inch, otherwise units are in pixels.
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 uFlags, units are in thousandths of an inch, otherwise units are in pixels.
iMaxWallPercent | 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.
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 uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if LINE_USE_GAP is set in uFlags.
iLineVariance | Amount of width change that is tolerated between adjacent line slices. If LINE_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels. This member is valid only if LINE_USE_VARIANCE is set in uFlags. For example, the following horizontal line is 30 pixels in length (X represents a pixel)

XXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXX

XXXXXXXXXX

 | If iLineVariance 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.
uRemoveFlags | Flag that indicates which lines to remove. Possible values are:
 | Value | Meaning
 | LINEREMOVE_HORIZONTAL | remove horizontal lines
 | LINEREMOVE_VERTICAL | remove vertical lines
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If LINE_SINGLE_REGION | LINE_LEAD_REGION have been set in uFlags, then when L_LineRemoveBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed lines. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (LINE_SINGLE_REGION | LINE_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn() when it is no longer needed. Refer to the L_LineRemoveBitmap example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_LineRemoveBitmap returns, this is updated with a single windows region corresponding to all changes, only if LINE_SINGLE_REGION has been set in uFlags and LINE_LEAD_REGION has not been set. To use this, set the flags field to (LINE_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.

Comments

To "fine-tune" the performance of L_LineRemoveBitmap, try modifying the values for iWall, iGapLength and iVariance.


LVLCLR

typedef struct tagLVLCLR

{
L_UINT uStructSize;
LVLCLRINF master;
LVLCLRINF red;
LVLCLRINF green;
LVLCLRINF blue;
} LVLCLR, L_FAR * pLVLCLR;

The LVLCLR structure is used to set color-leveling information (when used in L_ColorLevelBitmap) or to retrieve color-leveling information (when used in L_AutoColorLevelBitmap).

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
master | A LVLCLRINF structure that sets the color-leveling information for the master channel when used in L_ColorLevelBitmap. When used in L_AutoColorLevelBitmap with the flag AUTO_CONTRAST or AUTO_INTENSITY, it retrieves the color-leveling information of the master channel
red | A LVLCLRINF structure that sets the color-leveling information for the red channel when used in L_ColorLevelBitmap. When used in L_AutoColorLevelBitmap with the flag AUTO_LEVEL, it retrieves the color-leveling information of the red channel.
green | A LVLCLRINF structure that sets the color-leveling information for the green channel when used in L_ColorLevelBitmap. When used in L_AutoColorLevelBitmap with the flag AUTO_LEVEL, it retrieves the color-leveling information of the green channel.
blue | A LVLCLRINF structure that sets the color-leveling information for the blue channel when used in L_ColorLevelBitmap. When used in L_AutoColorLevelBitmap with the flag AUTO_LEVEL, it retrieves the color-leveling information of the blue channel.

Comments

When used in the L_ColorLevelBitmap function, the LVLCLR structure contains information about the shadows (uMinInput), highlights (uMaxInput), and mapping (uMaxOutput, uMaxOutput, uGamma) values for the specified channel(s) when applying leveling to an image.

When used in the L_AutoColorLevelBitmap function, the LVLCLR structure retrieves the settings for the shadows (uMinInput), highlights (uMaxInput), and mapping values (uMaxOutput, uMaxOutput and uGamma) of the channels that are used in order to apply one of the leveling effects to an image. If these settings are then used with the L_ColorLevelBitmap function, the effect produced will be the same as if the L_AutoColorLevelBitmap function had been used with the appropriate AUTO_LEVEL, AUTO_CONTRAST, or AUTO_INTENSITY processing flag.

If uFlags in L_AutoColorLevelBitmap is set to AUTO_LEVEL, then the master channel is unchanged. For example, if the bitmap is 8 bits per component then the R, G and B channels will have the values 0, 255, 0, 255 and DEFAULT_GAMMA respectively.

If uFlags in L_AutoColorLevelBitmap is set to AUTO_CONTRAST or AUTO_INTENSITY, then the red, green and blue channels are unchanged. For example, if the bitmap is 8 bits per component then the R, G and B channels will have the value 0, 255, 0, 255 and DEFAULT_GAMMA respectively.

This structure is used by the following function:

L_ColorLevelBitmap


LVLCLRINF

typedef struct tagLVLCLRINF
{
L_UINT uMinInput;
L_UINT uMaxInput;
L_UINT uMinOutput;
L_UINT uMaxOutput;
L_UINT uGamma;
} LVLCLRINF, L_FAR * pLVLCLRINF;

The LVLCLRINF structure contains color-leveling information for a specific color channel.

Member | Description
uMinInput | 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 uMinOutput.
uMaxInput | 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 uMaxOutput.
uMinOutput | 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.
uMaxOutput | 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.
uGamma | 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 uGamma = 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.

Comments

The value of the uMaxInput member must be greater than the value of the uMinInputValue member by at least 2.

If uMinOutput > uMaxOutput then the image’s shadows and highlights will be inverted for the given channel.

This structure is used by the LVLCLR structure.


MAGGLASSOPTIONS

typedef struct tag_MagGlassOptions
{
L_UINT uStructSize;
L_INT32 nWidth;
L_INT32 nHeight;
L_INT nZoom;
COLORREF clrPen;
HCURSOR hMagCursor;
COLORREF clrBack;
L_BOOL bEllipse;
L_INT nBorderSize;
L_BOOL b3D;
L_UINT32 uPaintFlags;
COLORREF L_FAR* pMask;
L_UINT uMaskCount;
L_UINT32 uMagGlassFlags;
L_INT nCrosshair;
L_BOOL bIgnoreRgn;
L_BOOL bCenter;
} MAGGLASSPAINTOPTIONS, L_FAR * pMAGGLASSPAINTOPTIONS;

The MAGGLASSPAINTOPTIONS structure provides magnifying glass paint options information for the L_SetMagGlassPaintOptions function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nWidth | The width of the magnifying glass. Minimum size is 10 pixels.
nHeight | The height of the magnifying glass. Minimum size is 10 pixels.
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.
clrPen | The color of the border of the magnifying glass. This is ignored when bEllipse = FALSE and b3D = TRUE.
hMagCursor | Handle to a custom cursor to use for the Magnify Glass procedure. Pass NULL to use the default cursor.
 | When bEllipse = TRUE, the default cursor will be:
 | When bEllipse = FALSE, the default cursor will be:
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.)
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
nBorderSize | 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.
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.
uPaintFlags | Flags that indicate how the zoomed image will be painted. These are the same as Flags for the L_SetDisplayMode function. You can pass 0 to use the current DisplayMode settings. Or, You can specify all the flags you wish to use. If uPaintFlags != 0, then This function will turn off all flags before setting the values you specify. For example, you can use DISPLAYMODE_BICUBIC to make the zoomed image look better.
pMask | Optional array of color values to mask out of the Magnified display.
uMaskCount | Number of colors in the pMask array.
uMagGlassFlags | Flags that control two behaviors of the magnifying glass:
 | 1. Flags that indicate which colors in the zoomed image will be displayed and which colors will be masked. Possible values are:
 | Value | Meaning
 | MAGGLASS_MASK_NORMAL | [0x0000] Works in two ways:
 |  | 1. When this flag is set without setting MAGGLASS_MASK_FROM_REGION flag, then only those colors present in the pMask parameter will be masked in the Magnifying Glass display area. All other colors will be displayed.
 |  | 2. When this flag is set in combination with setting MAGGLASS_MASK_FROM_REGION flag, then the colors present in the pMask parameter will be ignored and only the bitmap region colors will be masked in the Magnifying Glass display area. All other colors will be displayed.
 | MAGGLASS_MASK_INVERT | [0x0001] Works in two ways:
 |  | 1. When this flag is set without setting MAGGLASS_MASK_FROM_REGION flag, then only those colors present in the pMask parameter will be displayed in the Magnifying Glass display area. All other colors will be masked.
 |  | 2. When this flag is set in combination with setting MAGGLASS_MASK_FROM_REGION flag, then the colors present in the pMask parameter will be ignored and only the bitmap region colors will be displayed in the Magnifying Glass display area. All other colors will be masked.
 | MAGGLASS_MASK_FROM_REGION | [0x0004] Works only if the Bitmap has a region, LEADTOOLS will get all colors from this region and either masks or displays these colors according to MAGGLASS_MASK_NORMAL and MAGGLASS_MASK_INVERT flags.
 | Note: This feature that is provided by this flag works ideally with rectangle regions since LEADTOOLS gets the bounding rectangle of the Bitmap region then gets all the colors of this rectangle.
 | 2. Flags that enable or disable the manual update of the magnifying glass:
 | Value | Meaning
 | MAGGLASS_MANUAL_UPDATE | [0x0002] When this flag is set, LEADTOOLS will not handle the mouse events in order to manipulate the Magnifying Glass. It becomes the user’s responsibility to control the Magnifying Glass by using the L_ShowMagGlass and L_SetMagGlassPos functions.
nCrosshair | 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.
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.
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.


MAGGLASSPAINTOPTIONS

typedef struct tag_MagGlassPaintOptions
{
L_UINT uStructSize;
L_INT nContrast;
L_INT nGamma;
L_INT nIntensity;
} MAGGLASSPAINTOPTIONS, L_FAR * pMAGGLASSPAINTOPTIONS;

The MAGGLASSPAINTOPTIONS structure provides magnifying glass paint options information for the L_SetMagGlassPaintOptions function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nContrast | Magnifying glass paint contrast.
nGamma | Magnifying glass paint gamma.
nIntensity | Magnifying glass paint intensity.

Comments

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


MEMICCPROFILE

typedef struct _MEMICCPROFILE
{
L_UINT uStructSize ;
L_UCHAR L_FAR * pData;
L_UINT uDataSize ;
} MEMICCPROFILE, L_FAR * pMEMCCPROFILE;

The MEMICCPROFILE structure provides information about an embedded ICC profile.

Member | Description
uStructSize | Size of this structure. Set this to sizeof(MEMICCPROFILE).
pData | Pointer to the actual ICC data.
uDataSize | Size of the ICC data pointed to by pData.

Comments

This structure is used by the following functions:

L_FreeICCProfile

L_InitICCProfile

L_LoadICCProfile


MOSAICTILESINFO

typedef struct tagMOSAICTILESINFO
{
L_UINT uStructSize;
L_UINT uOpacity;
L_UINT uPenWidth;
L_UINT uTileWidth;
L_UINT uTileHeight;
POINT ptCenter;
L_UINT uShadowAngle;
L_UINT uShadowThresh;
COLORREF crBorderColor;
COLORREF crTilesColor;
L_UINT uFlags;
}MOSAICTILESINFO, L_FAR * LPMOSAICTILESINFO;

The MOSAICTILESINFO structure provides the information needed for the L_MosaicTilesBitmap function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
uOpacity | 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 uOpacity = 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. Possible values are from 0 to 100.
uPenWidth | Value that indicates the width of the pen used to draw tile boundaries, in logical units. Possible values range from 1 to 15. The pen uses the crBorderColor.
uTileWidth | Value that represents the width of the tile. The meaning of uTileWidth differs according to the flags that are set in the uFlags member. Possible values are:
 | If uFlags contains | uTileWidth 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.
uTileHeight | Value that represents the height of the tile. The uTileHeight differs according to the flags that are set in the uFlags member. Possible values are:
 | If uFlags contains | uTileHeight 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.
ptCenter | Point that represents the center of revolution when polar coordinates are used. This parameter is used if MSCT_POLAR is set in uFlags.

uShadowAngle | 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 in uFlags. 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
uShadowThresh | Value that determines which pixels will be affected by the shadow. Possible values range from 0 through 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 uFlags.
crBorderColor | The COLORREF value that specifies the transparency fill color for the tile border areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crTilesColor | The COLORREF value that specifies the transparency fill color for the tiles. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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, uTileWidth contains the tile width in pixels, and uTileHeight contains the tile height in pixels.
 | MSCT_POLAR | [0x0001] Draw arc-shaped tiles. If this flag used, uTileWidth contains the size of the curve in the tiles in degrees, and uTileHeight 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.


OPTIMIZEIMAGEDIRINFO

typedef struct _tagOPTIMIZEIMAGEDIRINFO
{
L_UINT uStructSize;
L_TCHAR szOrgFileName[MAX_PATH];
L_TCHAR szOptFileName[MAX_PATH];
L_INT nStatusCode;
L_INT nFilePercent;
L_INT nTotalPercent;
L_INT nTotalFolderFilesCount;
pFILEINFO pFileInfo;
pOPTIMIZEIMAGEOPTIONS pOptImgOptions;
} OPTIMIZEIMAGEDIRINFO, L_FAR * pOPTIMIZEIMAGEDIRINFO;

The OPTIMIZEIMAGEDIRINFO structure provides information about the image(s) being optimized.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
szOrgFileName | A character string that contains the original full file name.
szOptFileName | A character string that contains the optimized full file name.
nStatusCode | Value that represents the current status. If an error occurred during image optimization, this will be < SUCCESS. Possible values are:
 | Value | Meaning
 | <SUCCESS | An error occurred.
 | SUCCESS | [1] Indicates that all selected and supported files in the directory(s) have been optimized successfully.
 | OPTIMIZE_DIR_PRE_OPTIMIZINGIMAGE | [2] Indicates that the image specified in szOrgFileName is about to be optimized. You can update the optimization options by updating the structure referenced by pOptImgOptions.
 | OPTIMIZE_DIR_OPTIMIZINGIMAGE | [3] Indicates that the image specified in szOrgFileName is being optimized. Information on the percent of optimization that has been completed can be found in nFilePercent and nTotalPercent.
nFilePercent | Value that represents the percentage of the original file that has been optimized, when the nStatusCode is OPTIMIZE_DIR_OPTIMIZINGIMAGE.
nTotalPercent | Value that represents the percentage of all files that have been optimized, when nStatusCode is equal to OPTIMIZE_DIR_OPTIMIZINGIMAGE.
nTotalFolderFilesCount | Value that represents the total number of files in the directory to be optimized.
pFileInfo | Pointer to a FILEINFO structure that contains information about the file specified in szOrgFileName. This pointer is valid only inside the callback function.
pOptImgOptions | Pointer to an OPTIMIZEIMAGEOPTIONS structure that contains the optimization options to be used in the optimization operation. This pointer is valid only inside the callback function. You can update the optimization options by updating the optimization options structure values pointed to by pOptImgOptions ONLY if nStatusCode = PTIMIZE_DIR_PRE_OPTIMIZINGIMAGE.

Comments

This structure is used by the OPTIMIZEIMAGEDIRCALLBACK callback function.


OPTIMIZEIMAGEOPTIONS

typedef struct _tagOPTIMIZEIMAGEOPTIONS
{
L_UINT uStructSize;
L_UINT uJPEGQFactor;
L_UINT uPNGQFactor;
JPEGCOLORSPACE JPEGColorSpace;
L_INT nPercent;
L_UINT uDistance;
L_BOOL bPickSamePalette;

} OPTIMIZEIMAGEOPTIONS, L_FAR * pOPTIMIZEIMAGEOPTIONS;

The OPTIMIZEIMAGEOPTIONS structure provides options to be used by the Image Optimization functions to optimize the image and save it using the optimal bits per pixel.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uJPEGQFactor | Value that represents the quality factor used in the image optimization operation. The uJPEGQFactor is a number that determines the degree of loss in the compression process. You can set a value from 2 to 255, where 2 represent the highest quality and 255 represent 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.
uPNGQFactor | Value that represents the quality factor to be used in the image optimization operation. The uPNGQFactor 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.
JPEGColorSpace | Value that represents the color space to be used in the image optimization operation if and only if the original image format was one of the LEAD Supported JPEG Formats. For more information refer to JPEGCOLORSPACE. The default value is JPEG_COLORSPACE_411.
nPercent | Value that represents the percent of redundancy to be used in the image optimization operation. This value will be used if the original image format was: - PNG File (FILE_PNG). - GIF File (FILE_GIF). - One of LEAD Supported BMP Formats with 1, 4, and 8 bits per pixel only. The nPercent value can be a value between 0 and 100. The default value is 10.
uDistance | Value that represents the distance between image colors to be reduced in the image optimization operation. This value will be used if the original image format was: - PNG File (FILE_PNG). - GIF File (FILE_GIF). - One of LEAD Supported BMP Format with 1, 4, and 8 bits per pixel only. The uDistance value can be a value between 0 and 255, where: - 0 means no additional reduction. - 1 to 255 further reduction based on the color distance The default value is 8.
bPickSamePalette | Flag 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
 | TRUE | Generate A Unique Global Palette for all GIF Frames.
 | FALSE | Generate individual palette for each GIF Frame.
 | The default value is FALSE.

Comments

This structure is used only by the Image Optimizing functions:

L_OptGetDefaultOptions function.

L_OptOptimizeBuffer function.

L_OptOptimizeDir function.


OVERLAYATTRIBUTES

The OVERLAYATTRIBUTES structure contains the overlay attributes. The attributes are stored as member variables or as flags inside the uFlags member.

Member | Data Type | Description
uStructSize | L_UINT | The size of the structure (use sizeof (OVERLAYATTRIBUTES) )
ptOrigin | POINT | 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.
crColor | COLORREF | The color used to display those pixels in the overlay bitmap with a value of 1.
uFlags | L_UINT | One or more of the following flags:
 |  | OVERLAY_AUTOPAINT | [0x00000001] Paint the overlay automatically when the bitmap is painted using the L_PaintDC functions.
 |  | OVERLAY_AUTOPROCESS | [0x00000002] Automatically adjust the overlay bitmap and position when the main bitmap is resized (zoomed in), scrolled, rotated, flipped, reversed, sheared, trimmed.
 |  | OVERLAY_USEBITPLANE | [0x00000004] the overlay has a corresponding bitplane in the main bitmap. uBitPosition is the index bitplane.
uBitPosition | L_UINT16 | Corresponding bit plane associated with an overlay. Valid only if OVERLAY_USEBITPLANE is set in uFlags. For more information about the bit position, refer to "Overlay Plane Module Attributes" in the DICOM standard.
uRows | L_UINT16 | Number of rows in the overlay. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
uColumns | L_UINT16 | Number of columns in the overlay. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
szType | L_CHAR | A null-terminated string that indicates whether this overlay represents a region of interest or other graphics. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
uBitsAllocated | L_UINT16 | Number of bits allocated in the overlay. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
szDescription | L_CHAR | NULL terminated string that contains user-defined comments about the overlay. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
szSubtype | L_CHAR | NULL terminated string that contains a defined term that identifies the intended purpose of the overlay type. For more information on possible values, refer to "Overlay Plane Module Attributes" in the DICOM standard.
szLabel | L_CHAR | NULL terminated string that contains user defined text, which may be used to label or name this overlay. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
nROIArea | L_INT32 | Number of pixels in the Region Of Interest area. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
fROIMean | L_DOUBLE | Average value of the pixels in the Region Of Interest. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
fROIStandardDeviation | L_DOUBLE | The standard deviation of the pixel values in the Region Of Interest. For more information, refer to "Overlay Plane Module Attributes" in the DICOM standard.
nNumFramesInOverlay | L_INT32 | Number of Frames in the overlay. For more information, refer to "Multi-frame Overlay Module Attributes" in the DICOM standard.
uImageFrameOrigin | L_UINT16 | The number of the frame of a multi-frame image to which this overlay applies. For more information, refer to "Multi-frame Overlay Module Attributes" in the DICOM standard.
szActivationLayer | L_CHAR | NULL terminated string that identifies the layer in which the overlay shall be displayed. For more information, refer to "Overlay/Curve Activation Module Attributes" in the DICOM standard.


PLASMAINFO

typedef struct tagPLASMAINFO
{
L_UINT uStructSize;
L_UINT uRedFreq;
L_UINT uGreenFreq;
L_UINT uBlueFreq;
L_UINT uOpacity;
L_UINT uShift;
L_UINT uSize;
L_UINT uFlags;
} PLASMAINFO, L_FAR * LPPLASMAINFO;

The PLASMAINFO structure provides information about the color to be used in the L_PlasmaFilterBitmap function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
uRedFreq | 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.
uGreenFreq | 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.
uBlueFreq | 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.
uOpacity | 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.
uShift | 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.
uSize | 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.
uFlags | 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 members (uRedFreq, uGreenFreq, uBlueFreq) of the PLASMAINFO structure to generate user-defined plasma colors.

Comments

The uOpacity value will always be considered to be 0, unless specified otherwise by a value between (and including) 0 to 100.

Use the uRedFreq, uGreenFreq, and uBlueFreq members of the PLASMAINFO structure to create a custom color pattern. To use them, pass the PLSCLR_CUST flag to L_PlasmaFilterBitmap. 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 uShift 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:


SEARCHMARKS

typedef struct tagSEARCHMARKS
{
L_UINT uStructSize;
L_UINT uType;
L_UINT uWidth;
L_UINT uHeight;
L_UINT uMinScale;
L_UINT uMaxScale;
RECT rcRect;
L_UINT uSearchMarkCount;
POINT L_FAR * pMarkDetectedPoints;
L_UINT uMarkDetectedCount;
} SEARCHMARKS, L_FAR * LPSEARCHMARKS;

The SEARCHMARKS structure provides registration marks search information to the L_SearchRegMarksBitmap function. The L_SearchRegMarksBitmap function also stores information in this structure about the registration marks that it finds.

Member | Description
uStructSize | Size of this structure.
uType | Registration mark type. Possible values are:
 | Value | Meaning
 | RGS_T | [0x0000] T-shape registration mark.
 | Currently, only one registration mark is defined (T-shape).
uWidth | Registration mark width, in pixels.
uHeight | Registration mark height, in pixels.
uMinScale | Minimum registration mark scale to be detected. This is a percentage. It must not exceed uMaxScale.
uMaxScale | Maximum registration mark scale to be detected. This is a percentage. It must not be lower than uMinScale.
rcRect | The area to be searched for registration marks (in pixels).
uSearchMarksCount | Number of registration marks expected inside the search area.
pMarkDetectedPoints | Pointer to an array which will be filled with the location points of the detected registration marks. L_SearchRegMarksBitmap will fill the first uMarkDetectedCount elements in this array.
uMarkDetectedCount | Number of detected registration marks inside the search area. This variable will be updated by L_SearchRegMarksBitmap function. This tells how many elements of the pMarkDetectedPoints array will be filled.


SELCLR

typedef struct tagSELCLR
{
L_UINT uStructSize;
SELCLRINF selClrs[9];
} SELCLR, L_FAR * pSELCLR;

The SELCLR structure contains the percentages of cyan, magenta, yellow and black that make up each of the "Selected Colors".

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
selClrs[9] | An array of 9 SELCLRINF structures. Each SELCLRINF structure contains information about a specific color.

Comments

The nine elements in the selClrs array refer to the "Selected Colors" of an image. Those 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 defines that selective color. For more information, refer to SELCLRINF.

The indexes of the array are as follows:

Index | Value | Selected Color
SELCLR_RED | 0x0000 | Red
SELCLR_YELLOW | 0x0001 | Yellow
SELCLR_GREEN | 0x0002 | Green
SELCLR_CYAN | 0x0003 | Cyan
SELCLR_BLUE | 0x0004 | Blue
SELCLR_MAGENTA | 0x0005 | Magenta
SELCLR_WHITE | 0x0006 | White
SELCLR_NEUTRAL | 0x0007 | Neutral
SELCLR_BLACK | 0x0008 | Black

This structure is used by L_SelectiveColorBitmap


SELCLRINF

typedef struct tagSELCLRINF
{
L_CHAR cCyan;
L_CHAR cMagenta;
L_CHAR cYellow;
L_CHAR cBlack;
} SELCLRINF, L_FAR * pSELCLRINF;

The SELCLRINF structure contains the information needed for a single "Selected Color", which is used mainly in the SELCLR structure.

Member | Description
cCyan | Value that specifies the percentage of cyan in a color. Valid values range from –100 to 100, which is interpreted as –100% to 100%.
cMagenta | Value that specifies the percentage of magenta in a color. Valid values range from –100 to 100, which is interpreted as –100% to 100%.
cYellow | Value that specifies the percentage of yellow in a color. Valid values range from –100 to 100, which is interpreted as –100% to 100%.
cBlack | Value that specifies the percentage of black in a color. Valid values range from –100 to 100, which is interpreted as –100% to 100%.

Comments

This structure is used by the SELCLR structure, by which is used by:

L_SelectiveColorBitmap


SLICEBITMAPOPTIONS

typedef struct_SLICEBITMAPOPTIONS
{
L_UINT uStructSize;
L_UINT uMaxDeskewAngle;
L_INT crFill;
L_INT uFlags;
} SLICEBITMAPOPTIONS, *pSLICEBITMAPOPTIONS;

The SLICEBITMAPOPTIONS structure provides information for the L_SliceBitmap function, which is used to extract individual slices from radiographic scanned film.

Member | Description
uStructSize | Size of the structure. Should be set to sizeof(SLICEBITMAPOPTIONS).
uMaxDeskewAngle | Maximum angle of deskew, in hundredths of a degree. Possible values range from 0 to 1000. (The value in degrees is uMaxDeskewAngle divided by 100). This parameter is used only if the SLC_DESKEW flag is set.
crFill | Color used to fill the background following rotation. This parameter is used only if the SLC_DESKEW flag is set.
uFlags | Flags that indicate whether to deskew the sliced bitmap, which type of interpolation to use when roating, 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 specify whether to deskew the image:
 | Value | Meaning
 | SLC_WITHOUTDESKEW | [0x0000] Do not Deskew.
 | SLC_DESKEW | [0x0001] Deskew the sliced bitmap.
 | The following flags indicate which type of interpolation to use when rotating:
 | Value | Meaning
 | DSKW_LINEAR | [0x00000000] Do not perform any interpolation methods when rotating.
 | DSKW_RESAMPLE | [0x00000010] Perform bilinear interpolation when rotating.
 | DSKW_BICUBIC | [0x00000020] Perform bicubic interpolation when rotating.
 | The following flags specify whether to cut the slice from its original image:
 | Value | Meaning
 | SLC_WITHOUTCUT | [0x00000000] Do not cut the slice from its original image. Send the NULL value to the callback pBitmap parameter.
 | SLC_CUTSLICES | [0x00000100] Cut the slice from its original image. Send a pointer to the created bitmap to the callback pBitmap parameter.


SMOOTH

typedef struct tagSMOOTH

{
L_UINT uStructSize;
L_UINT32 uFlags;
L_INT32 iLength;
pBITMAPHANDLE pBitmapRegion;
L_UINT uBitmapStructSize;
HRGN hRgn;
} SMOOTH, L_FAR *LPSMOOTH;

The SMOOTH structure provides smoothing information for the L_SmoothBitmap function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | 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 L_SmoothBitmap, if the SMOOTHCALLBACK function returns SUCCESS_REMOVE, the removed bump or nick is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the bump or nick is not added to the single region. When L_SmoothBitmap returns, either pBitmapRegion or hRgn will reference a region that contains all the removed bumps or nicks. If SMOOTH_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed bumps or nicks. If SMOOTH_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed nicks or bumps. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).
 | SMOOTH_LEAD_REGION | When L_SmoothBitmap returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed bumps or nicks. This flag must be used in conjunction with SMOOTH_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Then set uFlags to SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION. This variable will be updated when L_SmoothBitmap returns.
 | 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 | 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.
pBitmapRegion | Pointer to a variable of type BITMAPHANDLE. If SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION have been set in uFlags, then when L_SmoothBitmap returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed bumps and nicks. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION). It is the programmer's responsibility to free the region using L_FreeBitmapRgn() when it is no longer needed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion, for versioning. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When L_SmoothBitmap returns this is updated with a single windows region corresponding to all changes, only if SMOOTH_SINGLE_REGION has been set in uFlags and SMOOTH_LEAD_REGION has not been set. To use this, set the flags field to (SMOOTH_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.


SPATIALFLT

typedef struct tagSPATIALFLT
{
L_UINT uStructSize; /* size of this structure */
L_INT fltDivisor; /* sum divisor */
L_INT fltBias; /* sum bias */
L_UINT fltDim; /* filter dimensions */
L_INT fltMatrix[1]; /* array of filter coefficients */
} SPATIALFLT, L_FAR * LPSPATIALFLT;

The SPATIALFLT structure lets you design your own filter to use with the L_SpatialFilterBitmap function. Click here to view a diagram in a separate window that shows how the weights are applied in a typical Prewitt gradient directional edge enhancement operation.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use sizeof() macro to calculate this value.
fltDivisor | Number used to divide the sum of weighted values.
fltBias | Number added to the weighted average.
fltDim | Number of pixels on one side of the square (neighborhood) used for averaging. Usually an odd number such as 3 or 5 is used. If you specify an even number, the target pixel is the one northwest of the midpoint.
fltMatrix[1] | The array of weighting factors. The factors apply to pixels in the neighborhood read left to right and top to bottom (in the ABC order shown in the diagram). The weighting factors in the diagram would be specified as follows:
MyPrewitt.fltMatrix[ ] = {1, 1, 1, 1, -2, -1, 1, -1, -1} | Note that the array size is initialized as a placeholder with a value of 1. You must allocate space to hold your filter. Otherwise, you will get a stack fault.

Comments

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

It is beyond the scope of this documentation to explain how applying various weighting factors affects an image. If you specify your own filter, you should refer to a textbook on image processing. For example, Digital Image Processing: Principles and Applications, by Gregory A. Baxes.


STARINFO

typedef struct _STARINFO
{
L_UINT uStructSize;
POINT pCenter;
L_UINT uSpoke;
L_UINT uStarWidth;
L_UINT uStarHeight;
L_UINT uHoleSize;
L_INT nPhase;
L_INT nAngle;
L_INT nDistOpac;
L_INT nSpokeDiv;
L_INT nAngleOpac;
L_INT nBorderOpac;
COLORREF crFillLower;
COLORREF crFillUpper;
L_UINT uOpacity;
L_UINT uFlag;
} STARINFO, L_FAR * LPSTARINFO;

The STARINFO structure provides star information to the L_DrawStarBitmap function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
pCenter | POINT structure that contains the star center.
uSpoke | Number of spokes or rays directed inside or outside the star.
uStarWidth | Star width.
uStarHeight | Star height.
uHoleSize | 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.
nPhase | 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.
nAngle | 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.
nDistOpac | Percent of feathering in towards or outward from the spoke center. The valid range is from -100 to 100.
nSpokeDiv | The percent by which to increment or decrement the size of the low part spoke. The valid range is from -100 to 100.
nAngleOpac | Percent of feathering in towards or outward from the spoke border. The valid range is from -100 to 100.
nBorderOpac | Transparency, in percent, of the spoke border. The valid range is from -100 to 100.
crFillLower | Lower spoke side color.
crFillUpper | Upper spoke side color.
uOpacity | Transparency, in percent, between the star and the applied image. The valid range is from 0 to 100.
uFlag | 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.


STATISTICSINFO

typedef struct _STATISTICSINFO
{
L_UINT uStructSize;
L_UINT uStdDev;
L_UINT uMean;
L_UINT uMedian;
L_UINT uMax;
L_UINT uMin;
L_UINT uPixelCnt;
L_UINT uTotalPixelCnt;
L_UINT uPercent;
} STATISTICSINFO, L_FAR * LPSTATISTICSINFO;

The STATISTICSINFO structure provides the image information used in L_GetBitmapStatisticsInfo function.

Member | Description
uStructSize | Size of the structure. Should be sizeof(STATISTICSINFO).
uStdDev | Specifies the standard deviation value found. This value is divided internally by 100.
uMean | Specifies the mean value found. This value is divided internally by 100.
uMedian | Specifies the median value found.
uMax | Specifies the Maximum value found.
uMin | Specifies the Minimum value found.
uPixelCnt | Specifies the Pixel number value found.
uTotalPixelCnt | Specifies the whole image Pixel number value found.
uPercent | Specifies the percent value of selected pixel to the whole pixels in the image, in hundredths of percent. This value is divided internally by 100.


USERFLT

typedef struct tagUSERFLT
{
L_UINT uStructSize;
L_UINT ufltWidth;
L_UINT ufltHeight;
POINT ufltCenter;
L_UINT ufltDivisor;
L_INT nfltOffset;
L_UINT ufltFlag;
L_INT ufltMatrix[1];
} USERFLT, L_FAR * LPUSERFLT;

Member | Description
uStructSize | Size of the USERFLT structure. Should be set to sizeof(USERFLT).
ufltWidth | Number of columns in the user-defined array (mask).
ufltHeight | Number of rows in the user-defined array (mask).
ufltCenter | A POINT structure that contains a two-dimensional position in the array (ufltMatrix), to be used as the matrix (mask)center.
ufltDivisor | Value used to divide the final result of the output. This must be a non-zero value. If you want 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).
nfltOffset | Value used to offset the final result of the output.
ufltFlag | The type of operation. These flags cannot be or-ed together.
 | Value | Meaning
 | UD_SUM | [0x0000] Perform sum operation.
 | UD_MAX | [0x0001] Perform maximum operation.
 | UD_MIN | [0x0002] Perform minimum operation.
ufltMatrix | Array of (ufltWidth * ufltHeight) integers containing the user-defined matrix (mask). The elements are stored in row order (first row, second row, etc).


VIGNETTEINFO

typedef struct_tagVIGNETTEINFO
{
L_UINT uStructSize;
POINT ptCenter;
L_INT nFading;
L_UINT uFadingRate;
L_UINT uWidth;
L_UINT uHeight;
COLORREF crVigColor;
L_UINT uFlags;
}VIGNETTEINFO, L_FAR * LPVIGNETTEINFO;

The VIGNETTEINFO structure provides the information needed for the L_VignetteBitmap function.

Member | Description
uStructSize | Size of this structure, in bytes. Use the sizeof operator to calculate this value.
ptCenter | Center point for all vignette objects (circle, ellipse, rectangle, and square).
nFading | 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. Possible values range from -100 to 100.
uFadingRate | Value that indicates the fading rate. This value is used to controlling the fading process. It will be divided by 100 internally. The valid range is from 0 to 100.
uWidth | Value that indicates the dimension of the vignette object in pixels.
 | Vignette Shape | uWidth Indication
 | Square | Square width
 | Rectangle | Rectangle width
 | Circle | Circle radius
 | Ellipse | Ellipse width
uHeight | 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 selected.
crVigColor | The COLORREF value that specifies the vignette object color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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.


ZOOMVIEWPROPS (Document/Medical only)

typedef struct tagZOOMVIEWPROPS
{
L_UINT uStructSize;
L_UINT uIndex;
RECT rcSrc;
RECT rcDst;
RECT rcView;
L_INT nZoom;
L_BOOL bForceDst;
L_BOOL bEnabled;
L_UINT 32 uZoomViewBorderStyle;
COLORREF crZoomViewBorder;
L_INT nZoomViewPenStyle;
HRGN hBorderRgn;
L_UINT 32 uSrcBorderStyle;
COLORREF crSrcBorder;
L_INT nSrcPenStyle;
L_BOOL bCallouts;
COLORREF crCallout;
L_INT nCalloutPenStyle;
HANNOBJECT hAnnContainer;
} ZOOMVIEWPROPS, L_FAR * pZOOMVIEWPROPS;

The ZOOMVIEWPROPS structure provides information to the L_CreateZoomView function which is used to create a Zoom View, the L_UpdateZoomView which updates a zoomed view, and the L_GetZoomViewProps function which retrieves the properties for a zoomed view.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof(ZOOMVIEWPROPS).macro to calculate this value. This must be set before passing this structure to the LEADTOOLS functions.
uIndex | Index of this Zoom View. This index is zero-based. This member is updated by the L_CreateZoomView and the L_DestroyZoomView functions. Set this value before calling the L_GetZoomViewProps or the L_UpdateZoomView functions.
rcSrc | Rectangle describing the source area of the image to be zoomed, in bitmap coordinates.The values describing this rectangle must be multiplied by 100.
rcDst | Rectangle describing the location on the display of the zoomed view, in screen coordinates. By default, only the TOP_LEFT is used. The values describing this rectangle must be multiplied by 100.
rcView | Pointer to the Windows RECT structure that determines how pBitmap is positioned in the device context. The coordinates in the RECT structure are relative to the device context. You must specify the RECT structure. The values describing this rectangle must be multiplied by 100.
nZoom | The percentage zoom factor for the zoomed view; 100 = no zoom. Value must be >= 100.
bForceDst | Flag that indicates whether the zoomed view should be forced to be the size of rcDst.
 | Value | Meaning
 | TRUE | Force the zoomed view to the size of rcDst.
 | FALSE | Allow LEADTOOLS to calculate the size based on nZoom and rcSrc. The top and left values of rcDst are used for positioning.
bEnabled | Flag that indicates whether the zoomed view is enabled. If the zoomed view is not enabled, then it will not be displayed.
 | Value | Meaning
 | TRUE | The zoomed view is enabled.
 | FALSE | The zoomed view will not be displayed.

uZoomViewBorderStyle | Value that indicates which border style is to be used for the Zoom View. Possible values are:
 | Value | Meaning
 | ZOOMVIEWBORDERSTYLE_NONE | [0x0000] Do not use a border for the Zoom View.
 | ZOOMVIEWBORDERSTYLE_SIMPLE | [0x0001] Use a flat border for a rectangular or Rounded rectangular Zoom View.
 | ZOOMVIEWBORDERSTYLE_3D | [0x0002] Use a 3D border for a rectangular Zoom View.
 | ZOOMVIEWBORDERSTYLE_TEAROUT | [0x0004] Use a border that has a Torn out look for the Zoom View.
 | ZOOMVIEWBORDERSTYLE_ROUNDED | [0x0008] Use a rounded rectangular border for the Zoom View. This can be OR-ed with ZOOMVIEWBORDERSTYLE_NONE or ZOOMVIEWBORDERSTYLE_SIMPLE.
crZoomViewBorder | A COLORREF color that indicates the color of the border of the Zoom View. This member can only be used when uZoomViewBorderStyle is ZOOMVIEWBORDERSTYLE_SIMPLE.
nZoomViewPenStyle | A value that indicates the Pen style to be used for the Zoom View Border. This value is only used when uZoomViewBorderStyle is ZOOMVIEWBORDERSTYLE_SIMPLE. These are the same values as the ones used in the CreatePen Windows GDI function, like PS_SOLID or PS_DASH. For more information, refer to the Windows GDI section on MSDN.
hBorderRgn | Reserved for future use.
uSrcBorderStyle | Value that indicates which border style is to be used on the Source Rectangle. Possible values are:
 | Value | Meaning
 | SOURCEBORDERSTYLE_SIMPLE | [0x0000] Use a flat border on the Source Rectangle.
 | SOURCEBORDERSTYLE_3D | [0x0001] Use a 3D border on the Source Rectangle.

crSrcBorder

COLORREF value that indicates the color of the border on the Source Rectangle. This value is only used when uSrcBorderStyle is SOURCEBORDERSTYLE_SIMPLE.

nSrcPenStyle

A value that indicates the Pen style to be used on the Source Rectangle for the Zoom View. This value is only used when uSrcBorderStyle is SOURCEBORDERSTYLE_SIMPLE.

These are the same values as the ones used in the CreatePen Windows GDI function, such as PS_SOLID or PS_DASH. For more information, refer to the Windows GDI section on MSDN.

bCallouts

Flag that indicates whether to enable callout lines.

Value

Meaning

TRUE

Enable callout lines for the zoomed view.

FALSE

Disable callout lines for the zoomed view.

crCallout

COLORREF value that indicates the color of the callout lines. This member is ignored when bCallouts is set to FALSE.

nCalloutPenStyle

A value that indicates the Pen style to be used for connected Source and Destination rectangles for the Zoom View. This value is ignored when bCallouts is set to FALSE.

These are the same values as the ones used in the CreatePen Windows GDI function, such as PS_SOLID or PS_DASH. For more information, refer to the Windows GDI section on MSDN.

hAnnContainer

Handle to the root container object of an annotation object to be displayed. If NULL, no annotation will be displayed in the zoom view.


LILCLICK

typedef struct _LILCLICK
{

L_UINT uStructSize;
HWND hWnd;
L_INT xPos;
L_INT yPos;
} LILCLICK, L_FAR* pLILCLICK;

The LILCLICK structure contains information pertaining to a click event.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hWnd | Window handle for the control.
xPos | X coordinate of the cursor position.
yPos | Y coordinate of the cursor position.

Comments

This structure is used by the L_ILN_CLICKED and L_ILN_DBLCLCK command notifications.


LILEXPORTBITMAPLIST

typedef struct _LILEXPORTBITMAPLIST
{
L_UINT uStructSize;
HBITMAPLIST hList;
L_INT nStartIndex;
L_INT nItemsToExport;
} LILEXPORTBITMAPLIST, L_FAR* pLILEXPORTBITMAPLIST;

The LILEXPORTBITMAPLIST structure contains information about the list of bitmaps to be exported from an ImageList control.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hList | Handle to the bitmap list to be updated by the exported bitmaps.
 | If you passed NULL into this member to L_ILM_EXPORTBITMAPLIST message, it will be created internally and is going to contain all the exported bitmaps.
nStartIndex | Index of the first bitmap in the ImageList control to be exported.
nItemsToExport | Number of bitmaps to be exported starting from nStartIndex. Note: (nStartIndex + nItemsToInsert) should not exceed number of items in the ImageList Control.

Comments

This structure is used by the L_ILM_EXPORTBITMAPLIST message.

After calling L_ILM_EXPORTBITMAPLIST message and exporting the list of bitmaps successfully from the ImageList control, don’t try to free the bitmaps of the exported list hList, since it is going to have a reference to the original bitmaps not a copy of them.


LILIMPORTBITMAPLIST

typedef struct _LILIMPORTBITMAPLIST
{
L_UINT uStructSize;
HBITMAPLIST hList;
L_INT nStartIndex;
L_INT nItemsToInsert;
L_TCHAR L_FAR* pText;
L_TCHAR L_FAR* pTextExt;
} LILIMPORTBITMAPLIST, L_FAR* pLILIMPORTBITMAPLIST;

The LILIMPORTBITMAPLIST structure contains the list of bitmaps to be imported (inserted) into an ImageList Control with information about the start index and number of bitmaps to import (insert).

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hList | Handle to the bitmap list that contains the bitmaps to be imported in the Image List control.
nStartIndex | Index of the first bitmap in the hList to be imported..
nItemsToInsert | Number of bitmaps to be imported, starting from nStartIndex. Note: (nStartIndex + nItemsToInsert) should not exceed the number of bitmaps in the hList member.
pText | Character string that contains the text for the bitmaps to be imported.
pTextExt | Character string that contains the extra text for the bitmaps to be imported.

Comments

This structure is used by the L_ILM_IMPORTBITMAPLIST message.


LILDRAWITEM

typedef struct _LILDRAWITEM
{
L_UINT uStructSize;
UINT uID;
HWND hWnd;
HDC hDC;
RECT rcItem;
RECT rcItemBack;
pLILITEM pItem;
} LILDRAWITEM, L_FAR* pLILDRAWITEM;

The LILDRAWITEM structure contains information about a specific item to be drawn/painted in the ImageList control's parent window.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uID | Control ID.
hWnd | Window handle of the control.
hDC | Device context for output.
rcItem | RECT structure that contains the location of the item to draw/paint.
rcItemBack | RECT structure that contains the background of the item to draw/paint.
pItem | Pointer to the structure that contains the item to draw/paint.

Comments

This structure is used by the L_ILM_DRAWITEM message.


LILITEM

typedef struct _LILITEM
{
L_UINT uStructSize;
L_UINT32 uMask;
pBITMAPHANDLE pBitmap;
L_UINT uBitmapStructSize;
L_TCHAR L_FAR* pText;
L_INT32 lData;
L_BOOL bSelected;
L_INT32 lIndex; /* index of the item */
L_TCHAR L_FAR* pTextExt; /* the item's extended text */
} LILITEM, L_FAR* pLILITEM;

The LILITEM structure contains information about a specific item in the image list.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uMask | Mask for getting and setting the item.
pBitmap | Pointer to a bitmap handle that references the item’s bitmap.
uBitmapStructSize | Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pText | Character string that contains the item’s text.
lData | Item’s user data.
bSelected | Flag that indicates whether or not the item is selected. Possible values are:
 | Value | Meaning
 | TRUE | The item is selected.
 | FALSE | The item is not selected.
lIndex | Index of the specified item. This index is zero-based.
pTextExt | Character string that contains the item’s extra text.

Comments

lIndex is filled by L_ILM_GETITEM and L_ILM_GETSELITEMS messages.

Possible values for uMask are:

Value | Meaning
LILITEM_BITMAP | [0x01] Get/set the bitmap.
LILITEM_TEXT | [0x02] Get/set the text.
LILITEM_DATA | [0x04] Get/set the data.
LILITEM_SELECTED | [0x08] Get/set the selected flag.
LILITEM_TEXTEXT | [0x10] Get/set the extra text.

This structure is also used by the L_ILM_INSERT, L_ILM_INSERTAT, L_ILM_SETITEM and L_ILM_SETSELOPTIONS messages.

pTextExt can be used to store an extra text string for the item. For example, you can store the filename in pText (which gets displayed in the control), and the fully qualified path and filename in pTextExt.


LILITEMOPTIONS

typedef struct _LILITEMOPTION
{
L_UINT uStructSize;
L_UINT uVerticalSpacing;
L_UINT uHorizontalSpacing;
L_UINT uWidth;
L_UINT uHeight;
COLORREF crBackground;
L_BOOL bDisplayItemText;
COLORREF crForeground;
HFONT hFont;
} LILITEMOPTION, L_FAR* pLILITEMOPTION;

The LILITEMOPTIONS structure contains information about item options.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uVerticalSpacing | Vertical spacing between items. The unit of measure is pixels.
uHorizontalSpacing | Horizontal spacing between items. The unit of measure is pixels.
uWidth | Width of the item in pixels.
uHeight | Height of the item in pixels.
crBackground | Background color for the item.
bDisplayItemText | Flag that indicates whether or not to display the item’s text. Possible values are:
 | Value | Meaning
 | TRUE | Display the item’s text.
 | FALSE | Do not display the item’s text
crForeground | Color for the item’s text.
hFont | Handle to the font to use for the item’s text.

Comments

The following are default values:

uVerticalSpacing | 5
uHorizontalSpacing | 5
uWidth | 80
uHeight | 80
crBackground | RGB(0,0,0)
bDisplayItemText | TRUE
crForeground | RGB(0,0,0)
hFont | NULL

This structure is used by the L_ILM_GETITEMOPTIONS and L_ILM_SETITEMOPTIONS messages.


LILITEMSEL

typedef struct _LILITEMSEL
{
L_UINT uStructSize;
HWND hWnd ;
L_INT32 lItem;
} LILITEMSEL, L_FAR* pLILITEMSEL;

The LILITEMSEL contains information about the selected item.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hWnd | Window handle for the control.
lItem | Index of the selected item.

Comments

This structure is used by the L_ILM_ITEMSELECTED message and the L_ILN_ITEMSEL command notification.


LILKEYDOWN

typedef struct _LILKEYDOWN
{
L_UINT uStructSize;
WORD wVKey;
L_UINT flags;
} LILKEYDOWN, L_FAR* pLILKEYDOWN;

The LILKEYDOWN structure contains information pertaining to a key down event.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
wVKey | Virtual key code indicating the key that is down.
flags | Always 0.

Comments

This structure is used by the L_ILN_KEYDOWN command notification.


LILSELOPTION

typedef struct _LILSELOPTION
{
L_UINT uStructSize;
L_UINT uAllowSelection;
L_UINT uSelectionStyle;
COLORREF crSelection;
} LILSELOPTION, L_FAR* pLILSELOPTION;

The LILSELOPTION structure contains information about selection options.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uAllowSelection | Item selection state. Possible values are:
 | Value | Meaning
 | ALLOWSELECTION_NONE | [0] no automatic item selection
 | ALLOWSELECTION_SINGLE | [1] automatic selection of single items
 | ALLOWSELECTION_MULTI | [2] automatic selection of multiple items
uSelectionStyle | Style used for displaying selected items. Possible values are:
 | Value | Meaning
 | SELECTIONSTYLE_SELECTCOLOR | 0
 | SELECTIONSTYLE_PRESSEDBUTTON | 1
 | SELECTIONSTYLE_USERBITMAP | 2
crSelection | The selection color.

Comments

This structure is used by the L_ILM_GETSELOPTIONS and L_ILM_SETSELOPTIONS messages.


LILSORTOPTIONS

typedef struct _LILSORTOPTIONS
{
L_UINT uStructSize;
L_BOOL bAscending;
L_BOOL bCaseSensitive;
L_BOOL bUseExtText;
L_UINT32 uFlags;

} LILSORTOPTIONS, L_FAR* pLILSORTOPTIONS;

The LILSORTOPTIONS structure contains information about the Extended Sorting options.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
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 | 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 with case sensitivity.
 | FALSE | Sort the items in the ImageList Control with case insensitivity.
bUseExtText | Flag that indicates whether to sort the items in the ImageList Control based on their pTextExt attribute,. referenced in the pTextExt member of the LILITEM structure. Possible values are:
 | Value | Meaning
 | TRUE | Sort the items in the ImageList Control based on their pTextExt attribute.
 | FALSE | Sort the items in the ImageList Control based on their pText attribute referenced in the pText member of the LILITEM structure.
uFlags | Reserved for future use. Pass 0.

Comments

This structure is used by the L_ILM_SORTEXT message.


HBITMAPLIST

LEADTOOLS has defined the following data types for referencing a list of bitmaps:

Data Type | Definition and Usage
HBITMAPLIST | Defined as HANDLE; used as a handle to a list of bitmaps.
pHBITMAPLIST | Defined as HBITMAPLIST L_FAR *; used as a pointer to an HBITMAPLIST variable.


HPLAYBACK

LEADTOOLS has defined the following data types for referencing an animation playback handle:

Data Type | Definition and Usage
HPLAYBACK | Defined as HANDLE; used as an animation playback handle.
pHPLAYBACK | Defined as HPLAYBACK L_FAR *; used as a pointer to an HPLAYBACK variable.


RGNXFORM (Document/Medical only)

RGNXFORM

typedef struct _RGNXFORM
{
L_UINT uViewPerspective;
L_INT nXScalarNum;
L_INT nXScalarDen;
L_INT nYScalarNum;
L_INT nYScalarDen;
L_INT nXOffset;
L_INT nYOffset;
} RGNXFORM, L_FAR *pRGNXFORM;

The RGNXFORM structure provides data for translating between region coordinates and external representations of those coordinates.

Member | Description
uViewPerspective | The view perspective of the external representation. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, TOP_LEFT270, BOTTOM_LEFT180, TOP_LEFT180, LEFT_TOP, BOTTOM_LEFT90, RIGHT_BOTTOM, and BOTTOM_LEFT270. For descriptions, refer to Accounting for View Perspective.
nXScalarNum | The numerator for the X scaling factor.
nXScalarDen | The denominator for the X scaling factor.
nYScalarNum | The numerator for the Y scaling factor.
nYScalarDen | The denominator for the Y scaling factor.
nXOffset | The X offset of the external representation.
nYOffset | The Y offset of the external representation.

Comments

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

All region functions accept a NULL pointer for this structure. In that case, no transformation occurs. The scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.

Several of the LEADTOOLS functions for creating and working with a bitmap region use coordinates from an external representation of the region, such as a shape drawn in a device context.

To compensate for possible differences in view perspective, scaling, and display offsets, these LEADTOOLS functions require that you provide translation information in an RGNXFORM structure.

This topic provides a general description of how fields in the structure work. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

When assigning an external representation to a bitmap (pointed to by pBitmap), every point (Xa, Ya) in the an external representation is transformed (by structure XForm) to point (Xc, Yc) in the bitmap's region as follows:

1.

Add offsets:

Xb = Xa + XForm.nXOffset
Yb = Ya + XForm.nYOffset

2.

Multiply by scalars:

Xc = (Xb * XForm.nXScalarNum) / XForm.nXScalarDen
Yc = (Yb * XForm.nYScalarNum) / XForm.nYScalarDen

3.

Compensate for view perspective (updating Xc and Yc in place):

L_PointToBitmap(pBitmap, XForm.uViewPerspective, Xc, Yc)

When retrieving an external representation from a bitmap (pointed to by pBitmap), every point (Xa, Ya) in the bitmap's region is transformed (by structure Xform) to point (Xc, Yc) in the external region as follows:

1.

Compensate for view perspective (updating Xa and Ya in place):

L_PointFromBitmap(pBitmap, XForm.uViewPerspective, Xa, Ya)

2.

Mulitply by scalars:

Xb = (Xa * XForm.nXScalarNum) / XForm.nXScalarDen
Yb = (Ya * XForm.nYScalarNum) / XForm.nYScalarDen

3.

Add offsets:

Xc = Xb + XForm.nXOffset
Yc = Yb + XForm.nYOffset


LEADBITMAPCOLORRES

typedef struct tagLEADBITMAPCOLORRES
{
L_UINT uStructSize;
L_INT BitsPerPixel;
L_UINT32 Flags;
LPRGBQUAD pPalette;
L_UINT Colors;
} LEADBITMAPCOLORRES, far * pLEADBITMAPCOLORRES;

The LEADBITMAPCOLORRES structure provides information in the L_BM_COLORRES message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
BitsPerPixel | The number of bits per pixel to increase or decrease the bitmap to. Valid values are 1, 4, 8, 16, 24, and 32.
Flags | Indicator of the color order or palette usage. Refer to Possible Flag Values .
pPalette | The palette to use if the CRF_USERPALETTE is specified in the Flags field.
 | This is an array of RGBQUAD values. For each item in the array do one of the following:
 | Enter the actual RGBQUAD value to specify a fixed color.
 | Enter RGB_RESERVED to Leave the item blank, for possible later use.
 | Enter RGB_EMPTY to let LEADTOOLS fill in the color. LEADTOOLS supplies optimized colors to fill the RGB_EMPTY items.
 | If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL.
Colors | The number of colors in the palette specified by the pPalette field.
 | If CRF_USERPALETTE is not specified in the Flags field, this field should be NULL

Comments

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


LEADBITMAPFOCUSEDZOOM

typedef struct tagLEADBITMAPFFOCUSEDZOOM
{
L_UINT uStructSize;
L_UINT Factor;
L_BOOL Center;
L_INT XFocus;
L_INT YFocus;
} LEADBITMAPFOCUSEDZOOM, L_FAR * pLEADBITMAPFOCUSEDZOOM;

The LEADBITMAPFOCUSEDZOOM structure provides information in the L_BM_FOCUSEDZOOM message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Factor | The percentage scale factor. A value of 100 means no zooming.
Center | TRUE for centering on the current mouse position, or FALSE for maintaining the current display offsets.
XFocus | The horizontal mouse coordinate.
YFocus | The vertical mouse coordinate.

Comments

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


LEADBITMAPINFO

typedef struct tagLEADBITMAPINFO
{
L_UINT uStructSize;
L_INT Width;
L_INT Height;
L_INT Pixels;
} LEADBITMAPINFO, L_FAR * pLEADBITMAPINFO;

The LEADBITMAPINFO structure provides information in the L_BM_INFO message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Width | Width of the image in pixels.
Height | Height of the image in pixels.
Pixels | Number of bits per pixel.

Comments

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


LEADBITMAPLOAD

typedef struct tagLEADBITMAPLOAD
{
L_UINT uStructSize;
L_TCHAR Name[L_MAXPATH];
pLOADFILEOPTION pOptions;
} LEADBITMAPLOAD, L_FAR * pLEADBITMAPLOAD;

The LEADBITMAPLOAD structure provides information in the L_BM_LOAD message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Name | An array of length L_MAXPATH that contains the full path name of the file to load.
pOptions | Pointer to optional load options.

Comments

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


LEADBITMAPPRINT

typedef struct tagLEADBITMAPPRINT
{
L_UINT uStructSize;
HDC hDC;
L_INT nXPos;
L_INT nYPos;
L_INT nXSize;
L_INT nYSize;
L_BOOL fEndDoc;
} LEADBITMAPPRINT, L_FAR * pLEADBITMAPPRINT;

The LEADBITMAPPRINT structure provides information in the L_BM_PRINT message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hDC | Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT.
nXPos | X position to start the print. Pass a 0 to center the image horizontally on the page.
nYPos | Y position to start the print. Pass a 0 to center the image vertically on the page.
nXSize | The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.
 | Pass a 0 to let LEADTOOLS calculate the width. If you specify only the width or only the height, LEADTOOLS calculates the remaining dimension. If you pass zeros for both width and height, LEADTOOLS calculates the maximum dimensions that fit on the page while preserving the aspect ratio.
nYSize | The printed height. The value is in dots, and the actual height depends on the dots per inch (DPI) of the printer.
 | Pass a 0 to let LEADTOOLS calculate the height. If you specify only the width or only the height, LEADTOOLS calculates the remaining dimension. If you pass zeros for both width and height, LEADTOOLS calculates the maximum dimensions that fit on the page while preserving the aspect ratio.
fEndDoc | This is used to let LEADTOOLS know whether you plan to print another image on the same page or not.

Comments

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


LEADBITMAPSAVE

typedef struct tagLEADBITMAPSAVE
{
L_UINT uStructSize;
L_TCHAR Name[L_MAXPATH];
L_INT Format;
L_INT QFactor;
L_INT BitsPerPixel;
pSAVEFILEOPTION pOptions;
} LEADBITMAPSAVE, L_FAR * pLEADBITMAPSAVE;

The LEADBITMAPSAVE structure provides information in the L_BM_SAVE message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Name | An array of length L_MAXPATH that holds the full path and name of the file to save.
Format | The format of the file to save. For valid values, refer to Formats of Output Files.
QFactor | The Q factor to be used if the image is saved as a compressed file. The value can range from 2 to 255 for any of the LEAD, JTIF, or JFIF compression types. For additional valid values, refer to Compression Quality Factors.
BitsPerPixel | Number of bits per pixel. For valid values, refer to Formats of Output Files.
pOptions | Pointer to optional save options.

Comments

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


LEADBITMAPSHEAR

typedef struct tagLEADBITMAPSHEAR
{
L_UINT uStructSize;
L_INT nAngle;
L_BOOL fHorizontal;
COLORREF crFill;
} LEADBITMAPSHEAR, L_FAR * pLEADBITMAPSHEAR;

The LEADBITMAPSHEAR structure provides information in the L_BM_SHEAR message.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nAngle | The angle of slant. Positive values are for clockwise angles; negative values are for counterclockwise angles.
fHorizontal | TRUE for horizontal shear, or FALSE for vertical shear.
crFill | The COLORREF value that specifies the fill color. You can assign the value using the Windows RGB macro.

Comments

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


ADDBORDERINFO

typedef struct _ADDBORDERINFO
{
L_UINT uStructSize;
L_INT nLeftThickness;
L_INT nTopThickness;
L_INT nRightThickness;
L_INT nBottomThickness;
L_INT nLocation;
L_INT nStyle;
L_INT nEffectStyle;
pBITMAPHANDLE pTileBitmap;
L_INT nGradientStyle;
COLORREF crGradientStart;
COLORREF crGradientEnd;
L_INT nCurveIntensity;
L_BOOL bSoftCurve;
L_BOOL bShadow;
L_INT nShadowSize;
L_INT nShadowDirection;
L_BOOL bBumpyShadow;
} ADDBORDERINFO, L_FAR * LPADDBORDERINFO;

The ADDBORDERINFO structure contains information about the border to add to the bitmap.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nLeftThickness | The thickness of the left side of the border.
nTopThickness | The thickness of the top side of the border.
nRightThickness | The thickness of the right side of the border.
nBottomThickness | The thickness of the bottom side of the border.
nLocation | Flag that indicates the position of the border. Possible values are:
 | Value | Meaning
 | BORDER_INSIDE | [0] The border will be within the bitmap. This is the default.
 | BORDER_OUTSIDE | [1] The border will be outside the bitmap.
nStyle | 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. This is the default.
 | 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 pTileBitmap member.
nEffectStyle | 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 nCurveIntesity. 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.
pTileBitmap | Pointer to a bitmap handle that references the tile bitmap. This is the bitmap the border is taken from when nStyle is BORDER_STYLE_TILES.
nGradientStyle | Flag that indicates the gradient style. This flag is used only when the nStyle member 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. This is the default.
 | 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.
crGradientStart | COLORREF value that specified the starting color when nStyle is BORDER_STYLE_GRADIENT. This is also the color used when nStyle is BORDER_STYLE_OPAQUE.
crGradientEnd | COLORREF value that specified the ending color when nStyle is BORDER_STYLE_GRADIENT.
nCurveIntensity | Value that indicates the degree to which to change the appearance of the border. This value is used only when the nEffectStyle flag is set. The range is from –1000 to 1000.

bSoftCurve | Boolean flag that indicates whether to give the border a soft curve appearance. This flag is used only when nEffectStyle 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.
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. This is the default.

nShadowSize | Value that indicates the width of the shadow, in pixels. This value is used only when bShadow is TRUE.
nShadowDirection | 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. This is the default.
 | BORDER_SHADOW_RIGHT | [1] The shadow is on the right bottom side of the image.
 | BORDER_SHADOW_SURROUND | [2] The shadow surrounds the border.

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.

Comments

LPADDBORDERINFO is a pointer to a ADDBORDERINFO structure. Where a function parameter type is LPADDBORDERINFO, declare an ADDBORDERINFO variable and pass the variable's address in the parameter. Declaring an LPADDBORDERINFO variable is necessary only if the program requires a pointer.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

The images below demonstrate some of the borders that are possible, by setting various members and flags.

nStyle = BORDER_STYLE_OPAQUE

nStyle = BORDER_STYLE_OPAQUE

nEffectStyle = BORDER_EFFECT_CURVEDIN

nCurveIntesity = 200

nStyle = BORDER_STYLE_OPAQUE

nEffectStyle = BORDER_EFFECT_CURVEDOUT

nCurveIntesity = 200

nStyle = BORDER_STYLE_OPAQUE

nEffectStyle = BORDER_EFFECT_RAISED

nCurveIntesity = 100

nStyle = BORDER_STYLE_OPAQUE

nEffectStyle = BORDER_EFFECT_RAISED

nCurveIntesity = 100

bSoftCurve = TRUE

nStyle = BORDER_STYLE_GRADIENT

nGradientStyle = BORDER_GRAD_INSIDEOUT

crGradientStart = RGB(255, 0, 0)

crGradientEnd = RGB(0, 0, 255)

nStyle = BORDER_STYLE_GRADIENT

nGradientStyle = BORDER_GRAD_CENTEROUT

crGradientStart = RGB(255, 0, 0)

crGradientEnd = RGB(0, 0, 255)

nStyle = BORDER_STYLE_GRADIENT

nGradientStyle = BORDER_GRAD_CORNEROUT

crGradientStart = RGB(255, 0, 0)

crGradientEnd = RGB(0, 0, 255)

nBorderLocation = BORDER_OUTSIDE

nStyle = BORDER_STYLE_OPAQUE

bShadow = TRUE

nShadowSize = 5

bBumpyShadow = TRUE

nShadowDirection = BORDER_SHADOW_SURROUND


ADDFRAMEINFO

typedef struct _ADDFRAMEINFO
{
L_UINT uStructSize;
pBITMAPHANDLE pBitmapFrame;
L_BOOL bKeepFrameState;
L_BOOL bUseMask;
COLORREF crMask;
BYTE SmoothEdge;
L_INT nLocation;
L_INT nQuality;
} ADDFRAMEINFO, L_FAR * LPADDFRAMEINFO;

The ADDFRAMEINFO structure contains information about the frame to add to the bitmap.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
pBitmapFrame | Pointer to a bitmap handle that references the frame bitmap.
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 L_AddFrame function. This is the default value.
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. This is the default value.

crMask | COLORREF value used to specify the region on the frame bitmap, in which to put the bitmap. This value is used only if the bUseMask member is TRUE. The default value is black.
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 member is FALSE. The default value is 0.
nLocation | 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. This is the default.
 | FRAME_OUTSIDE | [1] The frame will be outside the original bitmap.
nQuality | 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.

Comments

This structure is used by the L_AddFrame function.


BALANCING

typedef struct tagBALANCING
{
L_UINT uStructSize;
L_DOUBLE toRed;
L_DOUBLE toGreen;
L_DOUBLE toBlue;
} BALANCING, L_FAR *pBALANCING;

The BALANCING structure provides color balancing information to the L_BalanceColors function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use sizeof() macro to calculate this value.
toRed | 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.
toGreen | 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.
toBlue | 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.

Comments

If a BALANCING structure used to redistribute the red value of a pixel contains the following values:

toRed = 0.50

toGreen = 0.50

toBlue = 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. For a more detailed description of how this works, refer to L_BalanceColors.


CODBLOCKSTYLE

typedef struct _CodBlockStyle
{
L_BITFIELD bSelective_AC_Bypass;
L_BITFIELD bResetContextOnBoundaries;
L_BITFIELD bTerminationOnEachPass;
L_BITFIELD bVerticallyCausalContext;
L_BITFIELD bPredictableTermination;
L_BITFIELD bErrorResilienceSymbol;
L_BITFIELD bReserved6:26;
} CodBlockStyle;

The CODBLOCKSTYLE structure provides a series of bit flags that indicate the behavior of the code blocks.

Member | Description
bSelective_AC_Bypass | TRUE if the "lazy coding mode" is adopted. In this case, trailing bit-planes bypass the arithmetic coder except in the normalization pass. Otherwise, the arithmetic coder is used on all passes.
bResetContextOnBoundaries | TRUE if 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.
bTerminationOnEachPass | TRUE if the arithmetic code-word generation process stops on a byte boundary at the end of each coding pass.
bVerticallyCausalContext | TRUE if the context models are restricted to being vertically causal within each sub-block.
bPredictableTermination | TRUE if 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.
bErrorResilienceSymbol | TRUE if a 4 symbol marker is included for each bit-plane, following the normalization pass.
bReserved6:26 | Reserved for future use.


DECOMPRESSDATA

typedef struct _DECOMPRESSDATA
{
L_UINT uStructSize;
L_UCHAR * pBuffer;
L_INT nWidth;
L_INT nHeight;
L_UINT32 uOffset;
L_INT nBufferSize;
L_INT nRow;
L_INT nCol;
L_UINT uFlags;
} DECOMPRESSDATA, L_FAR * LPDECOMPRESSDATA;

The DECOMPRESSDATA structure provides decompression to the L_DecompressBuffer function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
pBuffer | Pointer to the raw compressed data.
nWidth | Width of the uncompressed strip or tile, in bytes.
nHeight | Height of the uncompressed strip or tile, in bytes. If the image consists of a single compressed strip, as with TWAIN, this is the height of the image.
uOffset | Offset of the strip, relative to the buffer. This is usually zero.
nBufferSize | Size of the strip before decompression. For TWAIN, this is the buffer size determined by DAT_SETUPMEMXFER.
nRow | Row offset of the tile or strip.
nCol | Column offset of the tile or strip.
uFlags | Flags that indicate whether which part of a strip or tile is being processed. Possible values are:
 | Value | Meaning
 | DECOMPRESS_STRIP_START | Processing the beginning of a tile or strip.
 | DECOMPRESS_STRIP_END | Processing the end of a tile or strip.
 | DECOMPRESS_CHUNK_COMPLETE | Process a complete tile or strip. This is the same as DECOMPRESS_STRIP_START | DECOMPRESS_STRIP_END.
uReserved1 | Reserved for future use. Pass 0.

Comments

If pBuffer does not point to a full tile or strip, set uFlags to DECOMPRESS_STRIP_START when the tile/strip begins and set it to DECOPMRESS_STRIP_END when the tile/strip ends.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


DIMENSION

typedef struct _DIMENSION
{
L_UINT32 nWidth;
L_UINT32 nHeight;
} DIMENSION, L_FAR * pDIMENSION;

The DIMENSION structure is used with the L_ReadLoadResolutions function, which tests for available resolutions in a specified PhotoCD or FlashPix file.

Member | Description
nWidth | Width, in pixels, of the available resolution.
nHeight | Height, in pixels, of the available resolution.

Comments

pDIMENSION is a pointer to a DIMENSION structure. With the L_ReadLoadResolutions function, you declare an array of DIMENSION structures and declare a pDIMENSION pointer to the array. Then, in the function call, you pass the pointer, and the function updates the DIMENSION structures in the array.


EXTENSION

typedef struct tagEXTENSION
{
LPWSTR pName;
L_UINT32 uDataSize;
L_UCHAR L_FAR * pData;
LPCLSID pClsid;
L_UCHAR ucDefault;
} EXTENSION, L_FAR * pEXTENSION;

The EXTENSION structure contains Exif extension information.

Member | Description
pName | String that contains the name of the extension. As Unicode, 2 bytes per character.
uDataSize | Size of the extension data. If the extension data is a stream, this value should be 0xFFFFFFFF.
pData | Pointer to the extension data. If the extension data is a stream, this parameter is NULL.
pClsid | CLSID that describes the extension data. This is valid only if uDataSize is 0xFFFFFFFF.
ucDefault | Reserved for internal use.

Comments

For more information on these structure members and their use, refer to the Exif documentation for the "FlashPix" extensions, inside the APP2 markers.


EXTENSIONLIST

typedef struct _tagEXTENSIONLIST
{
L_UINT uStructSize;
L_UINT uFlags;
L_UINT uCount;
EXTENSION aList[1];
} EXTENSIONLIST, L_FAR * LPEXTENSIONLIST;

The EXTENSIONLIST structure contains Exif extension information.

Member | Description
uStructSize | Size of the whole extension list.
uFlags | Flags that indicate the type of data contained in the extensions. Possible values are:
 | Value | Meaning
 | EXTENSION_STAMP | [0x0001] A stamp is present. Most likely suitable for LCD displays (and bigger than the stamp stored in the Exif data). The stamp can be loaded with L_LoadExtensionStamp. Note that this stamp is independent of the regular stamp present in Exif files. Some Exif files have two stamps. The regular stamp is loaded with L_ReadFileStamp, while the extension stamp is loaded with L_LoadExtensionStamp.
 | EXTENSION_AUDIO | [0x0002] Embedded audio data is present. The L_GetExtensionAudio function can be called to get to the audio data.
uCount | The number of extensions present in aList.
aList | Array of EXTENSION structures that contain the extension information. For more information about the information these contain, refer to the EXTENSION structure.

Comments

This structure is used by the following functions:

L_FreeExtensions

L_GetExtensionAudio

L_LoadExtensionStamp

L_ReadFileExtensions


FILEDJVOPTIONS

typedef struct _FILEDJVOPTIONS
{
L_UINT uStructSize;
L_INT nResolution;
}
FILEDJVOPTIONS , L_FAR * pFILEDJVOPTIONS;

The FILEDJVOPTIONS structure provides information on loading DJVU files in LEADTOOLS.

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions. Use the sizeof() macro to calculate this value.
nResolution | Display resolution in dots per inch, default is 96.

Comments

pFILEDJVOPTIONS is a pointer to a FILEDJVOPTIONS structure. Use L_SetDJVOptions and L_GetDJVOptions to set and get the DJVU file options.

The following functions make use of this structure:

L_GetDJVOptions

L_SetDJVOptions


FILEJ2KOPTIONS

typedef struct _FILEJ2KOPTIONS
{
L_UINT uStructSize;
L_BOOL bUseColorTransform;
L_BOOL bDerivedQuantization;
J2KCOMPRESSIONCONTROL uCompressionControl;
L_FLOAT fCompressionRatio;
L_UINT32 uTargetFileSize;
L_UINT32 uXOsiz;
L_UINT32 uYOsiz;
L_UINT32 uXTsiz;
L_UINT32 uYTsiz;
L_UINT32 uXTOsiz;
L_UINT32 uYTOsiz;
L_UINT32 uXRsiz [J2K_MAX_COMPONENTS_NUM];
L_UINT32 uYRsiz [J2K_MAX_COMPONENTS_NUM];
L_UINT uDecompLevel;
L_UINT uProgressOrder;
L_INT nCodBlockWidth;
L_INT nCodBlockHeight;
CODBLOCKSTYLE CodBlockStyleFlags;
L_UINT uGuardBits;
L_INT nDerived_Base_Mantissa;
L_INT nDerived_Base_Exponent;
L_BOOL bUse_SOP_Marker;
L_BOOL bUse_EPH_Marker;
J2KREGIONOFINTEREST uROIControl;
L_BOOL bUseROI;
L_FLOAT fROIWeight;
RECT rcROI;
} FILEJ2KOPTIONS, L_FAR * pFILEJ2KOPTIONS;

The FILEJ2KOPTIONS structure provides information for saving JPEG 2000 files.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
bUseColorTransform | Flag that 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.
bDerivedQuantization | Flag that indicates whether to use derived quantization or expounded quantization. Possible values are:
 | Value | Meaning
 | TRUE | Use derived quantization.
 | FALSE | Use expounded quantization.

uCompressionControl | Flag that indicates how to determine the resulting compression. The value of this members determines which structure member 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 fCompressionRatio member.
 | J2K_COMPRESSION_TARGETSIZE | Compress the file based on the target file size in the uTargetFileSize member.
 | J2K_COMPRESSION_QFACTOR | Compress the file based on the quality factor used by the L_SaveXXX function.

fCompressionRatio | Value that indicates the compression ratio to use. This value is used only if the uCompressionControl member is set to J2K_COMPRESSION_RATIO.
uTargetFileSize | Values that indicates the size of the target file, in bytes. This value is used only if the uCompressionControl member is set to J2K_COMPRESSION_TARGETSIZE.
uXOsiz | Horizontal offset from the origin of the reference grid to the left side of the image area.
uYOsiz | Vertical offset from the origin of the reference grid to the top of the image area.
uXTsiz | Width of one reference tile, with respect to the reference grid.
uYTsiz | Height of one reference tile, with respect to the reference grid.
uXTOsiz | Horizontal offset from the origin of the reference grid to the left side of the first tile.
uYTOsiz | Vertical offset from the origin of the reference grid to the top of the first tile.
uXRsiz | Reserved.
uYRsiz | Reserved.
uDecompLevel | 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.
uProgressOrder | 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. Image starts out gray.

nCodBlockWidth | 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.
nCodBlockHeight | 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.
CodBlockStyleFlags | Bit flags that indicate the behavior of the code block. For more information, refer to the CODBLOCKSTYLE structure.
uGuardBits | Number of extra bits to consider when encoding an image. This prevents coding overflow. Possible values are 0 - 7. The default is 2.
nDerived_Base_Mantissa | The base mantissa used for derived quantization.
nDerived_Base_Exponent | The base exponent used for derived quantization.
bUse_SOP_Marker | Flag 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)
bUse_EPH_Marker | Flag 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)
uROIControl | Flag that indicates the region of interest to use. For a list of possible values, refer to J2KREGIONOFINTEREST.
bUseROI | Flag that indicates whether to use a region of interest. Possible values are:
 | Value | Meaning
 | TRUE | Use a region of interest as specified in the uROIControl member.
 | FALSE | Do not use a region of interest. If you do not want to use a region of interest, set this to FALSE. Otherwise, there may be a significant compression and speed performance loss.
fROIWeight | Reserved for future use.
rcROI | RECT structure that contains the boundaries of the region of interest within the image.

Comments

When using this structure with FILE_CMW or FILE_TIF_CMW files, only the following data members are required:

uCompressionControl

fCompressionRatio

uTargetFileSize

uProgressOrder

The resulting file size/ compression ratio can be determined in several ways. Depending on the value set in the uCompressionControl member, the user can set the size of the target file, the actual compression ratio to use during compression or the quality factor to use during compression. If uCompressionControl is set to J2K_COMPRESSION_RATIO, then the compression to use is based on the compression ratio in the fCompressionRatio data member. If uCompressionControl is set to J2K_COMPRESSION_TARGETSIZE, the compression to use is based on the desired target file size in the uTargetFileSize data member. If uCompressionControl is set to J2K_COMPRESSION_QFACTOR, then compression is used based on the QFactor passed to the L_SaveXXX function.

For lossless compression, set the uCompressionControl to J2K_COMPRESSION_LOSSLESS.

The bUse_SOP_Marker and the bUse_EPH_Marker indicate whether to include markers at the "Start of Packet" and "End of Packet Header". These markers help detect file corruption during transmission.

There are two types of quantization for lossy compression, Scalar Derived Quantization and Scalar Expounded Quantization. In Scalar Derived Quantization mantissa and exponent values for the LL Subband only are signaled. The mantissa and exponent for the other subbands are derived from the mantissa and exponent signaled for the LL subband.

In Scalar Expounded Quantization, the mantissa and exponent values for each subband are signaled.

The quantization step size for a subband is determined based on the following equation, where R = bpp for the subband:

Quantization Step = (2 (R - Exponent) ) * [1 + (Mantissa / 2048)]

The values of the uXOsiz, uYOsiz, uXTsiz, uYTsiz, uXTOsiz and uYTOsiz structure members are used to create tiles within the image. Arbitrary tile sizes are allowed. All tiles are the same size, except for the border tiles. Each tile can be compressed individually. This can decrease memory usage while the program is running, but can also generate artifacts at the edges of the tiles. Artifacts generally increase as the size of the tile decreases. By default, there is one tile that contains the entire image.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


FILEJBIG2OPTIONS

typedef struct _FILEJBIG2OPTIONS
{
L_INT uStructSize;
L_UINT32 uSaveFlags;
L_UCHAR ucTemplateType;
L_CHAR GBATX1;
L_CHAR GBATY1;
L_CHAR GBATX2;
L_CHAR GBATY2;
L_CHAR GBATX3;
L_CHAR GBATY3;
L_CHAR GBATX4;
L_CHAR GBATY4;
} FILEJBIG2OPTIONS, L_FAR *pFILEJBIG2OPTIONS;

The FILEJBIG2OPTIONS structure provides information for saving JBIG2 files.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uSaveFlags | 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
 | FLAG_JBIG2_REMOVE_MARKER | [0x0001] Remove the two bytes marker from generic region segment data.
 | FLAG_JBIG2_REMOVE_HEADER_SEGMENT | [0x0002] Remove JBIG2 header.
 | FLAG_JBIG2_REMOVE_EOP_SEGMENT | [0x0004] Remove End Of Page segment.
 | FLAG_JBIG2_REMOVE_EOF_SEGMENT | [0x0008] Remove End Of File segment.
 | FLAG_JBIG2_TPON | [0x0010] Use typical prediction (TP) while encoding.

ucTemplateType | Value specifies the template to be used for 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. |
GBATX1 | The X location of the adaptive template pixel A1. Its range is from -128 to 127 except when GBATY1 is zero, then it will be from –128 to –1
GBATY1 | The Y location of the adaptive template pixel A1. Its range is from -128 to 0.
GBATX2 | The X location of the adaptive template pixel A2. Its range is from -128 to 127 except when GBATY2 is zero, then it will be from –128 to –1.
GBATY2 | The Y location of the adaptive template pixel A2. Its range is from -128 to 0.
GBATX3 | The X location of the adaptive template pixel A3. Its range is from -128 to 127 except when GBATY3 is zero, then it will be from –128 to -1.
GBATY3 | The Y location of the adaptive template pixel A3. Its range is from -128 to 0.
GBATX4 | The X location of the adaptive template pixel A4. Its range is from -128 to 127 except when GBATY4 is zero, then it will be from –128 to -1.
GBATY4 | The Y location of the adaptive template pixel A4. Its range is from -128 to 0.

Comments

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

The following functions make use of this structure:

L_GetJBIG2Options

L_SetJBIG2Options


FILEPDFOPTIONS

typedef struct _FILEPDFOPTIONS
{
L_UINT uStructSize;
L_BOOL bUseLibFonts;
L_INT nXResolution;
L_INT nYResolution;
L_INT nDisplayDepth;
L_INT nTextAlpha;
L_INT nGraphicsAlpha;
} FILEPDFOPTIONS, L_FAR * pFILEPDFOPTIONS;

The FILEPDFOPTIONS structure provides information on loading PDF, PS or EPS files in LEADTOOLS.

The following functions make use of this structure:

L_GetPDFOptions

L_SetPDFOptions

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions.
bUseLibFonts | Flag that indicates whether to use the library installed fonts or system fonts. Possible values are:
 | Value | Meaning
 | TRUE | Use the library installed fonts.
 | FALSE | Use the system fonts.
nXResolution | Horizontal display resolution in dots per inch.
nYResolution | Vertical display resolution in dots per inch.
nDisplayDepth | Resulting bitmap pixel depth. Possible values are:
 | 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
nTextAlpha | Flag that indicates what type of font anti-aliasing to use. Possible values are:
 | Value | Meaning
 | 1 | Do not use font anti-aliasing.
 | 2 | Use 2-bit font anti-aliasing.
 | 4 | Use 4-bit font anti-aliasing.
nGraphicsAlpha | Flag that indicates what type of graphics anti-aliasing to use. Possible values are:
 | Value | Meaning
 | 1 | Do not use graphics anti-aliasing.
 | 2 | Use 2-bit graphics anti-aliasing.
 | 4 | Use 4-bit graphics anti-aliasing.

Comments

pFILEPDFOPTIONS is a pointer to a FILEPDFOPTIONS structure.

Use L_SetPDFOptions and L_GetPDFOptions to set and get the PDF, PS and EPS file options.

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.


FILEPDFSAVEOPTIONS

typedef struct _FILEPDFSAVEOPTIONS
{
L_UINT uStructSize;
L_UCHAR szUserPassword[255];
L_UCHAR szOwnerPassword[255];
L_BOOL b128bit;
L_UNIT32 dwEncryptFlags;
} FILEPDFSAVEOPTIONS, L_FAR * pFILEPDFSAVEOPTIONS;

The FILEPDFSAVEOPTIONS structure specifies options used when saving a PDF file.

The following functions make use of this structure:

L_GetPDFSaveOptions

L_SetPDFSaveOptions

Member | Description
uStructSize | Size of the structure. This should be sizeof(FILEPDFSAVEOPTIONS).
szUserPassword | String that contains the user password. This should be provided to protect the document from being opened/read.
szOwnerPassword | String that contains the owner password. This should be provided to prevent users from changing access/protection settings.
b128bit | 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.

dwEncryptFlags | 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_SECURITYFLAGS_REV2_PRINTDOCUMENT | Give the user of the PDF document permission to print the document.
 | PDF_SECURITYFLAGS_REV3_PRINTFAITHFUL | [128 bit only] Give the user of the PDF document permission to print the document in high quality.
 | PDF_SECURITYFLAGS_REV2_MODIFYDOCUMENT | Give the user of the PDF document permission to edit the document.
 | PDF_SECURITYFLAGS_REV2_EXTRACTTEXT | Give the user of the PDF document permission to extract text from the document.
 | PDF_SECURITYFLAGS_REV3_EXTRACTTEXTGRAPHICS | [128 bit only] Give the user of the PDF document permission to extract graphics from the document.
 | PDF_SECURITYFLAGS_REV2_MODIFYANNOTATION | Give the user of the PDF document permission to edit annotations.
 | PDF_SECURITYFLAGS_REV3_FILLFORM | Give the user of the PDF document permission to fill in forms in the document.
 | PDF_SECURITYFLAGS_REV3_ASSEMBLEDOCUMENT | [128 bit only] Give the user of the PDF document permission to add pages to or delete pages from the document.


FILEPLTOPTIONS

typedef struct _FILEPLTOPTIONS
{
L_UINT uStructSize;
L_INT PenWidth[8];
COLORREF PenColor[8];
} FILEPLTOPTIONS, L_FAR * pFILEPLTOPTIONS;

The FILEPLTOPTIONS structure provides information on loading HPGL files in LEADTOOLS.

The following functions make use of this structure:

L_GetPLTOptions

L_SetPLTOptions

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions. Use sizeof(FILEPLTOPTIONS).
PenWidth | Array of integers that represent pen widths used by an HPGL file.
PenColor | Array of COLORREF structures that represent pen colors used by a HPGL file.

Comments

pFILEPLTOPTIONS is a pointer to a FILEPLTOPTIONS structure.

Use L_SetPLTOptions and L_GetPLTOptions to set and get the HPGL file options.


FILEPTKOPTIONS

typedef struct _FILEPTKOPTIONS
{
L_UINT uStructSize;
L_INT nPTKResolution;
}
FILEPTKOPTIONS , L_FAR * pFILEPTKOPTIONS;

The FILEPTKOPTIONS structure provides information on loading PTOCA and AFP: PTOCA files in LEADTOOLS.

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions. Use the sizeof() macro to calculate this value.
nPTKResolution | Display resolution in dots per inch, default is 96.

Comments

pFILEPTKOPTIONS is a pointer to a FILEPTKOPTIONS structure. Use L_SetPTKOptions and L_GetPTKOptions to set and get the PTOCA and AFP:PTOCA file options.

The following functions make use of this structure:

L_GetPTKOptions

L_SetPTKOptions


FILERTFOPTIONS

typedef struct _FILERTFOPTIONS
{
L_UINT uStructSize;
L_DOUBLE dTopMarg;
L_DOUBLE dBottomMarg;
L_DOUBLE dRightMarg;
L_DOUBLE dLeftMarg;
L_DOUBLE dPaperWidth;
L_DOUBLE dPaperHeight;
} FILERTFOPTIONS, L_FAR * pFILERTFOPTIONS;

The FILERTFOPTIONS structure provides information on loading RTF files in LEADTOOLS.

The following functions make use of this structure:

L_GetRTFOptions

L_SetRTFOptions

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions. Use sizeof(FILERTFOPTIONS).
dTopMarg | Value that represents the width of the top margin.
dBottomMarg | Value that represents the width of the bottom margin.
dRightMarg | Value that represents the width of the right margin.
DLeftMarg | Value that represents the width of the left margin.
dPaperWidth | Value that represents the width of the paper.
dPaperHeight | Value that represents the height of the paper.

Comments

pFILERTFOPTIONS is a pointer to a FILERTFOPTIONS structure.

Use L_SetRTFOptions and L_GetRTFOptions to set and get the RTF file options.


FILESAVEFORMAT

typedef struct _FILESAVEFORMAT
{

L_INT32 nSize; | /* size of this structure*/
L_INT nFormat; | /* file formats */
L_UINT uSubFormats; | /* sub-format flags */

} FILESAVEFORMAT, L_FAR * LPFILESAVEFORMAT;

The FILESAVEFORMAT structure provides information to the L_DlgSave function.

Member

Description

nSize

Size of this structure.

nFormat

Top level formats. Possible values are:

FS_LEAD24

FS_LEAD8

FS_LEAD1BIT

FS_JFIF24

FS_JFIF16

FS_JFIF12

FS_JFIF8

FS_J2K8

FS_J2K12

FS_J2K16

FS_J2K24

FS_CMW8

FS_CMW12

FS_CMW16

FS_CMW24

FS_CALS

FS_PNG1

FS_PNG4

FS_PNG8

FS_PNG24

FS_PNG32

FS_DICOM8

FS_DICOM16

FS_DICOM24

FS_FAX

FS_EPS

FS_EXIF

FS_FPX24

FS_FPX8

FS_IMG

FS_GIF1

FS_GIF2

FS_GIF3

FS_GIF4

FS_GIF5

FS_GIF6

FS_GIF7

FS_GIF8

FS_IOCA

FS_MODCA

FS_PCT1

FS_PCT4

FS_PCT8

FS_PCT24

FS_MAC

FS_AWD

FS_MSP

FS_OS2BMP1

FS_OS2BMP4

FS_OS2BMP8

FS_OS2BMP24

FS_PCX1

FS_PCX4

FS_PCX8

FS_PCX24

FS_PSD1

FS_PSD8

FS_PSD24

FS_RAS1

FS_RAS4

FS_RAS8

FS_RAS24

FS_RAS32

FS_TGA8

FS_TGA16

FS_TGA24

FS_TGA32

FS_TIFF1

FS_TIFF2

FS_TIFF3

FS_TIFF4

FS_TIFF5

FS_TIFF6

FS_TIFF7

FS_TIFF8

FS_TIFF12

FS_TIFF16

FS_TIFF24

FS_TIFF32

FS_TIFF48

FS_TIFF64

FS_BMP1

FS_BMP4

FS_BMP8

FS_BMP16

FS_BMP24

FS_BMP32

FS_WFX

FS_EMF8

FS_EMF24

FS_EMF8 (32-bit only)

FS_EMF24 (32-bit only)

FS_WPG1

FS_WPG4

FS_WPG8

FS_ICO1

FS_ICO4

FS_ICO8

FS_ICO24

FS_CUR1

FS_CUR4

FS_CUR8

FS_CUR24

FS_JBIG1

FS_JBIG2

FS_JBIG3

FS_JBIG4

FS_JBIG5

FS_JBIG6

FS_JBIG7

FS_JBIG8

FS_CUT

FS_PPM

FS_PGM

FS_PBM

FS_IFF1

FS_IFF2

FS_IFF3

FS_IFF4

FS_IFF5

FS_IFF6

FS_IFF7

FS_IFF8

FS_IFF24

FS_XBM

FS_XPM8

FS_XPM16

FS_XPM24

FS_XPM32

FS_ITG

FS_FLC8

FS_ANI1

FS_ANI4

FS_ANI8

FS_ANI24

FS_XWD10_1

FS_XWD10_4

FS_XWD10_8

FS_XWD11_1

FS_XWD11_4

FS_XWD11_8

FS_XWD11_16

FS_XWD11_24

FS_XWD11_32

FS_CLP1

FS_CLP4

FS_CLP8

FS_CLP24

FS_RAW

FS_PDF1

FS_PDF2

FS_PDF4

FS_PDF8

FS_PDF24

FS_SGI8

FS_SGI24

FS_SGI32

FS_WBMP

FS_SCT24

FS_SMP

FS_MAX

uSubFormats

Sub-formats. Possible values are:

/* LEAD CMP file subtypes (8,24-bit) */

DLG_FS_SUB_CMP_NONPROGRESSIVE

0x0001

DLG_FS_SUB_CMP_PROGRESSIVE

0x0002

/* JPEG file subtypes (24-bit) */

DLG_FS_SUB_JPEG24_YUV_444

0x0001

DLG_FS_SUB_JPEG24_YUV_422

0x0002

DLG_FS_SUB_JPEG24_YUV_411

0x0004

DLG_FS_SUB_JPEG24_PROG_444

0x0008

DLG_FS_SUB_JPEG24_PROG_422

0x0010

DLG_FS_SUB_JPEG24_PROG_411

0x0020

DLG_FS_SUB_JPEG24_LOSSLESS

0x0040

/* JPEG file subtypes (12-bit) */

DLG_FS_SUB_JPEG12_YUV_400

0x0001

DLG_FS_SUB_JPEG12_LOSSLESS

0x0002

/* JPEG file subtypes (8-bit) */

DLG_FS_SUB_JPEG8_YUV_400

0x0001

DLG_FS_SUB_JPEG8_PROG_400

0x0002

DLG_FS_SUB_JPEG8_LOSSLESS

0x0004

/* JPEG 2000 file subtypes (8,24-bit)*/

DLG_FS_SUB_J2K_STREAM

0x0001

DLG_FS_SUB_J2K_JP2

0x0002

/* DICOM file subtypes (8-bit) */

DLG_FS_SUB_DICOM8_GRAY

0x0001

DLG_FS_SUB_DICOM8_COLOR

0x0002

/* DICOM file subtypes (Other-bit) */

DLG_FS_SUB_DICOM_RLE_GRAY

0x0001

DLG_FS_SUB_DICOM_RLE_COLOR

0x0002

DLG_FS_SUB_DICOM_JPEG_GRAY

0x0004

DLG_FS_SUB_DICOM_LOSSLESSJPEG_GRAY

0x0008

DLG_FS_SUB_DICOM_JPEG_COLOR

0x0010

DLG_FS_SUB_DICOM_LOSSLESSJPEG_COLOR

0x0020

/* RAW FAX, IOCA, & MODCA subtypes */

DLG_FS_SUB_FAX_G3_1D

0x0001

DLG_FS_SUB_FAX_G3_2D

0x0002

DLG_FS_SUB_FAX_G4

0x0004

/* EXIF file subtypes */

DLG_FS_SUB_EXIF_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_EXIF_UNCOMPRESSEDYCC

0x0002

DLG_FS_SUB_EXIF_JPEG_411

0x0004

DLG_FS_SUB_EXIF_JPEG_422

0x0008

/* FPX file subtypes */

DLG_FS_SUB_FPX_UNCOMPRESSED

0x0001

DLG_FS_SUB_FPX_SINGLECOLOR

0x0002

DLG_FS_SUB_FPX_DEFQFACTOR

0x0004

DLG_FS_SUB_FPX_SPECQFACTOR

0x0008

/* GIF file subtypes */

DLG_FS_SUB_GIF_INTERLACED89A

0x0001

DLG_FS_SUB_GIF_NONINTERLACED89A

0x0002

/* OS/2 BMP file subtypes */

DLG_FS_SUB_OS2_VER1

0x0001

DLG_FS_SUB_OS2_VER2

0x0002

/* TIFF file subtypes (1-bit) */

DLG_FS_SUB_TIFF1_CCITT

0x0001

DLG_FS_SUB_TIFF1_CCITT_G3_1D

0x0002

DLG_FS_SUB_TIFF1_CCITT_G3_2D

0x0004

DLG_FS_SUB_TIFF1_CCITT_G4

0x0008

DLG_FS_SUB_TIFF1_UNCOMPRESSEDRGB

0x0010

DLG_FS_SUB_TIFF1_RLERGB

0x0020

DLG_FS_SUB_TIFF1_LZWRGB

0x0040

/* TIFF file subtypes (2,3,4,5,6,7-bit) */

DLG_FS_SUB_TIFFOTHER_UNCOMPRESSED

0x0001

DLG_FS_SUB_TIFFOTHER_RLE

0x0002

DLG_FS_SUB_TIFFOTHER_LZW

0x0004

/* TIFF file subtypes (8-bit) */

DLG_FS_SUB_TIFF8_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_TIFF8_RLERGB

0x0002

DLG_FS_SUB_TIFF8_JPEG_GRAY_YCC

0x0004

DLG_FS_SUB_TIFF8_LOSSLESSJPEG

0x0008

DLG_FS_SUB_TIFF8_LZWRGB

0x0010

DLG_FS_SUB_TIFF8_JBIG

0x0020

DLG_FS_SUB_TIFF8_CMP

0x0040

DLG_FS_SUB_TIFF8_J2K

0x0080

DLG_FS_SUB_TIFF8_CMW

0x0100

/* TIFF file subtypes (12-bit) */

DLG_FS_SUB_TIFF12_UNCOMPRESSED

0x0001

DLG_FS_SUB_TIFF12_RLE

0x0002

DLG_FS_SUB_TIFF12_LOSSLESSJPEG

0x0004

DLG_FS_SUB_TIFF12_JPEG_GRAY_YCC

0x0008

DLG_FS_SUB_TIFF12_LZW

0x0010

DLG_FS_SUB_TIFF12_J2K

0x0020

DLG_FS_SUB_TIFF12_CMW

0x0040

/* TIFF file subtypes (16-bit) */

DLG_FS_SUB_TIFF16_UNCOMPRESSED

0x0001

DLG_FS_SUB_TIFF16_RLE

0x0002

DLG_FS_SUB_TIFF16_LOSSLESSJPEG

0x0004

DLG_FS_SUB_TIFF16_LZW

0x0008

DLG_FS_SUB_TIFF16_J2K

0x0010

DLG_FS_SUB_TIFF16_CMW

0x0020

/* TIFF file subtypes (24-bit) */

DLG_FS_SUB_TIFF24_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_TIFF24_UNCOMPRESSEDCMYK

0x0002

DLG_FS_SUB_TIFF24_UNCOMPRESSEDYCC

0x0004

DLG_FS_SUB_TIFF24_RLERGB

0x0008

DLG_FS_SUB_TIFF24_RLECMYK

0x0010

DLG_FS_SUB_TIFF24_RLEYCC

0x0020

DLG_FS_SUB_TIFF24_JPEG_YCC_444

0x0040

DLG_FS_SUB_TIFF24_JPEG_YCC_422

0x0080

DLG_FS_SUB_TIFF24_JPEG_YCC_411

0x0100

DLG_FS_SUB_TIFF24_LOSSLESSJPEG

0x0200

DLG_FS_SUB_TIFF24_LZWRGB

0x0400

DLG_FS_SUB_TIFF24_LZWCMYK

0x0800

DLG_FS_SUB_TIFF24_LZWYCC

0x1000

DLG_FS_SUB_TIFF24_CMP_NONPROGRESSIVE

0x2000

DLG_FS_SUB_TIFF24_CMP_PROGRESSIVE

0x4000

DLG_FS_SUB_TIFF24_J2K

0x8000

DLG_FS_SUB_TIFF24_CMW

0x0001000

/* TIFF file subtypes (32-bit) */

DLG_FS_SUB_TIFF32_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_TIFF32_UNCOMPRESSEDCMYK

0x0002

DLG_FS_SUB_TIFF32_RLERGB

0x0004

DLG_FS_SUB_TIFF32_RLECMYK

0x0008

DLG_FS_SUB_TIFF32_LZWRGB

0x0010

DLG_FS_SUB_TIFF32_LZWCMYK

0x0020

/* TIFF file subtypes (48-bit) */

DLG_FS_SUB_TIFF48_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_TIFF48_LZWRGB

0x0002

/* TIFF file subtypes (64-bit) */

DLG_FS_SUB_TIFF64_UNCOMPRESSEDRGB

0x0001

DLG_FS_SUB_TIFF64_LZWRGB

0x0002

/* BMP file subtypes (4 and 8-bit only) */

DLG_FS_SUB_BMP_UNCOMPRESSED

0x0001

DLG_FS_SUB_BMP_RLECOMPRESSED

0x0002

/* WFX file subtypes */

DLG_FS_SUB_WFX_CCITT_G3_1D

0x0001

DLG_FS_SUB_WFX_CCITT_G4

0x0002

/* PPM file subtypes */

DLG_FS_SUB_PPM_ASCII

0x0001

DLG_FS_SUB_PPM_BINARY

0x0002

/* PGM file subtypes */

DLG_FS_SUB_PGM_ASCII

0x0001

DLG_FS_SUB_PGM_BINARY

0x0002

/* PBM file subtypes */

DLG_FS_SUB_PBM_ASCII

0x0001

DLG_FS_SUB_PBM_BINARY

0x0002

/* IFF file subtypes */

/* All BitsPerPixel have subtypes */

DLG_FS_SUB_IFF_ILBM_RLE

0x0001

DLG_FS_SUB_IFF_CAT_RLE

0x0002

/* SGI file subtypes */

DLG_FS_SUB_SGI_UNCOMPRESSED

0x0001

DLG_FS_SUB_SGI_RLECOMPRESSED

0x0002

/* PDF file subtypes (1bit) */

DLG_FS_SUB_PDF1_UNCOMPRESSED

0x0001

DLG_FS_SUB_PDF1_CCITT_G3_1D

0x0002

DLG_FS_SUB_PDF1_CCITT_G3_2D

0x0004

DLG_FS_SUB_PDF1_CCITT_G4

0x0008

/* PDF file subtypes (8-bit) */

DLG_FS_SUB_PDF8_UNCOMPRESSED

0x0001

DLG_FS_SUB_PDF8_LOSSLESSJPEG

0x0002

/* PDF file subtypes (24-bit) */

DLG_FS_SUB_PDF24_UNCOMPRESSED

0x0001

DLG_FS_SUB_PDF24_YUV_444

0x0002

DLG_FS_SUB_PDF24_YUV_422

0x0004

DLG_FS_SUB_PDF24_YUV_411

0x0008


FILETXTOPTIONS

typedef struct _FILETXTOPTIONS
{
L_UINT uStructSize;
L_BOOL bEnabled;
L_DOUBLE dTopMarg;
L_DOUBLE dBottomMarg;
L_DOUBLE dRightMarg;
L_DOUBLE dLeftMarg;
L_DOUBLE dPaperWidth;
L_DOUBLE dPaperHeight;
COLORREF crFontColor;
COLORREF crHighlight;
L_INT nFontSize;
L_TCHAR szFaceName[LF_FACESIZE];
L_BOOL bBold;
L_BOOL bItalic;
L_BOOL bUnderLine;
L_BOOL bStrikeThrough;
} FILETXTOPTIONS, L_FAR * pFILETXTOPTIONS;

The FILETXTOPTIONS structure provides information on loading TXT files in LEADTOOLS.

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions. Use the sizeof(FILETXTOPTIONS) macro to calculate this value.
bEnabled | Flag that indicates whether to call the filter.
 | Value | Meaning
 | TRUE | Call the filter.
 | FALSE | Don't call the filter.
dTopMarg | The width of the top margin.
dBottomMarg | The width of the bottom margin.
dRightMarg | The width of the right margin.
dLeftMarg | The width of the left margin.
dPaperWidth | The width of the paper.
dPaperHeight | The height of the paper.
crFontColor | The font color.
crHighlight | The high light color.
nFontSize | The font size.
szFaceName | Character string that contains the text font face name.
bBold | Flag that indicates whether to display the text as bold.
 | Value | Meaning
 | TRUE | Displays the text as bold.
 | FALSE | Displays the text as not bold.
bItalic | Flag that indicates whether to display the text as italic.
 | Value | Meaning
 | TRUE | Displays the text as italic.
 | FALSE | Displays the text as not italic.
bUnderLine | Flag that indicates whether to display the text underlined.
 | Value | Meaning
 | TRUE | Displays the text underlined.
 | FALSE | Displays the text as not underlined.
bStrikeThrough | Flag that indicates whether to display the text with a strikethrough.
 | Value | Meaning
 | TRUE | Displays the text with a strikethrough.
 | FALSE | Displays the text without a strikethrough.

Comments

pFILETXTOPTIONS is a pointer to a FILETXTOPTIONS structure.

The following functions make use of this structure:

L_GetTXTOptions

L_SetTXTOptions


J2KCOMPRESSIONCONTROL

typedef enum tagJ2KCOMPRESSIONCONTROL
{ J2K_COMPRESSION_LOSSLESS //Lossless compression.
J2K_COMPRESSION_RATIO // Use the fCompressionRatio value for compression
J2K_COMPRESSION_TARGETSIZE // Use the uTargetFileSize value for compression
J2K_COMPRESSION_QFACTOR // Use the qFactor value for compression
} J2KCOMPRESSIONCONTROL, L_FAR *p J2KCOMPRESSIONCONTROL;

This data type is used within the FILEJ2KOPTIONS structure to control the compression of JPEG 2000 files.


J2KREGIONOFINTEREST

typedef enum tagJ2KREGIONOFINTEREST

{
J2K_USE_LEAD_REGION, // Use the LEAD bitmap region to define
// the region of interest.
J2K_USE_OPTION_RECT // Use the rectangle specified in the rcROI
// member of the FILEJ2KOPTIONS structure to
// define the region of interest.

} J2KREGIONOFINTEREST, L_FAR *pJ2KREGIONOFINTEREST;

This data type is used within the FILEJ2KOPTIONS structure to indicate which region of interest to use.


LAYERINFO

typedef struct _LAYERINFO
{
L_UINT uStructSize;
L_INT32 uLayerLeft;
L_INT32 uLayerTop;
L_UCHAR uOpacity;
L_UCHAR uClipping;
L_UCHAR szBlendModeKey[4];
pBITMAPHANDLE pMaskBitmap;
} LAYERINFO, L_FAR * pLAYERINFO;

The LAYERINFO structure describes the layer position within a file.

Member | Description
uStructSize | Size of this structure. Use sizeof (LAYERINFO).
uLayerLeft | Left layer position.
uLayerTop | Top layer position.
uOpacity | Opacity value of the layer. Possible values are between 0 and 255, where a value of 0 is completely transparent and a value of 255 is completely opaque. For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.
uClipping | Clipping value for the layer. A value of 0 represents base. A value of 1 represents non-base. For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.
szBlendModeKey | A four byte character array that represents the blend mode key for the layer. 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 ' | dodge.
 | 'idiv' | color burn
 | For more information, refer to the FILE FORMATS SPECIFICATION from Adobe.
pMaskBitmap | Pointer to a bitmap handle that references the bitmap of the transparency mask channel of the saved layer. This is an 8-bit grayscale bitmap. The value of each pixel indicates the amount of transparency the data of the original bitmap has at this point. For example, if the value is 0xFF at a certain point, the pixel value of the layer bitmap at that point is not transparent at all. If the value was 0x00, the pixel value of the layer bitmap at that point is fully transparent. If the value is between these two, it indicates the degree of transparency the pixel value of the layer bitmap has at that point.
 | When loading, this variable must be a pointer to a BITMAPHANDLE, which is not allocated. The load function will allocate this bitmap and it is up to the user to free this bitmap.
 | If the mask bitmap does not need to be loaded, pass NULL. Passing NULL saves the transparency mask as a full white bitmap, which represents full visibility of the layer.
 | When saving, if this is a valid bitmap, then it should be of the same width & height as the corresponding layer bitmap. It should also be an 8-bit grayscale bitmap.
 | For more information, refer to FILE FORMATS SPECIFICATION from Adobe.

Comments

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

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

Usually layers start in the top-left position of the image, so uLayerLeft and uLayerTop are 0 most of the time.


LOADFILEOPTION

typedef struct _LOADFILEOPTION
{
L_UINT uStructSize;
L_INT XResolution;
L_INT YResolution;
L_UINT Flags;
L_INT Passes;
L_INT PageNumber;
L_UINT GlobalLoop;
L_UINT32 IFD
L_UINT uRedScan;
L_UINT uGreenScan;
L_UINT uBlueScan;
} LOADFILEOPTION, L_FAR * pLOADFILEOPTION;

The LOADFILEOPTION structure specifies extra options for reading an image file.

The following functions make use of this structure:

L_AnnLoad

L_AnnLoadOffset

L_AnnLoadMemory

L_DecompressBitmapMemory

L_DecompressMemory

L_ReadLoadResolutions

L_ReadFileTransforms

L_FileInfo

L_FileInfoMemory

L_GetCompressFileStamp

L_GetLoadResolution

L_GetFileCommentSize

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileTile

L_LoadFileOffset

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentExt

L_ReadFileCommentMemory

L_ReadFileTag

L_ReadFileTagMemory

L_ReadFileStamp

L_StartFeedLoad

L_FileConvert

See L_GetDefaultLoadFileOption for information on default load options.

Member | Description
uStructSize | Size of the LOADFILEOPTION structure. This should be sizeof(LOADFILEOPTION). You must fill this member.
XResolution | Horizontal dots per inch.
YResolution | Vertical dots per inch.
Flags | Any of the following flags. (You can use a bitwise OR to specify more than one value.)
 | Value | Meaning
 | ELO_REVERSEBITS | [0x00000001] Reverses the bit order when writing CCITT Group 3 and 4 files, so that the least significant bit (LSB) is first.
 | ELO_GLOBALBACKGROUND | [0x00000002] Causes a GIF file to be saved with the global background color specified by the GlobalBackground field.
 | ELO_GLOBALPALETTE | [0x00000004] Causes a GIF file to be saved with the global palette specified by the GlobalPalette field.
 | ELO_GLOBALLOOP | [0x00000008] Enables looping when loading an animated file. This flag must be on for the GlobalLoop field to be used.
 | ELO_ROTATED | [0x00000010] Loads files without rotating them. This affects files that can be saved with a rotated view perspective. For more information refer to Accounting for View Perspective.
 | ELO_IGNOREVIEWTRANSFORMS | [0x00000020] Causes a Flash-Pix file to be loaded without being modified by the viewing transforms.
 | ELO_IGNORECOLORTRANSFORMS | [0x00000040] Causes a Flash-Pix file to be loaded without being modified by the color transforms.
 | ELO_SIGNED | [0x00000080] Indicates the bitmap can contain negative pixel values.
 | ELO_DISABLEMMX | [0x00000100] Do not use MMX optimized code
 | ELO_DISABLEP3 | [0x00000200] Do not use P3 specific optimized code.
 | ELO_USEIFD | [0x00000400] Use the IFD offset.
 | ELO_FORCECIELAB | [0x00000800] (JPEG only) The file has CIELAB colorspace
 | ELO_USEBADJPEGPREDICTOR | [0x00001000] (JPEG only) Load lossless JPEG file using an incorrect predictor
 | ELO_IGNOREPHOTOMETRICINTERP | [0x00002000] (TIFF only) Use RGB colorspace instead of the PhotometricInterpretation stored in the file. Use this to disable the color conversion to RGB during the load process.
 | ELO_FORCERGBFILE | [0x00004000] (JPEG only) The file has RGB colorspace.
 | ELO_MULTISPECTRALSCAN | [0x00008000] Use uXXXScan values info when loading NITF files.
 | ELO_NOPALETTE | [0x00010000] Use the new palette mechanism. Do not use GDI memory to store the palette.
 | ELO_IGNOREVIEWPERSPECTIVE | [0x00200000] (TIF and Exif only) Ignore the view perspective stored in the file and load the file as TOP_LEFT. If you are loading a TIF or Exif file that looks rotated or flipped, try setting this flag before loading the file.
 | ELO_USEFASTCONVERSION | [0x00400000] (TIF and JPEG only) Use the fast color conversions when loading CMYK or CIELab files. Setting this flag will greatly speed up the loading of CMYK and CIELab files, but it will reduce the image quality.
Passes | The number of passes (scans through the image) when loading or saving a progressive JPEG or LEAD CMP file. (This value is also used when loading interlaced PNG files.) (This value is also used when loading JBIG files to determine the number of resolutions to load to create a progressive load effect.)
 | Possible values when loading a progressive file:
 | Any positive number | The FILEREADCALLBACK function is called the specified number of times.
 | CALLBACK_ONCE | [0] The FILEREADCALLBACK function is called only once at the end.
 | CALLBACK_WHEN_MEANINGFUL | [-1] The FILEREADCALLBACK function is called only on significant scans. (This is usually the best option.)
 | CALLBACK_ALWAYS | [-2] The FILEREADCALLBACK function is called for the default number of scans.
PageNumber | The page number of a multi-page file, which can contain more than one image. When loading a file, this is the exact page number. For more information on multi-page files refer to Multipage File Formats.
GlobalLoop | Loop count when playing an animation. Use 0 for continuous looping. For no looping, turn off the ELO_GLOBALLOOP flag in the Flags field.
IFD | Offset within a TIFF file where a page starts. This serves as a reference page for loading pages to a large TIFF file.
uRedScan | (NITF only) Index of the scan to be loaded for the red component. Used only if ELO_MULTISPECTRALSCAN is set.
uGeenScan | (NITF only) Index of the scan to be loaded for the green component. Used only if ELO_MULTISPECTRALSCAN is set.
uBlueScan | (NITF only) Index of the scan to be loaded for the blue component. Used only if ELO_MULTISPECTRALSCAN is set.

Comments

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

To load a stamp image, you must use the L_GetCompressFileStamp function.

If ELO_SIGNED is set, the bitmap can contain negative pixel values. This can cause the image to be incorrectly painted when it is loaded. In order to load correctly, you must call L_ClearNegativePixels before loading the image. If ELO_SIGNED is not set, any negative pixels in the image will be cleared internally.

Note: When loading JBIG files, the behavior is as follows:

1) If only one resolution exists in the JBIG File, then the FILEREADCALLBACK function will be called with the image data for that resolution as it is decompressed.

2) If the image contains more than one resolution and (Passes >= nResolutions, where nResolutions represents the number of resolutions present in the file,) then the FILEREADCALLBACK function will be called with the image data from the lowest resolution available in the file. The data that gets passed to the callback and/or inserted into the bitmap handle 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 nPasses to CALLBACK_WHEN_MEANINGFUL or CALLBACK_ALWAYS has the same effect.

3) If the image contains more than one resolution and (Passes 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.

Note: For more information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

ELO_MULTISPECTRALSCAN is used internally by the NITF filter. You do not need to use this flag.


LOADINFO

typedef struct _LOADINFO
{
L_UINT uStructSize;
L_INT Format; /* File format */
L_INT Width; /* Image width */
L_INT Height; /* Image height */
L_INT BitsPerPixel; /* Bits per pixel */
L_INT XResolution; /* X resolution (DPI) */
L_INT YResolution; /* Y resolution (DPI) */
L_UINT32 Offset; /* Data offset */
L_UINT32 Flags; /* Special flags */
RGBQUAD rgbQuad[256]; /* palette */
L_UINT32 rgbColorMask[3]; /* RGB color masks */
L_UINT32 uStripSize; /* strip size before decompression */
L_INT nPhotoInt; /* color information */
L_INT nPlanarConfig; /* planar configuration information */
} LOADINFO, L_FAR * pLOADINFO;

The LOADINFO structure provides file format information to the LOADINFOCALLBACK function, which you can use when loading image data in a format that LEADTOOLS does not recognize. For more information, refer to the L_SetLoadInfoCallback function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
Format | File format. The following are valid formats:
 | Value | Meaning
 | FILE_FAX_G3_1D | [66] Raw FAX, compressed using CCITT group 3, 1 dimension.
 | FILE_FAX_G3_2D | [67] Raw FAX, compressed using CCITT group 3, 2 dimensions.
 | FILE_FAX_G4 | [68] Raw FAX, compressed using CCITT group 4.
 | FILE_RAW | [153] Raw uncompressed data
 | FILE_RAW_RLE4 | [157] Raw RLE4 compressed, 4 bit data. (Read only)
 | FILE_RAW_RLE8 | [158] Raw RLE8 compressed, 8 bit data. (Read only)
 | FILE_RAW_BITFIELDS | [159] Raw BITFIELD data, 16 or 32-bit data. (Read only)
 | FILE_RAW_PACKBITS | [160] Raw PackBits compression. (Read only)
Width | Image width in pixels.
Height | Image height in pixels.
BitsPerPixel | Bits per pixel of the image data in the file.
XResolution | Horizontal resolution for rendering the image, specified in dots per inch. This is an optional field.
YResolution | Vertical resolution for rendering the image, specified in dots per inch. This is an optional field.
Offset | Position of the first byte of image data. This can be 0 if your file does not have a header.
Flags | Special flags, which can be specified as follows. You can use a bitwise OR to specify more than one value. Possible values are:
 | Value | Meaning
 | LOADINFO_TOPLEFT | [0x00000001] The image has a TOP_LEFT view perspective.
 | LOADINFO_ORDERRGB | [0x00000002] The color order is RGB.
 | LOADINFO_WHITEONBLACK | [0x00000004] The image is white-on-black.
 | LOADINFO_LSB | [0x00000008] The least significant bit is filled first.
 | LOADINFO_TOPLEFT90 | [0x00000010] The image has a TOP_LEFT90 view perspective. (Document/Medical only)
 | LOADINFO_TOPLEFT270 | [0x00000020] The image has a TOPLEFT270 view perspective. (Document/Medical only)
 | LOADINFO_REVERSE | [0x00000040] Each line 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 | [0x00001000] A palette is supplied in the rgbQuad field. (raw data only)
 | 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.)
rgbQuad | Palette for uncompressed data that is 8 bits per pixel or less. Fill in the first 2 BitsPerPixel entries in this palette and include the LOADINFO_PALETTE flag in the Flags field.
rgbColorMask | Array of RGB color masks used with raw, Bitfield compressed data.
uStripSize | Size of the data strip before it is decompressed.
nPhotoInt | Value that represents color information. Possible values are:
 | Value | Meaning
 | For FILE_RAW_CCITT |
 | FILE_RAW_G3_1D, |
 | FILE_RAW_G3_2D and |
 | FILE_FAX_G4 |
 | 0 | White is zero
 | 1 | Black is zero
 | For FILE_RAW_PACKBITS: |
 | 2 | There is no color map (RGB)
 | 5 | Separated CMYK
 | 6 | YC b C r color space
 | 8 | 1976 CIE L*a*b

uPlanarConfig | Planar configuration. This value is used only if Format is FILE_RAW_PACKBITS. Otherwise, it is ignored. Possible values are:
 | Value | Meaning
 | 1 | Chunky
 | 2 | Planar format

Comments

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

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

LOADINFO_TOPLEFT, LOADINFO_TOPLEFT90 and LOADINFO_TOPLEFT270 cannot be combined.

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.

To load a raw fax file, you must provide a LOADINFOCALLBACK by calling L_SetLoadInfoCallback. If you recognize the file and you know the height and width of the file, set LOADINFO.Width and LOADINFO.Height to a positive value. To automatically detect the width and height of the fax file, set LOADINFO.Width and LOADINFO.Height to -1.

To load raw uncompressed data, set the Format field to FILE_RAW. Valid values must be set for the following LOADINFO fields: Width, Height, BitsPerPixel, Offset (byte location in the file where the 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 Flags field. Include an orientation flag in the Flags field to load the data 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 rgbQuad field.

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.


PCDINFO

typedef struct pcdinfo
{
L_INT resolution[6];
} PCDINFO, L_FAR * pPCDINFO;

The PCDINFO structure is updated by the L_GetPCDResolution function, which tests for available resolutions in a specified PCD file.

Member | Description
resolution | An array of integers. The value of each integer can be 0 or 1. The following symbolic constants are defined for use as indexes into the array:
 | Constant Used as Index | Meaning
 | L_PCD_BASE_OVER_64 | [0] Resolution 64 x 96
 | L_PCD_BASE_OVER_16 | [1] Resolution 128 x 192
 | L_PCD_BASE_OVER_4 | [2] Resolution 256 x 384
 | L_PCD_BASE | [3] Resolution 512 x 768
 | L_PCD_4BASE | [4] Resolution 1024 x 1536
 | L_PCD_16BASE | [5] Resolution 2048 x 3072

Comments

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


PHOTMTRICINTERP

typedef enum tagPHOTMTRICINTERP
{
PME_MINISWHITE =0 ,/* Grayscale image, minimum value is white */
PME_MINISBLACK =1 ,/* Grayscale image, minimum value is black */
PME_RGB =2 ,/* RGB color model */
PME_PALETTE =3 ,/* color map indexed (palletized) */
PME_MASK =4 ,/* 1-bit transparency mask */
PME_SEPARATED =5 ,/* color separations (usually CMYK) */
PME_YCBCR =6 ,/* CCIR 601 YcbCr image */
PME_CIELAB =8 /* 1976 CIE L*a*b* image */
} PHOTMTRICINTERP, L_FAR*pPHOTMTRICINTERP;

The PHOTMTRICINTERP enumerated type is used to indicate the photometric interpretation that should be saved in a file when saving TIFF files.


SAVEFILEOPTION

typedef struct _SAVEFILEOPTION
{
L_UINT uStructSize;
L_UINT Flags;
L_INT Passes;
L_INT PageNumber;
L_INT GlobalWidth;
L_INT GlobalHeight;
L_UINT GlobalLoop;
COLORREF GlobalBackground;
RGBQUAD GlobalPalette[256];
L_UINT StampWidth;
L_UINT StampHeight;
L_UINT StampBits;
L_BOOL Constrained;
L_BOOL FieldPic;
L_INT FrameRate;
L_INT FramesGOP;
L_INT PelAspectRatio;
L_INT ProfileID;
L_INT LevelID;
L_INT ChromaFormat;
L_INT VideoFormat;
L_INT IntraDcPrec;
L_INT32 BitRate;
L_UCHAR UserInfo[255];
L_UINT32 IFD;
L_TCHAR szPassword[255];
L_TCHAR szPassword[255];
PHOTMTRICINTERP PhotometricInterpretation;
L_UINT TileWidth;
L_UINT TileHeight;
L_UINT Flags2;
} SAVEFILEOPTION, L_FAR * pSAVEFILEOPTION;

The SAVEFILEOPTION structure specifies extra options for writing an image file.

The following functions make use of this structure:

L_FileConvert

L_CompressBitmapWithStamp

L_DeletePage

L_WriteFileTransforms

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveBitmapWithLayers

L_SaveFile

L_SaveFileMemory

L_SaveFileTile

L_SaveFileOffset

L_StartCompressBuffer

L_WriteFileCommentExt

L_WriteFileStamp

L_MrcSaveBitmap

L_MrcSaveBitmapT44

See L_GetDefaultSaveFileOption for information on default save options.

Member | Description
uStructSize | Size of the SAVEFILEOPTION structure. This should be sizeof(SAVEFILEOPTION). You must fill this member.
Flags | Any of the following flags. (You can use a bitwise OR to specify more than one value.) Also see the Flags2 member for additional flags.
 | Value | Meaning
 | ESO_REVERSEBITS | [0x00000001] Reverses the bit order when writing CCITT Group 3 and 4 files and RAW uncompressed data, so that the least significant bit (LSB) is first.
 | ESO_NOSUBFILETYPE | [0x00000002] Prevents writing a subfile type TIFF tag when writing any TIFF file.
 | ESO_GLOBALBACKGROUND | [0x00000004] Causes a GIF file to be saved with the global background color specified by the GlobalBackground field.
 | ESO_GLOBALPALETTE | [0x00000008] Causes a GIF file to be saved with the global palette specified by the GlobalPalette field.
 | ESO_INTERLACED | [0x00000010] Causes a GIF file to be saved as an interlaced file.
 | ESO_GLOBALLOOP | [0x00000020] Enables looping when loading an animated file. This flag must be on for the GlobalLoop field to be used.
 | ESO_NOPALETTE | [0x00000040] Causes a TIFF file to be saved as grayscale, without a palette.
 | ESO_SAVEWITHSTAMP | [0x00000080] Causes a CMP, JPEG, or Exif file to be saved with a stamp (thumbnail image), in addition to the normal image.
 | ESO_FIXEDPALETTESTAMP | [0x00000100] Causes a CMP or JPEG stamp image to be saved with a fixed palette.
 | ESO_YCCSTAMP | [0x00000200] Causes an Exif stamp image to be saved with YCbCr color space.
 | ESO_REPLACEPAGE | [0x00000400] Replace the page specified by PageNumber.
 | ESO_INSERTPAGE | [0x00000800] Insert the new page before the page specified by PageNumber.
 | ESO_JPEGSTAMP | [0x00001000] Save JPEG compressed stamps.
 | ESO_DISABLEMMX | [0x00002000] Do not use MMX optimized code
 | ESO_SAVEOLDJTIF | [0x00004000] Write old style JTIF files
 | ESO_NOPAGENUMBER | [0x00008000] Do not update and save the PageNumber tag associated with the pages of a multi-page TIFF file.
 | ESO_DISABLEP3 | [0x00010000] Do not use P3-specific optimized code.
 | ESO_USEIFD | [0x00020000] Use the IFD offset.
 | ESO_MOTOROLAORDER | [0x00040000] Save files in Motorola byte order when possible.
 | ESO_WITHOUTTIMESTAMP | [0x00080000] Save file without time stamp.
 | ESO_PDF_TEXT_ENCODING_NONE | [0x00000000] No text encoding is used for image data.
 | ESO_PDF_TEXT_ENCODING_ASCII_BASE85 | [0x00100000] PDF, ASCII BASE 85 text encoding is used for image data.
 | ESO_PDF_TEXT_ENCODING_ASCII_HEX | [0x00200000] PDF, ASCII HEX text encoding is used for image data.
 | ESO_PDF_ENCODING_MASK | [0x00300000] Mask of the flags is used for PDF text encoding.
 | ESO_PDF_SAVE_USE_BITMAP_DPI | [0x01000000] Use the bitmap DPI in calculating page dimensions when saving a PDF file.
 | ESO_PAD4 | [0x00400000] Each line is padded to a multiple of 4 bytes. (raw data only)
 | ESO_PLT_BEZIER_CURVES | [0x00800000] PLT filter should save bezier curves.
 | ESO_PDF_SAVE_USE_BITMAP_DPI | [0x01000000] Use bitmap DPI in calculating page dimensions when saving a PDF file.
 | ESO_PHOTOMETRICINTERPRETATIONVALID | [0x02000000] Use PhotometricInterpretation when saving TIFF files.
 | ESO_TILEINFOVALID | [0x04000000] Use the TileWidth and TileHeight members when saving TIFF files.
 | ESO_USEDITHERINGMETHOD | [0x08000000] Use the DitheringMethod in the BITMAPHANDLE.
 | ESO_PRESERVEPALETTE | [0x10000000] Preserve the palette when saving TIFF CCITT files (might decrease the compression ratio)
 | ESO_PDF_SAVE_LOW_MEMORY_USAGE | [0x20000000] Try to use less memory when creating a PDF file with JPEG or Fax compression.
 | ESO_USEPREDICTOR | [0x80000000] Use a predictor when saving LZW data. This is for TIF LZW or Raw LZW data that is 8 bpp or more. This flag is ignored if the LZW data is less than 8 bpp.
Passes | The number of passes (scans through the image) when saving a JPEG or LEAD CMP file. (This value is not used when saving interlaced PNG files.)

Possible values when saving:
Value | Meaning
Any positive number | Save the file as a progressive file with the specified number of passes.
0 | Save the file as an ordinary JPEG or LEAD CMP file (not a progressive file).
Any negative number | Save the file as a progressive file with the LEADTOOLS default number of passes.
Possible values when saving non-progressive files:
Value | Meaning
0 | Save the file with fixed Huffman tables (faster save, lower compression).
<>0 | Save the file with optimized Huffman tables (2-pass compression, lower speed, higher compression)

PageNumber | The page number of a multi-page file, which can contain more than one image. When saving a file, any value greater than 1 will cause the page to be appended to the end of the file. For more information on multi-page files refer to Multipage File Formats.
GlobalWidth | Width of images in a multi-page GIF file.
GlobalHeight | Height of images in a multi-page GIF file.
GlobalLoop | Loop count when playing an animation. Use 0 for continuous looping. For no looping, turn off the ESO_GLOBALLOOP flag in the Flags field.
GlobalBackground | Background color of images in a multi-page GIF file. This field is used only if the ESO_GLOBALBACKGROUND flag is set in the Flags field. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
GlobalPalette | Palette for images in a multi-page GIF file. This field is used only if the ESO_GLOBALPALETTE flag is set in the Flags field.
StampWidth | Width, in pixels, of the stamp image to save. A stamp is saved only if the ESO_SAVEWITHSTAMP flag is set in the Flags field.
StampHeight | Height, in pixels, of the stamp image to save. A stamp is saved only if the ESO_SAVEWITHSTAMP flag is set in the Flags field.
StampBits | Bits per pixel of the stamp image to save. A stamp is saved only if the ESO_SAVEWITHSTAMP flag is set in the Flags field.
Constrained | Flag that indicates whether the video corresponds to set standards. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) This member is valid only for MPEG-1 files. Possible values are:
 | Value | Meaning
 | TRUE | The video corresponds to set standards.
 | FALSE | The video does not correspond to set standards.
FieldPic | Flag that indicates whether to use field or frame pictures. This member is valid only for MPEG-1 files. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | TRUE | Use field pictures.
 | FALSE | Use frame pictures.

FrameRate | The frame rate code. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_FRAMERATE_23 | [1] 23.976
 | MPEG_FRAMERATE_24 | [2] 24
 | MPEG_FRAMERATE_25 | [3] 25
 | MPEG_FRAMERATE_29 | [4] 29.97
 | MPEG_FRAMERATE_30 | [5] 30
 | Note: If you are converting an existing AVI file, you can pass –1 to use the current frame rate. The frames per second of the file must be 10, 12, 15, 23.976, 24, 25, 29.97, or 30.
FramesGOP | Number of frames in a group of pictures. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.)
PelAspectRatio | The ratio of the nominal vertical height of pel on the display to its nominal vertical width. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_ASPECT_SQUARE | [1] Square pel
 | MPEG_ASPECT_4_3 | [2] 4:3
 | MPEG_ASPECT_16_9 | [3] 16:9
 | MPEG_ASPECT_2_1 | [4] 2.11:1
 | MPEG_ASPECT_625 | [8] CCIR601 625 Line
 | MPEG_ASPECT_525 | [9] CCIR601 525 Line
ProfileID | Profile. (Simple, Main, SNR, Spatial. SNR not currently supported). (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_PROFILE_SIMPLE | 5
 | MPEG_PROFILE_MAIN | 4
 | MPEG_PROFILE_SNR | 3
 | MPEG_PROFILE_SPATIAL | 2
 | MPEG_PROFILE_HIGH | 1
LevelID | Level. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_LEVEL_LOW | [10] Low
 | MPEG_LEVEL_MAIN | [8] Main
 | MPEG_LEVEL_HIGH14440 | [6] High 14440
 | MPEG_LEVEL_HIGH | [4] High
ChromaFormat | Chroma format. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | PEG_CHROMA_420 | [1] 4:2:0
 | PEG_CHROMA_422 | [2] 4:2:2
 | PEG_CHROMA_444 | [3] 4:4:4
VideoFormat | The video format. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_VIDEO_COMP | [0] Component.
 | MPEG_VIDEO_PAL | [1] PAL
 | MPEG_VIDEO_NTSC | [2] NTSC
 | MPEG_VIDEO_SECAM | [3] SECAM
 | MPEG_VIDEO_MAC | [4] MAC
 | MPEG_VIDEO_UNSP | [5] Unspecified
IntraDcPrec | DC coefficient precision for intra coded blocks. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.) Possible values are:
 | Value | Meaning
 | MPEG_INTRA_8 | [0] 8 bit
 | MPEG_INTRA_9 | [1] 9 bit
 | MPEG_INTRA_10 | [2] 10 bit
 | MPEG_INTRA_11 | [3] 11 bit
BitRate | Rate at which the compressed bitstream is delivered from the storage medium to the input of a decoder. The value is in bits per second. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.)
UserInfo[255] | User defined data to be put in an mpeg stream. (This member can only be set using the LEADTOOLS Multimedia Imaging or LEADTOOLS Multimedia Imaging Pro toolkits.)
IFD | Offset within a TIFF file where a page starts. This serves as a reference page for saving pages to a large TIFF file.
szPassword | Password for saving encrypted files
PhotometricInterpretation | (TIFF only) Photometric interpretation that should be saved in the file instead of the regular value. Used only if ESO_PHOTOMETRICINTERPRETATIONVALID is set.
TileWidth | Width of the tile to use when saving TIFF files. This value is in pixels.
TileHeight | Height of the tile to use when saving TIFF files. This value is in pixels.
Flags2 | Any of the following flags (You can use a bitwise OR to specify more than one value.) Also see the Flags member for additional flags.
 | Value | Meaning
 | ESO2_NITF | [0x00000001] Saves files compatible with NITF requirements. This flag is used internally.
 | ESO2_SAVEPLANAR | [0x00000002] Save the TIF CMYK images as planar (instead of chunky)
 | ESO2_NOLZWAUTOCLEAR | [0x00000004] Do not automatically insert CLEAR codes during LZW compression.

Comments

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

Saving a stamp image is valid for the following formats: LEAD, JFIF, LEAD2JFIF, LEAD1JFIF, FILE_EXIF, FILE_EXIF_YCC, and FILE_EXIF_JPEG. For short descriptions, refer to Formats of Output Files.

When saving a stamp image in a FILE_EXIF or FILE_EXIF_YCC file, the stamp is appended as the second page of a multi-page file.

When saving a stamp image in an Exif JPG file, the stamp size is restricted to 160x120x24. When saving Exif files, the StampWidth, StampHeight, and StampBits members of the SAVEFILEOPTION structure will be ignored and 160 (StampWidth), 120 (StampHeight) and 24 (StampBits) will be used instead. That limitation has been imposed in order to conform with the ExifR98 interoperability rules imposed by Japanese digital camera manufacturers. The save function will return an error (ERROR_INVALID_STAMP_SIZE) if you exceed any of these size limitations.

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.

When saving a stamp image in a LEAD, JFIF, LEAD2JFIF, or LEAD1JFIF file, 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 save function will return an error (ERROR_INV_RANGE) if you exceed any of these size limitations.

To load a stamp image, you must use the L_GetCompressFileStamp function.

Note: If SAVEFILE_MULTIPAGE is passed to L_SaveFile, it will take precedence over ESO_REPLACEPAGE or ESO_INSERTPAGE.

Note: If ESO_JPEGSTAMP is set, then the stamps being saved in an Exif JPEG file will be JPEG compressed. The stamps saved in uncompressed Exif TIFF files cannot be JPEG compressed. They can only be RGB or YCbCr.

By default, the ESO_NOPAGENUMBER is not set. Therefore, all TIFF files will be saved with an updated PageNumber tag. This is required for Class-F compatibility

When LEADTOOLS saves TIFF files and writes the PageNumber tag, it has to do extra processing when appending, inserting or deleting pages as follows:

1) When appending a page, the PageNumber tag of the first page is updated to reflect the change in the number of pages.

2) When inserting a page, the PageNumber tag of the pages that will be after the page being inserted will be updated top reflect the change in the page index. Also, the PageNumber tag of the first file is updated to reflect the increase in the number of pages.

3) When deleting a page (by calling L_DeletePage), the PageNumber tag of the first page is updated to reflect the change in the number of pages. Also, the PageNumber of all the pages that follow the page being deleted are updated to reflect their new index.

These updates take usually very little time. However, when inserting a page into a TIFF file that contains thousands of images, these updates might be time consuming. In that case, you can gain some speed by disabling this functionality.

If ESO_NOPAGENUMBER is set, then L_DeletePage will not update the PageNumber tag of any page.

If the ESO_NOPAGENUMBER is not set, then LEADTOOLS will write the PageNumber tag so do not call L_SetTag to set this tag (tag 297).

When saving RAW uncompressed data, the bits in each byte can be reversed by passing the ESO_REVERSEBITS flag. In addition, each line of data can be padded so that the length is a multiple of four bytes by passing the ESO_PAD4 flag. The raw data can be saved at any offset in the file by using the L_SaveFileOffset function.

Note:

For more information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

When saving TIFF files, the size of the tiles or strips saved in the file can be controlled.

Some graphic packages cannot load TIFF files unless the files are saved with a certain tile or strip size. LEADTOOLS can load files of any strip and tile size, so modifying these settings is not necessary when saving files that will be loaded with LEADTOOLS.

If ESO_TILEINFOVALID is not set, then the TileWidth and TileHeight members of the SAVEFILEOPTION structure are ignored. In this case, the bitmap will be saved like in the previous versions of LEADTOOLS.

If TileWidth is less than or equal to the bitmap width, the bitmap will be saved as tiles. If TileWidth is greater than the bitmap width, the bitmap will be saved as strips.

If the bitmap is saved as tiles, TileHeight controls the height of the tile.

If the bitmap is saved as strips, TileHeight controls the height of the strip. The image can be saved as one strip by setting TileHeight to a value greater than or equal to the bitmap height.

Note: Take care when you use the Flags and Flags2 members to not mix the placement of the flags. All the EXO_XXX flags should be set in the Flags member, while the ESO2_XXX flags should be set in the Flags2 member.

ESO2_NOLZWAUTOCLEAR can be used when saving TIFF LZW files to save 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 LEAD TIFF LZW files unless this flag is set. This flag is not set by default, which allows LEADTOOLS to insert CLEAR LZW codes and reset the LZW compression engine if the compression ratio is not adequate.


STARTDECOMPRESSDATA

typedef struct _STARTDECOMPRESSDATA
{
L_UINT uStructSize;
pBITMAPHANDLE pBitmap;
L_UINT uBitmapStructSize;
L_UINT uStripsOrTiles;
L_UINT uFormat;
L_INT nWidth;
L_INT nHeight;
L_INT nBitsPerPixel;
L_INT nViewPerspective;
L_INT nRawOrder;
L_INT nLoadOrder;
L_INT nQFactor; /* Qfactor value */
L_INT nXResolution;
L_INT nYResolution;
FILEREADCALLBACK pfnReadCallback;
RGBQUAD Palette[256];
L_UINT32 uFlags;
L_VOID * pUserData;
L_UINT32 rgbColorMask[3];
L_INT nPlanarConfig;
L_UINT32 uReserved1;
} STARTDECOMPRESSDATA, L_FAR * LPSTARTDECOMPRESSDATA;

The STARTDECOMPRESSDATA structure provides decompression to the L_StartDecompressBuffer function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
pBitmap | Pointer to the bitmap handle in which to load the image.
uBitmapStructSize | Size of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
uStripsOrTiles | Flag that indicates whether strips or tiles are being decompressed. Strips have a width equal to the bitmap width, but tiles can have a width that is less than the bitmap width. Possible values are:
 | Value | Meaning
 | DECOMPRESS_STRIPS | Decompress strips of data.
 | DECOMPRESS_TILES | Decompress tiles of data. The pfnReadCallback is not called if this option is set.
uFormat | Format of the image to decompress. Possible values are:
 | Value | Meaning
 | FILE_JPEG | JPEG file
 | FILE_RAW_RLE4 | RAW file with RLE compression, 4 bits per pixel
 | FILE_RAW_RLE8 | RAW file with RLE compression, 8 bits per pixel
 | FILE_RAW_BITFIELDS | RAW file with bitfield compression
 | FILE_RAW_PACKBITS | RAW file with packed bits compression
 | FILE_RAW_CCITT | RAW file with CCITT compression.
 | FILE_FAX_G3_1D | Fax file with G3 one-dimensional compression
 | FILE_FAX_G3_2D | Fax file with G3 two-dimensional compression
 | FILE_FAX_G4 | Fax file with G4 compression
nWidth | Bitmap width.
nHeight | Bitmap height.
nBitsPerPixel | Bits per pixel of the compressed data.
nViewPerspective | View perspective of the compressed data. Possible values are:
 | Value | Meaning
 | TOP_LEFT | Top-left of image is first in memory.
 | TOP_LEFT90 | TOP_LEFT rotated clockwise by 90 degrees.
 | TOP_LEFT180 | TOP_LEFT rotated clockwise by 180 degrees.
 | TOP_LEFT270 | TOP_LEFT rotated clockwise by 270 degrees.
 | BOTTOM_LEFT | Bottom-left of image is first in memory.
 | BOTTOM_LEFT90 | BOTTOM_LEFT rotated clockwise by 90 degrees.
 | BOTTOM_LEFT180 | BOTTOM_LEFT rotated clockwise by 180 degrees.
 | BOTTOM_LEFT270 | BOTTOM_LEFT rotated clockwise by 270 degrees
nRawOrder | Color order of 24-bit raw data. This is ignored if the image is palettized. Possible values are:
 | Value | Meaning
 | ORDER_RGB | RGB
 | ORDER_BGR | BGR
nLoadOrder | Desired color order after a 24-bit image is loaded. This is ignored if the image is palettized. Possible values are:
 | Value | Meaning
 | ORDER_RGB | RGB
 | ORDER_BGR | BGR
nXResolution | Horizontal resolution, in dots per inch.
nYResolution | Vertical resolution, in dots per inch.
pfnReadCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
Palette | Palette for uncompressed data that is 8 bits per pixel or less. Fill in the first 2BitsPerPixel entries in this palette and include DECOMPRESS_PALETTE in the uFlags field.
uFlags | Flags that affect the decompression process. Possible values are:
 | Value | Meaning
 | DECOMPRESS_LSB | Fill the least significant bit first.
 | DECOMPRESS_PAD4 | Pad each line to a multiple of 4 bytes.
 | DECOMPRESS_PALETTE | A palette is supplied in the rgbQuad field.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
rgbColorMask | An array of L_UINT32 values that represent RGB color masks. rgbColorMask[0] is the red mask; rgbColorMask[1] is the green mask; rgbColorMask[2] is the blue mask. This field is valid only if uFormat is FILE_RAW_BITFIELDS.
nPhotoInt | Value that represents color information. Possible values are:
 | Value | Meaning
 | For FILE_RAW_CCITT |
 | FILE_RAW_G3_1D, |
 | FILE_RAW_G3_2D and |
 | FILE_FAX_G4 |
 | 0 | White is zero
 | 1 | Black is zero
 | For FILE_RAW_PACKBITS: |
 | 2 | There is no color map (RGB)
 | 5 | Separated CMYK
 | 6 | YC b C r color space
 | 8 | 1976 CIE L*a*b
uPlanarConfig | Planar configuration. This value is used only if uFormat is FILE_RAW_PACKBITS. Otherwise, it is ignored. Possible values are:
 | Value | Meaning
 | 1 | Chunky
 | 2 | Planar format
uReserved1 | Reserved for future use. Pass 0.

Comments

As an example, with 16-bit data arranged as RRR RRGG GGGB BBBB, the
 masks would be
rgbColorMask[0] = 0x7C00
rgbColorMask[1] = 0x0E30
rgbColorMask[2] = 0x001F

For 32-bit data, the only valid data is RRRR RRRR GGGG GGGG BBBB BBBB.
 The masks would be:
rgbColorMask[0] = 0xFF0000
rgbColorMask[1] = 0x00FF00
rgbColorMask[2] = 0x0000FF

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


THUMBOPTIONS

typedef struct thumboptions
{
L_UINT uStructSize;
L_INT nThumbWidth; /* thumbnail width */
L_INT nThumbHeight; /* thumbnail height */
L_INT nBits; /* thumbnail bits per pixel */
L_UINT32 uCRFlags; /* color resolution flags */
L_BOOL bMaintainAspect; /* aspect ratio flag */
L_BOOL bForceSize; /* force size flag */
COLORREF crBackColor; /* background color */
L_BOOL bLoadStamp; /* load stamp flag */
L_BOOL bResample; /* resample flag */
} THUMBOPTIONS, L_FAR * pTHUMBOPTIONS;

The THUMBOPTIONS structure is used by L_CreateThumbnailFromFile to specify the thumbnail creation options.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
nThumbWidth | Width of the thumbnail to create. This value is measured in pixels.
nThumbHeight | Height of the thumbnail to create. This value is measured in pixels.
nBits | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Default bits per pixel stored in the file
 | 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
uCRFlags | Flags that will be passed to L_ColorResBitmap internally when bForceSize is True, bMaintainAspect is 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. The resulting bitmap is then returned to the thumbnail image's original bit-depth using uCRFlags. For a list of possible values, refer to the uFlags parameter of L_ColorResBitmap.
bMaintainAspect | Flag that indicates whether the aspect ratio of the image should be maintained when creating the thumbnail. When set to TRUE, the generated thumbnail's width and height will not match both nThumbWidth and nThumbHeight if the original aspect ratio was not 1:1. If you desire the thumbnail be generated with exactly the requested width and height while still maintaining the aspect ratio of the actual image, set both bMaintainAspect and bForceSize to TRUE.
bForceSize | Flag that indicates whether the generated thumbnail should be forced to the requested size, even if bMaintainAspect is set to TRUE. If bForceSize is 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 parameter is ignored if bMaintainAspect is FALSE.
crBackColor | Background color to use if both bForceSize and bMaintainAspect are TRUE.
bLoadStamp | Flag that indicates whether or not to attempt to load stamps from file formats that support preview images. Possible values are:
 | Value | Meaning
 | TRUE | Attempt to load stamps.
 | FALSE | Do not attempt to load stamps.
bResample | Flag that indicates whether or not to use interpolated resize when generating thumbnails. Possible values are:
 | Value | Meaning
 | TRUE | Use interpolated resize.
 | FALSE | Do not use interpolated resize.

Comments

If the bLoadStamp member of this structure is set to TRUE when L_CreateThumbnailFromFile is called and the file does not contain a stamp, then an error will be returned.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.


WINDOWS Structures

COLORREF

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

HCURSOR

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

HICON

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

HWND

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

LPCSTR

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

LPRECT

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

OPENFILENAME

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


ICC_CHANNEL_COORD

typedef struct __ICC_CHROMATICITY_CHANNELS
{
L_IccU16Fixed16Number Coords[2];
} ICC_CHANNEL_COORD, L_FAR * pICC_CHANNEL_COORD;

The ICC_CHANNEL_COORD structure is used to save xy coordinate values.

Member | Description
Coords | Pointer to an array that contains the xy coordinate values of the channels.


ICC_CHROMATICITY

typedef struct __ICC_CHROMATICITY
{
L_IccUInt16Number uChannelsCount;
L_UINT32 uColorantType;
pICC_CHANNEL_COORD pChannels;
} ICC_CHROMATICITY, L_FAR * pICC_CHROMATICITY;

The ICC_CHROMATICITY structure is used to save ChromaticityType data.

Member | Description
uChannelsCount | Number of device channels.
uColorantType | Encoded value of phosphor or colorant type. For a list of possible values, refer to ICCCOLORANTTYPE.
pChannels | Pointer to an ICC_CHANNEL_COORD structure that contains the CIE xy coordinate values of the channels.


ICC_COLORANT_TABLE_DATA

typedef struct __ICC_COLORANTTABLEDATA
{
L_Icc7BitAscii pColorantName[32];
L_IccUInt16Number uPCSValue[3];
} ICC_COLORANT_TABLE_DATA, L_FAR * pICC_COLORANT_TABLE_DATA;

The ICC_COLORANT_TABLE_DATA structure is used to save ColorantTableType data.

Member | Description
pColorantName | Pointer to an array of 32 bytes that contains the colorant name (null terminated).
uPCSValue | PCS values of the colorant in the color space of the profile.


ICC_CURVE

typedef struct __ICCCURVE
{
L_IccUInt32Number uCurveCount;
L_IccUInt16Number L_FAR * pCurveData;
} ICC_CURVE, L_FAR * pICC_CURVE;

The ICCTAG_CURVE_TYPE structure is used to save CurveType data.

Member | Description
uCurveCount | Number of entries in the buffer pointed to by pCurveData
pCurveData | Pointer to a buffer that contains the actual curve data.


ICC_CURVE_STRUCTURE

typedef struct __ICC_CURVESTRUCTURE
{
L_UINT32 uMeasurementSig;
L_IccUInt32Number L_FAR * pMeasurementCount;
pICC_XYZ_NUMBER pMeasOfPatch;
pICC_RESPONSE_ARRAYS pRespArrays;
} ICC_CURVE_STRUCTURE, L_FAR * pICC_CURVE_STRUCTURE;

The ICC_CURVE_STRUCTURE structure is used to save curve data.

Member | Description
uMeasurementSig | A value that indicates the measurement unit signature. For a list of possible values, refer to ICCMEASUREMENTSIGNATURE.
pMeasurementCount | Pointer to a buffer that contains the number of measurements for each channel. There is one entry for each channel.
pMeasOfPatch | Pointer to an array of ICC_XYZ_NUMBER structures with number-of-channels measurements of patch with the maximum colorant value. PCS values are relative colorimetric. For more information on the "number-of-channels measurements of patch with the maximum colorant value", refer to www.color.org.
pRespArrays | Pointer to an array of ICC_RESPONSE_ARRAYS structures. There is one structure for each channel.


ICC_DATA

typedef struct __ICCDATA
{
L_UINT32 uDataFlag;
L_Icc7BitAscii L_FAR * pData;
L_UINT uDataElementsCount;
} ICC_DATA, L_FAR * pICC_DATA;

The ICC_DATA structure is used to save DataType data.

Member | Description
uDataFlag | A value that indicates the function type. For a list of possible values, refer to ICCDATATYPEFLAGS.
pData | Pointer to a buffer that contains the tag data.
uDataElementsCount | Number of data elements in the buffer pointed to by pData.


ICC_DATE_TIME_NUMBER

typedef struct __ICCDATETIME
{
L_IccUInt16Number uYear;
L_IccUInt16Number uMonth;
L_IccUInt16Number uDay;
L_IccUInt16Number uHours;
L_IccUInt16Number uMinutes;
L_IccUInt16Number uSeconds;
} ICC_DATE_TIME_NUMBER, L_FAR * pICC_DATE_TIME_NUMBER;

The ICC_DATE_TIME_NUMBER structure is used to save DateTimeType data.

Member | Description
uYear | Number of the year (actual year, e.g. 1994).
uMonth | Number of the month (1-12).
uDay | Number of the day of the month (1-31).
uHours | Number of hours (0-23).
uMinutes | Number of minutes (0-59).
uSeconds | Number of seconds (0-59).

Comments

All the ICC_DATE_TIME_NUMBER values in a profile are in Coordinated Universal Time (UTC, also known as GMT or ZULU Time). Profile writers are required to convert local time to UTC when setting these values.


ICC_LUT16

typedef struct __ICCLUT16
{
L_IccUInt8Number uInputChan;
L_IccUInt8Number uOutputChan;
L_IccUInt8Number uClutPoints;
L_IccUInt8Number uPad;
L_IccS15Fixed16Number nE00;
L_IccS15Fixed16Number nE01;
L_IccS15Fixed16Number nE02;
L_IccS15Fixed16Number nE10;
L_IccS15Fixed16Number nE11;
L_IccS15Fixed16Number nE12;
L_IccS15Fixed16Number nE20;
L_IccS15Fixed16Number nE21;
L_IccS15Fixed16Number nE22;
L_IccUInt16Number uInputEnt;
L_IccUInt16Number uOutputEnt;
L_IccUInt16Number L_FAR * pInputTables;
L_IccUInt16Number L_FAR * pCLUT;
L_IccUInt16Number L_FAR * pOutputTables;
} ICC_LUT16, L_FAR * pICC_LUT16;

The ICC_LUT16 structure is used to save lut16Type data.

Member | Description
uInputChan | Number of input channels.
uOutputChan | Number of output channels.
uClutPoints | Number of CLUT grid points (identical for each side).
uPad | Reserved for padding, must be set to zero.
nE00 | Encoded E00 parameter.
nE01 | Encoded E01 parameter.
nE02 | Encoded E02 parameter.
nE10 | Encoded E10 parameter.
nE11 | Encoded E11 parameter.
nE12 | Encoded E12 parameter.
nE20 | Encoded E20 parameter.
nE21 | Encoded E21 parameter.
nE22 | Encoded E22 parameter.
uInputEnt | Number of input table entries.
uOutputEnt | Number of output table entries.
pInputTables | Pointer to a buffer that contains input tables.
pCLUT | Pointer to a buffer that contains CLUT values.
pOutputTables | Pointer to a buffer that contains output tables.


ICC_LUT8

typedef struct __ICCLUT8
{
L_IccUInt8Number uInputChan;
L_IccUInt8Number uOutputChan;
L_IccUInt8Number uClutPoints;
L_IccUInt8Number uPad;
L_IccS15Fixed16Number nE00;
L_IccS15Fixed16Number nE01;
L_IccS15Fixed16Number nE02;
L_IccS15Fixed16Number nE10;
L_IccS15Fixed16Number nE11;
L_IccS15Fixed16Number nE12;
L_IccS15Fixed16Number nE20;
L_IccS15Fixed16Number nE21;
L_IccS15Fixed16Number nE22;
L_IccUInt16Number uInputEnt;
L_IccUInt16Number uOutputEnt;
L_IccUInt8Number L_FAR * pInputTables;
L_IccUInt8Number L_FAR * pCLUT;
L_IccUInt8Number L_FAR * pOutputTables;
} ICC_LUT8, L_FAR * pICC_LUT8;

The ICC_LUT8 structure is used to save Lut8Type data.

Member | Description
uInputChan | Number of input channels.
uOutputChan | Number of output channels.
uClutPoints | Number of CLUT grid points (identical for each side).
uPad | Reserved for padding, must be set to zero.
nE00 | Encoded E00 parameter.
nE01 | Encoded E01 parameter.
nE02 | Encoded E02 parameter.
nE10 | Encoded E10 parameter.
nE11 | Encoded E11 parameter.
nE12 | Encoded E12 parameter.
nE20 | Encoded E20 parameter.
nE21 | Encoded E21 parameter.
nE22 | Encoded E22 parameter.
uInputEnt | Number of input table entries.
uOutputEnt | Number of output table entries.
pInputTables | Pointer to a buffer that contains input tables.
pCLUT | Pointer to a buffer that contains CLUT values.
pOutputTables | Pointer to a buffer that contains output tables.


ICC_MATRIX

typedef struct _MATRIX
{
L_IccS15Fixed16Number pElement[12];
} ICC_MATRIX, L_FAR * pICC_MATRIX;

The ICC_MATRIX structure is used to save matrix data.

Member | Description
pElement | Pointer to a buffer that contains matrix data to be used in ICCTAG_LUT_A_TO_B_TYPE or ICCTAG_LUT_B_TO_A_TYPE tags.


ICC_MEASUREMENT

typedef struct __ICCMEASUREMENT
{
L_UINT32 uStdObserver;
ICC_XYZ_NUMBER Backing;
L_UINT32 uGeometry;
L_UINT32 uFlare;
L_UINT32 uIlluminant;
} ICC_MEASUREMENT, L_FAR * pICC_MEASUREMENT;

The ICC_MEASUREMENT structure is used to save MeasurementType tag type data.

Member | Description
uStdObserver | A value that represents the standard observer. For a list of possible values, refer to ICCSTANDARDOBSERVER.
Backing | A value that represents XYZ tristimulus values for measurement backing.
uGeometry | A value that represents the measurement geometry. For a list of possible values, refer to ICCMEASUREMENTGEOMETRY.
uFlare | A value that represents the measurement flare. For a list of possible values, refer to ICCMEASUREMENTFLARE.
uIlluminant | A value that represents the standard illuminant. For a list of possible values, refer to ICCSTANDARDILLUMINANT.


ICC_MULTI_LOCALIZED_UNICODE

typedef struct __ICC_MULTILOCALIZEDUNICODE
{
L_IccUInt32Number uNameRecordsCount;
L_IccUInt32Number uNameRecordSize;
pICC_NAME_RECORD pNameRecordsData;
L_Icc7BitAscii L_FAR * pUnicodeCharacters;
} ICC_MULTI_LOCALIZED_UNICODE, L_FAR * pICC_MULTI_LOCALIZED_UNICODE;

The ICC_MULTI_LOCALIZED_UNICODE structure is used to save MultiLocalizedUnicodeType tag data.

Member | Description
uNameRecordsCount | A value that represents the number of name records in the buffer pointed to by pNameRecordsData.
uNameRecordSize | A value that represents the length, in bytes, of each name record in the buffer pointed to by pNameRecordsData.
pNameRecordsData | Pointer to an ICC_NAME_RECORD structure that contains name record data.
pUnicodeCharacters | Pointer to a buffer of unicode characters.


ICC_NAME_RECORD

typedef struct __ICC_NAME_RECORD
{
L_IccUInt16Number uNameLangCode;
L_IccUInt16Number uNameCountryCode;
L_IccUInt32Number uNameLength;
L_IccUInt32Number uNameOffset;
} ICC_NAME_RECORD, L_FAR * pICC_NAME_RECORD;

The ICC_NAME_RECORD structure is used to save name record data.

Member | Description
uNameLangCode | A value that represents the name language code from ISO-639.
uNameCountryCode | A value that represents the name country code from ISO-13166.
uNameLength | A value that represents the name length, in bytes.
uNameOffset | A value that represents the name offset from the start of the tag in bytes.


ICC_NAMED_COLOR2

typedef struct __ICCNAMEDCOLOR2
{
L_IccUInt32Number uVendorFlag;
L_IccUInt32Number uNamedColorsCount;
L_IccUInt32Number uDeviceCoordsCount;
L_Icc7BitAscii pPrefix[32];
L_Icc7BitAscii pSuffix[32];
pICC_NAMED_COLOR2_DATA pNamedColors;
} ICC_NAMED_COLOR2, L_FAR * pICC_NAMED_COLOR2;

The ICC_NAMED_COLOR2 structure is used to save named color 2 tag type data.

Member | Description
uVendorFlag | A value that indicates a vendor specific flag.
uNamedColorsCount | A value that indicates the number of named colors.
uDeviceCoordsCount | A value that indicates the number of device coordinates for each name color.
pPrefix | Pointer to a buffer that contains a prefix for each color name. This is a 32-byte field that includes null termination.
pSuffix | Pointer to a buffer that contains a suffix for each color name. This is a 32-byte field that includes null termination.
pNamedColors | Pointer to an ICC_NAMED_COLOR2_DATA structure that contains the named color’s data.


ICC_NAMED_COLOR2_DATA

typedef struct __ICC_NAMEDCOLORDATA
{
L_Icc7BitAscii uColorRootName[32];
L_IccUInt16Number uColorPCSCoord[3];
L_IccUInt16Number L_FAR * uColorDeviceCoord;
} ICC_NAMED_COLOR2_DATA, L_FAR * pICC_NAMED_COLOR2_DATA;

The ICC_NAMED_COLOR2_DATA structure is used to save a named color’s data.

Member | Description
uColorRootName | Array that contains the color root name. This is a 32-byte field including null termination.
uColorPCSCoord | Array that contains the named color’s PCS encoding.
uColorDeviceCoord | Pointer to a buffer that contains the named color’s device coordinates.


ICC_PARAMETRIC_CURVE

typedef struct __ICCPARAMETRICCURVE
{
L_UINT32 uFunctionType;
L_IccUInt8Number uReserved[2];
L_IccS15Fixed16Number L_FAR * pParameters;
} ICC_PARAMETRIC_CURVE, L_FAR * pICC_PARAMETRIC_CURVE;

The ICC_PARAMETRIC_CURVE structure is used to save parametric curve tag data.

Member | Description
uFunctionType | A value that indicates the function type. For a list of possible values, refer to ICCFUNCTIONTYPE.
uReserved | Reserved. Must be set to 0.
pParameters | A pointer to a buffer that contains one or more parameters for the function specified in uFunctionType. For more information on the functions and their parameters, refer to www.color.org.


ICC_PROFILE_DESC

typedef struct __ICCPROFILEDESC
{
L_IccUInt32Number DevManufacturerSig;
L_IccUInt32Number DevModelSig;
L_IccUInt8Number DevAttributes[8];
L_IccUInt32Number DevTechInfo;
ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE DevManufacturerDesc;
ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE DevModelDesc;
} ICC_PROFILE_DESC, L_FAR * pICC_PROFILE_DESC;

The ICC_PROFILE_SEQ_DESC structure is used to save profile description structures data.

Member | Description
DevManufacturerSig | A value that indicates the device manufacturer's signature. This is from the corresponding profile’s header information.
DevModelSig | A value that indicates the device model signature. This is from the corresponding profile’s header information.
DevAttributes | A value that indicates the attributes. This is from the corresponding profile’s header information.
DevTechInfo | A value that indicates the device technology information such as CRT, Dye Sublimation, etc. This corresponds to profile’s technology signature.
DevManufacturerDesc | An ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure that contains a displayable description of the device manufacturer. (profile’s deviceMfgDescTag) For information on the profile's deviceMfgDescTag, refer to www.color.org.
DevModelDesc | An ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure that contains the displayable description of the device model (profile’s deviceModelDescTag). For information on the profile's deviceModelDescTag, refer to www.color.org.


ICC_PROFILE_SEQ_DESC

typedef struct __ICCPROFILESEQDESC
{
L_IccUInt32Number uCount;
pICC_PROFILE_DESC pProfDescription;
} ICC_PROFILE_SEQ_DESC, L_FAR * pICC_PROFILE_SEQ_DESC;

The ICC_PROFILE_SEQ_DESC structure is used to save profile description structures data.

Member | Description
uCount | A value that indicates the number of description structures in the buffer pointed to by pProfileDescription.
pProfDescription | Pointer to an ICC_PROFILE_DESC structure that contains the profile description data.


ICC_RESPONSE_16_NUMBER

typedef struct __RESPONSE16NUMBER
{
L_IccUInt16Number uDeviceCode;
L_IccUInt16Number uReserved;
L_IccS15Fixed16Number uMeasurement;
} ICC_RESPONSE_16_NUMBER, L_FAR * pICC_RESPONSE_16_NUMBER;

The ICC_RESPONSE_16_NUMBER structure is used to save response arrays data.

Member | Description
uDeviceCode | 16-bit number in the interval [DeviceMin to DeviceMax].
uReserved | Reserved. Must be set to zero.
uMeasurement | Measurement value.

Comments

Note that DeviceMin is encoded as 000h, and DeviceMax is encoded as FFFh.


ICC_RESPONSE_ARRAYS

typedef struct __ICC_RESPONSEARRAYS
{
pRESPONSE_16_NUMBER pResponseNumber;
} ICC_RESPONSE_ARRAYS, L_FAR * pICC_RESPONSE_ARRAYS;

The ICC_RESPONSE_ARRAYS structure is used to save response arrays data.

Member | Description
pResponseNumber | Pointer to one or more RESPONSE_16_NUMBER structures that contain measurement information for each channel.


ICC_RESPONSE_CURVE

typedef struct __ICC_RESPONSECURVE
{
L_IccUInt16Number uChannelsCount;
L_IccUInt16Number uMeasurementTypesCount;
L_IccUInt32Number L_FAR * pResponseDataOffsets;
pICC_CURVE_STRUCTURE pCurveStructure;
} ICC_RESPONSE_CURVE, L_FAR * pICC_RESPONSE_CURVE;

The ICC_RESPONSE_CURVE structure is used to save a ResponseCurveSet16Type Tag.

Member | Description
uChannelsCount | Non-negative value that indicates the number of channels.
uMeasurementTypesCount | Non-negative value that indicates the number of measurement types.
pResponseDataOffsets | A pointer to a buffer of offsets, each relative to byte 0 of this structure, with one entry for each measurement type. Each will point to the response data for the measurement unit.
pCurveStructure | A pointer to an ICC_CURVE_STRUCTURE structure that contains the curve data.


ICC_VIEW_COND

typedef struct __ICC_VIEWCOND
{
ICC_XYZ_NUMBER AbsIlluminant;
ICC_XYZ_NUMBER AbsSurround;
L_UINT32 uIlluminantType;
} ICC_VIEW_COND, L_FAR * pICC_VIEW_COND;

The ICC_VIEW_COND structure is used to save viewing condition parameters.

Member | Description
AbsIlluminant | CIE ‘absolute’ XYZ values for illuminant (in which Y is in cd/m2)
AbsSurround | CIE ‘absolute’ XYZ values for surround (in which Y is in cd/m2)
uIlluminantType | A value that represents the illuminant type. For a list of possible values, refer to ICCSTANDARDILLUMINANT.

Comments

The viewing condition described in this tag is the actual viewing condition assumed for the media for which the profile is defined, specified in CIE ‘absolute’ units. Note that the luminanceTag must be the same as the Y value given in this tag. For more information on the "luminanceTag", refer to the ICC web site (www.color.org).


ICC_XYZ_ARRAY

typedef struct __ICCXYZ_ARRAY
{
pICC_XYZ_NUMBER XYZData;
} ICC_XYZ_ARRAY, L_FAR * pICC_XYZ_ARRAY;

The ICC_XYZ_ARRAY structure is used to save XYZ color space data.

Member | Description
XYZData | Array of XYZ numbers.


ICC_XYZ_NUMBER

typedef struct __ICCXYZ
{
L_IccS15Fixed16Number nX;
L_IccS15Fixed16Number nY;
L_IccS15Fixed16Number nZ;
} ICC_XYZ_NUMBER, L_FAR * pICC_XYZ_NUMBER;

The ICC_XYZ_NUMBER structure is used to save XYZ color space data.

Member | Description
nX | A value that represents the X tristimulus value of an XYZ color space.
nY | A value that represents the Y tristimulus value of an XYZ color space.
nZ | A value that represents the Z tristimulus value of an XYZ color space.


ICCCOLORANTTYPE

typedef enum

{
UnknownColorant = 0x0000L,
ITU_R_BT709 = 0x0001L,
SMPTE_RP145_1994 = 0x0002L,
EBU_TECH3213_E = 0x0003L,
P22 = 0x0004L
} ICCCOLORANTTYPE;

This enumerated type is used within the ICC_CHROMATICITY structure to indicate phosphor or colorant type.


ICCCOLORSPACE

typedef enum
{
XYZData = 0x58595A20L, /* 'XYZ ' */
LabData = 0x4C616220L, /* 'Lab ' */
LuvData = 0x4C757620L, /* 'Luv ' */
YCbCrData = 0x59436272L, /* 'YCbr' */
YxyData = 0x59787920L, /* 'Yxy ' */
RgbData = 0x52474220L, /* 'RGB ' */
GrayData = 0x47524159L, /* 'GRAY' */
HsvData = 0x48535620L, /* 'HSV ' */
HlsData = 0x484C5320L, /* 'HLS ' */
CmykData = 0x434D594BL, /* 'CMYK' */
CmyData = 0x434D5920L, /* 'CMY ' */
ColorData2 = 0x32434C52L, /* '2CLR' */
ColorData3 = 0x33434C52L, /* '3CLR' */
ColorData4 = 0x34434C52L, /* '4CLR' */
ColorData5 = 0x35434C52L, /* '5CLR' */
ColorData6 = 0x36434C52L, /* '6CLR' */
ColorData7 = 0x37434C52L, /* '7CLR' */
ColorData8 = 0x38434C52L, /* '8CLR' */
ColorData9 = 0x39434C52L, /* '9CLR' */
ColorData10 = 0x41434C52L, /* 'ACLR' */
ColorData11 = 0x42434C52L, /* 'BCLR' */
ColorData12 = 0x43434C52L, /* 'CCLR' */
ColorData13 = 0x44434C52L, /* 'DCLR' */
ColorData14 = 0x45434C52L, /* 'ECLR' */
ColorData15 = 0x46434C52L /* 'FCLR' */
} ICCCOLORSPACE;

This enumerated type is used within the ICC_HEADER structure to indicate the color space.


ICCDATATYPEFLAGS

typedef enum

{
ASCII = 0x00000000L,
Binary = 0x00000001L,
} ICCDATATYPEFLAGS;

This enumerated type is used within the ICC_DATA structure to indicate which data type is used.


ICCFUNCTIONTYPE

typedef enum
{
Func4Bytes = 0x0000L, /* Y = X^(gamma) */
Func12Bytes = 0x0001L, /* Y = (aX + b) ^ (gamma), (X >= -b/a)
Y = 0 , (X < - b/a) */
Func16Bytes = 0x0002L, /* Y = (aX + b)^(gamma) + c, (X >= -b/a)
Y = c , (X < -b/a) */
Func20Bytes = 0x0003L, /* Y = (aX + b)^(gamma), (X >= -b/a)
Y = cX , (X < -b/a) */
Func28Bytes = 0x0004L/* Y = (aX + b)^(gamma) + e, (X >= -b/a)
Y = (cX + f) , (X < -b/a) */
} ICCFUNCTIONTYPE;

This type is used within the ICC_PARAMETRIC_CURVE structure to indicate the function type.


ICCHEADER

typedef struct __ICCHEADER
{
L_IccUInt32Number uSize;
L_IccSignature nCmmID;
L_IccUInt32Number uVersion;
L_UINT32 uDeviceClass;
L_UINT32 uColorSpace;
ICCCOLORSPACE enPCS;
ICC_DATE_TIME_NUMBER DateTime;
L_IccSignature nProfileSignature;
L_UINT32 uPlatform;
L_IccUInt32Number uFlags;
L_IccSignature nManufacturer;
L_IccUInt32Number uModel;
L_IccUInt64Number uAttributes;
L_UINT32 uRenderingIntent;
ICC_XYZ_NUMBER Illuminant;
L_IccSignature nCreator;
L_IccUInt8Number uProfileID[16];
L_IccUInt8Number uReserved[28];
} ICCHEADER, L_FAR * pICCHEADER;

The ICCHEADER structure is used to save all the information and data about an ICC profile header.

Member | Description
uSize | A value that indicates the size of the ICC profile in bytes.
nCmmID | A value that indicates the Color Management Module for the profile.
uVersion | A value that indicates the version of the ICC profile.
uDeviceClass | A value that indicates the device class profile of the ICC profile. For a list of possible values, refer to ICCPROFILECLASS.
uColorSpace | A value that indicates the color space used for the ICC profile. For a list of possible values, refer to ICCCOLORSPACE.
enPCS | A value that indicates the color space used for the Profile Connection Space. For a list of possible values, refer to ICCCOLORSPACE.
DateTime | A pointer to ICC_DATE_TIME_NUMBER structure that contains the date and time of creation of the ICC profile.
nProfileSignature | A value that indicates the profile signature.
uPlatform | A value that indicates the primary platform for which the ICC profile was created. For a list of possible values, refer to ICCPLATFORMSIGNATURE.
uFlags | Flags that indicate if the ICC profile is embedded, and if the ICC profile can be used independently from the embedded color data. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate if the ICC profile is embedded or not:
 | Value | Meaning
 | ICC_EMBEDDED_PROFILE_FALSE | [0x00000000] ICC profile is not embedded
 | ICC_EMBEDDED_PROFILE_TRUE | [0x00000001] ICC profile is embedded
 | The following flags indicate if the ICC profile can be used independently from the embedded color data or not:
 | Value | Meaning
 | ICC_USE_ANYWHERE | [0x00000000] ICC profile can be used independently
 | ICC_USE_WITH_EMBEDDED_DATA_ONLY | [0x00000002] ICC profile cannot be used independently
nManufacturer | A value that indicates the device manufacturer for the device for which the ICC profile was created.
uModel | A value that indicates the model of the device for which the ICC profile was created.
uAttributes | Flags that identify attributes unique to a particular device. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate the transparency of the media:
 | Value | Meaning
 | ICC_REFLECTIVE | [0x0000000000000000] Reflective media
 | ICC_TRANSPARENCY | [0x0000000000000001] Transparent media
 | The following flags indicate if the media is glossy or matte:
 | Value | Meaning
 | ICC_GLOSSY | [0x0000000000000000] Glossy media
 | ICC_MATTE | [0x0000000000000002] Matte media
 | The following flags indicate media polarity:
 | Value | Meaning
 | ICC_MEDIA_POLARITY_POSITIVE | [0x0000000000000000] Positive media polarity
 | ICC_MEDIA_POLARITY_NEGATIVE | [0x0000000000000004] Negative media polarity
 | The following flags indicate if the media is colored or not:
 | Value | Meaning
 | ICC_COLOR_MEDIA | [0x0000000000000000] Color media
 | ICC_BLACK_AND_WHITE | [0x0000000000000008] Black and white media
uRenderingIntent | A value that indicates the rendering intent. For a list of possible values, refer to ICCRENDERINGINTENT.
Illuminant | A pointer to ICC_XYZ_NUMBER structure that indicates the CIEXYZ values of the illuminant used for the profile connection space.
nCreator | A value that identifies the creator of the ICC profile.
uProfileID | An array that contains 16 byte values generated using an MD5 algorithm. This indicates a checksum value for the ICC profile.
uReserved | An array of reserved bytes for the ICC organization.

Comments

The nCmmID value must match a CMM type signature registered in the ICC registry. If no preferred CMM is identified, this field is set to zero (00000000h). The registration authority for this data is the ICC Technical Secretary. Set the ICC web site (www.color.org) for contact information.

The uVersion contains the value ICC_PROFILE_VER42 for ICC version 4.2.0.0 over which this ICC profile structure and all the functions associated with it was built.

For all profile classes, other than a device link profile, the profile connection space field enPCS is either XYZDATA or LABDATA. When the device class is a device link profile, the value of the profile connection space must be an appropriate color space from the list in ICCCOLORSPACE.

The nProfileSignature contains the fixed value of ICC_PROFILE_SIG. Please note that ICC_PROFILE_SIG is the actual value that is always used for the nProfileSignature member.

If there is no primary platform identified, enPlatform is set to NOPLATFORM.

The nManufacturer and uModel values must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used, this field is set to zero (00000000h).

For the Illuminant field, the only illuminant permitted for the profile connection space is D50 (where X=0.9642; Y=1.0 and z=0.8249).

The nCreator value must match the signature contained in the device manufacturer section of the ICC signature registry found at (www.color.org). If not used, this field is set to zero (00000000h).

The uProfileID value is generated using the MD5 fingerprinting method as defined in the Internet RFC 1321. If it has not been calculated, the value of the uProfileID is set to zero (00000000h).

The uReserved member is reserved for future ICC definition and is set to zero (00000000h).


ICCMEASUREMENTFLARE

typedef enum
{
Flare0 = 0x00000000L, /* 0% flare */
Flare100 = 0x00010000L/* 100% flare */
} ICCMEASUREMENTFLARE;

This type is used within the ICC_MEASUREMENT structure to indicate the measurement flare.


ICCMEASUREMENTGEOMETRY

typedef enum
{
GeometryUnknown = 0x00000000L, /* Unknown */
Geometry045or450 = 0x00000001L, /* 0/45, 45/0 */
Geometry0dord0 = 0x00000002L/* 0/d or d/0 */
} ICCMEASUREMENTGEOMETRY;

This type is used within the ICC_MEASUREMENT structure to indicate the measurement geometry.


ICCMEASUREMENTSIGNATURE

typedef enum

{
StaA = 0x53746141L,
StaE = 0x53746145L,
StaI = 0x53746149L,
StaT = 0x53746154L,
StaM = 0x5374614DL,
DN = 0x434E2020L,
DN_P = 0x434E2050L,
DNNP = 0x434E4E50L
} ICCMEASUREMENTSIGNATURE;

This type is used within the ICC_CURVE_STRUCTURE structure to indicate the curve measurement signature.


ICCPLATFORMSIGNATURE

typedef enum
{
NoPlatformSignature = 0x00000000L, /* No Platform Signature */
MacintoshSignature = 0x4150504CL, /* 'APPL' */
MicrosoftSignature = 0x4D534654L, /* 'MSFT' */
SolarisSignature = 0x53554E57L, /* 'SUNW' */
SGISignature = 0x53474920L /* 'SGI ' */
} ICCPLATFORMSIGNATURE;

This enumerated type is used within the ICC_HEADER structure to indicate the primary platform.


ICCPROFILECLASS

typedef enum
{
InputClassv = 0x73636E72L, /* 'scnr' */
DisplayClass = 0x6D6E7472L, /* 'mntr' */
OutputClass = 0x70727472L, /* 'prtr' */
DeviceLinkClass = 0x6C696E6BL, /* 'link' */
AbstractClass = 0x61627374L, /* 'abst' */
ColorSpaceClass = 0x73706163L, /* 'spac' */
NamedColorClass = 0x6E6D636CL /* 'nmcl' */
} ICCPROFILECLASS;

This enumerated type is used within the ICC_HEADER structure to indicate the profile class.


ICCPROFILEEXT

typedef struct __ICCPROFILE
{
L_UINT uStructSize;
L_UINT uDataSize;
L_UINT uTagDataSize;
ICCHEADER IccHeader;
ICCTAG_LIST tagList;
L_UCHAR L_FAR * pTagData;
L_UCHAR L_FAR * pData;
} ICCPROFILEEXT, L_FAR * pICCPROFILEEXT;

The ICCPROFILEEXT structure is used to save all the information and data about an ICC profile.

Member | Description
uStructSize | Size of the structure in bytes. Use the sizeof operator to calculate this value.
uDataSize | A value that indicates the size of the pData pointer in bytes.
uTagDataSize | A value that indicates the size of the pTagData pointer in bytes.
IccHeader | A pointer to an ICCHEADER structure that has all the ICC header’s data.
tagList | A pointer to an ICCTAG_LIST structure that contains information and data about all the tags in the ICC profile.
pTagData | A pointer to a buffer that contains all the tags' data.
pData | A pointer to a buffer that contains all the ICC profile’s data.

Comments

The data in all the fields is converted into little Indian format, except for the data in the pTagData and the pData pointers. The user doesn’t need to access the data in the pData and pTagData pointers directly. The ICC defined functions provide access to the data in them. Consequently, the data in these two members are kept in big Indian format.

When loading an existing ICC profile (one that has been saved to either an image file or an ICC profile file) into this structure, the pData member will contain all the profile data in one block of memory, and the pTagData member will contain only the tags data in one block of memory. The uDataSize member contains the size of the pData pointer which is the ICC profile’s size, and the uTagDataSize member contains the size of the pTagData pointer.

When creating a new ICC profile, or modifying an existing one, the pTagData and uTagDataSize are constantly updated, so they will always contain the correct information for the profile. However, the pData and uDataSize will not contain the correct information until after the L_GenerateICCPointer function has been called. The L_GenerateICCPointer function generates the pData pointer to the updated profile information and fills in the uDataSize member with the updated value.


ICCRENDERINGINTENT

typedef enum
{
Perceptual = 0x00000000,
RelativeColorimetric = 0x00000001,
Saturation = 0x00000002,
AbsoluteColorimetric = 0x00000003
} ICCRENDERINGINTENT;

This enumerated type is used within the ICC_HEADER structure to indicate the rendering intent.


ICCSTANDARDOBSERVER

typedef enum
{
StdObsUnknown = 0x00000000L, /* Unknown */
StdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
StdObs1964TenDegrees = 0x00000002L/* 10 deg */
} ICCSTANDARDOBSERVER;

This type is used within the ICC_MEASUREMENT structure to indicate the standard observer.


ICCTAG

typedef struct __ICCTAG
{
L_UINT32 uSig;
L_IccUInt32Number uOffset;
L_IccUInt32Number uSize;
} ICCTAG, L_FAR * pICCTAG;

The ICCTAG structure is used to save a tag’s information.

Member | Description
uSig | A value that indicates the tag signature. For a list of possible values, refer to ICCTAGSIGNATURE. It can also contain a private tag.
uOffset | A value that indicates the address of the beginning of the tag data element, with respect to the beginning of the profile data stream (which has an address of zero).
uSize | A value that indicates the tag data element size in bytes. This value does not include any padded bytes at the end of the data.

Comments

The uSig field can contain a private tag, but it must be registered with the ICC registry. The registration authority for this data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).


ICCTAG_BASE

typedef struct __ICCTAG_BASE
{
L_UINT32 Signature;
L_UCHAR uReserved[4];
} ICCTAG_BASE, L_FAR * pICCTAG_BASE;

The ICCTAG_BASE structure is used to save the basic part of each tag type.

Member | Description
Signature | A value that indicates the signature of the tag type.
uReserved | Pointer to an array of 4 reserved bytes. Must be set to 0.

Comments

The Signature value can be one of the values in the list ICCTAGTYPESIGNATURE or it can be a private tag. The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).


ICCTAG_CHROMATICITY_TYPE

typedef struct __ICCTAG_CHROMATICITY_TYPE
{
ICCTAG_BASE Base;
ICC_CHROMATICITY Chrom;
} ICCTAG_CHROMATICITY_TYPE, L_FAR * pICCTAG_CHROMATICITY_TYPE;

The ICCTAG_CHROMATICITY_TYPE structure is used to save a ChromaticityType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Chrom | Pointer to an ICC_CHROMATICITY structure that contains the tag data.

Comments

The signature for this tag type is CHROMATICITYTYPESIG.


ICCTAG_COLORANT_ORDER_TYPE

typedef struct __ICCTAG_COLORANT_ORDER_TYPE
{
ICCTAG_BASE Base;
L_IccUInt32Number uColorantsCount;
L_IccUInt8Number L_FAR * pColorantsData;
} ICCTAG_COLORANT_ORDER_TYPE, L_FAR * pICCTAG_COLORANT_ORDER_TYPE;

The ICCTAG_COLORANT_ORDER_TYPE structure is used to save a ColorantOrderType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uColorantsCount | Number of data elements in the buffer pointed to by pColorantsData.
pColorantsData | A pointer to buffer that contains the tag’s data.

Comments

The signature for this tag type is COLORANTORDERTYPESIG.


ICCTAG_COLORANT_TABLE_TYPE

typedef struct __ICCTAG_COLORANT_TABLE_TYPE
{
ICCTAG_BASE Base;
L_IccUInt32Number uColorantsCount;
pICC_COLORANT_TABLE_DATA pColorantsData;
} ICCTAG_COLORANT_TABLE_TYPE, L_FAR * pICCTAG_COLORANT_TABLE_TYPE;

The ICCTAG_COLORANT_TABLE_TYPE structure is used to save a ColorantTableType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uColorantsCount | Number of data elements in the buffer pointed to by pColorantsData.
pColorantsData | A pointer to an ICC_COLORANT_TABLE_TYPE structure that contains the tag’s data.

Comments

The signature for this tag type is COLORANTTABLETYPESIG.


ICCTAG_CURVE_TYPE

typedef struct __ICCTAG_CURVE_TYPE
{
ICCTAG_BASE Base;
ICC_CURVE Curve;
} ICCTAG_CURVE_TYPE, L_FAR * pICCTAG_CURVE_TYPE;

The ICCTAG_CURVE_TYPE structure is used to save a CurveType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Curve | A pointer to an ICC_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is CURVETYPESIG.


ICCTAG_DATA_TYPE

typedef struct __ICCTAG_DATA_TYPE
{
ICCTAG_BASE Base;
ICC_DATA Data;
} ICCTAG_DATA_TYPE, L_FAR * pICCTAG_DATA_TYPE;

The ICCTAG_DATA_TYPE structure is used to save a DataType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Data | A pointer to an ICC_DATA structure that contains the tag’s data.

Comments

The signature for this tag type is DATATYPESIG.


ICCTAG_DATE_TIME_TYPE

typedef struct __ICCTAG_DATE_TIME_TYPE
{
ICCTAG_BASE Base;
ICC_DATE_TIME_NUMBER DateTime;
} ICCTAG_DATE_TIME_TYPE, L_FAR * pICCTAG_DATE_TIME_TYPE;

The ICCTAG_DATE_TIME_TYPE structure is used to save a DateTimeType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
DateTime | A pointer to an ICC_DATE_TIME_NUMBER structure that contains the tag’s data.

Comments

The signature for this tag type is DATETIMETYPESIG.


ICCTAG_LIST

typedef struct __ICCTAG_LIST
{
L_IccUInt32Number uTagCount;
pICCTAG pTags;
} ICCTAG_LIST, L_FAR * pICCTAG_LIST;

The ICCTAG_LIST structure is used to save a list of all the tags in the ICC profile.

Member | Description
uTagCount | A value that indicates the number of tags contained in the tags list.
pTags | A pointer to a list of ICCTAG structures that contain all the tags in the ICC profile.


ICCTAG_LUT_A_TO_B_TYPE

ICCTAG_LUT_A_TO_B_TYPE, ICCTAG_LUT_B_TO_A_TYPE

typedef struct __ICCTAG_LUT_A2B_B2A_TYPE
{
ICCTAG_BASE Base;
L_IccUInt8Number uInputChannels;
L_IccUInt8Number uOutputChannels;
L_IccUInt8Number uPad[2];
L_IccUInt32Number uOffsetToCurveB;
L_IccUInt32Number uOffsetToMatrix;
L_IccUInt32Number uOffsetToCurveM;
L_IccUInt32Number uOffsetToCLUT;
L_IccUInt32Number uOffsetToCurveA;
L_IccUInt8Number L_FAR * pData;
L_UCHAR L_FAR * pCurveB;
L_UCHAR L_FAR * pCurveM;
L_UCHAR L_FAR * pCurveA;
L_UCHAR L_FAR * pCLUT;
ICC_MATRIX Matrix;
} ICCTAG_LUT_A_TO_B_TYPE, L_FAR * pICCTAG_LUT_A_TO_B_TYPE,
ICCTAG_LUT_B_TO_A_TYPE, L_FAR * pICCTAG_LUT_B_TO_A_TYPE;

The ICCTAG_LUT_A_TO_B_TYPE and ICCTAG_LUT_A_TO_B_TYPE structures are used to save LutAToBType and LutBToAType tags.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uInputChannels | Number of input channels.
uOutputChannels | Number of output channels.
uPad | Reserved bytes for padding. Must be set to zero.
uOffsetToCurveB | Offset to first "B" curve.
uOffsetToMatrix | Offset to matrix.
uOffsetToCurveM | Offset to first "M" curve.
uOffsetToCLUT | Offset to CLUT.
uOffsetToCurveA | Offset to first "A".
pData | Pointer to a buffer that contains tag’s data.
pCurveB | Pointer to a buffer that contains the B curves data.
pCurveM | Pointer to a buffer that contains the M curves data.
pCurveA | Pointer to a buffer that contains the A curves data.
pCLUT | Pointer to a buffer that contains the CLUT data.
Matrix | Pointer to an ICC_MATRIX structure that contains the Matrix data.

Comments

The signatures for these tag types are LUTATOBTYPESIG and LUTBTOATYPESIG.

Note that when creating one of these tag types using the L_CreateICCTagData function, there is no need to supply the following fields: uOffsetToCurveB, uOffsetToMatrix, uOffsetToCurveM, uOffsetToCLUT, uOffsetToCurveA. Their values will be calculated automatically by the L_CreateICCTagData function.


ICCTAG_LUT16_TYPE

typedef struct __ICCTAG_LUT16_TYPE
{
ICCTAG_BASE Base;
ICC_LUT16 Lut16;
} ICCTAG_LUT16_TYPE, L_FAR * pICCTAG_LUT16_TYPE;

The ICCTAG_LUT16_TYPE structure is used to save lut16Type data.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Lut16 | A pointer to an ICC_LUT16 structure that contains the tag’s data.

Comments

The signature for this tag type is LUT16TYPESIG.


ICCTAG_LUT8_TYPE

typedef struct __ICCTAG_LUT8_TYPE
{
ICCTAG_BASE Base;
ICC_LUT8 Lut8;
} ICCTAG_LUT8_TYPE, L_FAR * pICCTAG_LUT8_TYPE;

The ICCTAG_LUT8_TYPE structure is used to save lut8Type data.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Lut8 | A pointer to an ICC_LUT8 structure that contains the tag’s data.

Comments

The signature for this tag type is LUT8TYPESIG.


ICCTAG_MEASUREMENT_TYPE

typedef struct __ICCTAG_MEASUREMENT_TYPE
{
ICCTAG_BASE Base;
ICC_MEASUREMENT Measurement;
} ICCTAG_MEASUREMENT_TYPE, L_FAR * pICCTAG_MEASUREMENT_TYPE;

The ICCTAG_MEASUREMENT_TYPE structure is used to save MeasurementType tag data.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Measurement | A pointer to an ICC_MULTI_LOCALIZED_UNICODE structure that contains the tag’s data.

Comments

The signature for this tag type is MEASUREMENTTYPESIG.


ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

typedef struct __ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE
{
ICCTAG_BASE Base;
ICC_MULTI_LOCALIZED_UNICODE MultiLocalizedUnicode;
} ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE, L_FAR * pICCTAG_MULTI_LOCALIZED_UNICODE_TYPE;

The ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure is used to save multiLocalizedUnicodeType tag type.

Member | Description
Base | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
MultiLocalizedUnicode | A pointer to ICC_MULTI_LOCALIZED_UNICODE structure that contains the tag’s data.

Comments

The signature for this tag type is MULTILOCALIZEDUNICODETYPESIG.


ICCTAG_NAMED_COLOR2_TYPE

typedef struct __ICCTAG_NAMED_COLOR2_TYPE
{
ICCTAG_BASE Base;
ICC_NAMED_COLOR2 NColor;
} ICCTAG_NAMED_COLOR2_TYPE, L_FAR * pICCTAG_NAMED_COLOR2_TYPE;

The ICCTAG_NAMED_COLOR2_TYPE structure is used to save a NamedColor2Type tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
NColor | A pointer to an ICC_NAMED_COLOR2 structure that contains the tag’s data.

Comments

The signature for this tag type is NAMEDCOLOR2TYPESIG.


ICCTAG_PARAMETRIC_CURVE_TYPE

typedef struct __ICCTAG_PARAMETRIC_CURVE_TYPE
{
ICCTAG_BASE Base;
ICC_PARAMETRIC_CURVE ParametricCurve;
} ICCTAG_PARAMETRIC_CURVE_TYPE, L_FAR * pICCTAG_PARAMETRIC_CURVE_TYPE;

The ICCTAG_PARAMETRIC_CURVE_TYPE structure is used to save a ParametricCurveType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
ParametricCurve | A pointer to an ICC_PARAMETRIC_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is PARAMETRICCURVETYPESIG.


ICCTAG_PROFILE_SEQ_DESC_TYPE

typedef struct __ICCTAG_PROFILE_SEQ_DESC_TYPE
{
ICCTAG_BASE Base;
ICC_PROFILE_SEQ_DESC Desc;
} ICCTAG_PROFILE_SEQ_DESC_TYPE, L_FAR * pICCTAG_PROFILE_SEQ_DESC_TYPE;

The ICCTAG_PROFILE_SEQ_DESC_TYPE structure is used to save a ProfileSequenceDescType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Desc | A pointer to an ICC_PROFILE_SEQ_DESC structure that contains the tag’s data.

Comments

The signature for this tag type is PROFILESEQUENCEDESCTYPESIG.


ICCTAG_RESPONSE_CURVE_SET16_TYPE

typedef struct __ICCTAG_RESPONSE_CURVE_SET16_TYPE
{
ICCTAG_BASE Base;
ICC_RESPONSE_CURVE ResponseCurve;
} ICCTAG_RESPONSE_CURVE_SET16_TYPE, L_FAR * pICCTAG_RESPONSE_CURVE_SET16_TYPE;

The ICCTAG_RESPONSE_CURVE_SET16_TYPE structure is used to save a ResponseCurveSet16Type tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
ResponseCurve | Pointer to an ICC_RESPONSE_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is RESPONSECURVESET16TYPESIG.

The purpose of this tag type is to provide a mechanism to relate physical colorant amounts with the normalized device codes produced by lut8Type, lut16Type, lutAToBType or lutBToAType tags so that corrections can be made for variation in the device without having to produce a new profile.


ICCTAG_S15_FIXED16_ARRAY_TYPE

typedef struct __ICCTAG_S15_FIXED16_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccS15Fixed16Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_S15_FIXED16_ARRAY_TYPE, L_FAR * pICCTAG_S15_FIXED16_ARRAY_TYPE;

The ICCTAG_S15_FIXED16_ARRAY_TYPE structure is used to save an s15Fixed16ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is S15FIXED16ARRAYTYPESIG.

This type represents an array of generic 4-byte/32-bit elements.


ICCTAG_SIGNATURE_TYPE

typedef struct __ICCTAG_SIGNATURE_TYPE
{
ICCTAG_BASE Base;
L_UINT32 uSignature;
} ICCTAG_SIGNATURE_TYPE, L_FAR * pICCTAG_SIGNATURE_TYPE;

The ICCTAG_SIGNATURE_TYPE structure is used to save SignatureType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uSignature | A value that represents a four-byte sequence signature, For a list of possible values, refer to ICCTECHNOLOGYSIGNATURE.

Comments

The signature for this tag type is SIGNATURETYPESIG.


ICCTAG_TEXT_TYPE

typedef struct __ICCTAG_TEXT_TYPE
{
ICCTAG_BASE Base;
L_Icc7BitAscii L_FAR * pTextData;
} ICCTAG_TEXT_TYPE, L_FAR * pICCTAG_TEXT_TYPE;

The ICCTAG_TEXT_TYPE structure is used to save a TextType tag.

Member | Description
Base | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
pTextData | A pointer to a buffer that contains a string of 7-bit ASCII characters.

Comments

The signature for this tag type is TEXTTYPESIG.


ICCTAG_U16_FIXED16_ARRAY_TYPE

typedef struct __ICCTAG_U16_FIXED16_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccU16Fixed16Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_U16_FIXED16_ARRAY_TYPE, L_FAR * pICCTAG_U16_FIXED16_ARRAY_TYPE;

The ICCTAG_U16_FIXED16_ARRAY_TYPE structure is used to save a u16Fixed16ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is U16FIXED16ARRAYTYPESIG.

This type represents an array of generic 4-byte/32-bit elements.


ICCTAG_UINT16_ARRAY_TYPE

typedef struct __ICCTAG_UINT16_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccUInt64Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT16_ARRAY_TYPE, L_FAR * pICCTAG_UINT16_ARRAY_TYPE;

The ICCTAG_UINT16_ARRAY_TYPE structure is used to save a uInt16ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UINT16ARRAYTYPESIG.

This type represents an array of generic 2-byte/16-bit elements.


ICCTAG_UINT32_ARRAY_TYPE

typedef struct __ICCTAG_UINT32_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccUInt32Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT32_ARRAY_TYPE, L_FAR * pICCTAG_UINT32_ARRAY_TYPE;

The ICCTAG_UINT32_ARRAY_TYPE structure is used to save a uInt32ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UINT32ARRAYTYPESIG.

This type represents an array of generic 4-byte/32-bit elements.


ICCTAG_UINT64_ARRAY_TYPE

typedef struct __ICCTAG_UINT64_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccUInt64Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT64_ARRAY_TYPE, L_FAR * pICCTAG_UINT64_ARRAY_TYPE;

The ICCTAG_UINT64_ARRAY_TYPE structure is used to save a uInt64ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UINT64ARRAYTYPESIG.

This type represents an array of generic 8-byte/64-bit elements.


ICCTAG_UINT8_ARRAY_TYPE

typedef struct __ICCTAG_UINT8_ARRAY_TYPE
{
ICCTAG_BASE Base;
L_IccUInt8Number L_FAR * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT8_ARRAY_TYPE, L_FAR * pICCTAG_UINT8_ARRAY_TYPE;

The ICCTAG_UINT8_ARRAY_TYPE structure is used to save a uInt8ArrayType tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UINT8ARRAYTYPESIG.

This type represents an array of generic 1-byte/8-bit elements.


ICCTAG_UNKNOWN_TYPE

typedef struct __ICCTAG_UNKNOWN_TYPE
{
ICCTAG_BASE Base;
L_Icc7BitAscii L_FAR * pData;
L_UINT uDataSize;
} ICCTAG_UNKNOWN_TYPE, L_FAR * pICCTAG_UNKNOWN_TYPE;

The ICCTAG_UNKNOWN_TYPE structure is used to save an unknown (or private) tag.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataSize | A value that indicates the size of the pData pointer in bytes.

Comments

A private signature is used as the signature for this tag type.


ICCTAG_VIEW_COND_TYPE

typedef struct __ICCTAG_VIEW_COND_TYPE
{
ICCTAG_BASE Base;
ICC_VIEW_COND ViewCondition;
} ICCTAG_VIEW_COND_TYPE, L_FAR * pICCTAG_VIEW_COND_TYPE;

The ICCTAG_VIEW_COND_TYPE structure is used to save a ViewingConditionsType tag.

Member | Description
Base | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
ViewCondition | Pointer to ICC_VIEW_COND structure that contains the tag’s data.

Comments

The signature for this tag type is VIEWINGCONDITIONTYPESIG.


ICCTAG_XYZ_TYPE

typedef struct __ICCTAG_XYZ_TYPE
{
ICCTAG_BASE Base;
pICC_XYZ_NUMBER pXYZNumData;
L_UINT uXYZNumCount;
} ICCTAG_XYZ_TYPE, L_FAR * pICCTAG_XYZ_TYPE;

The ICCTAG_XYZ_TYPE structure is used to save an XYZType tag type.

Member | Description
Base | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pXYZNumData | Pointer to a buffer that will contain the tag’s data.
uXYZNumCount | A value that indicates number of XYZ elements in this tag data.

Comments

The signature for this tag type is XYZTYPESIG.


ICCTAGSIGNATURE

typedef enum
{
AToB0Tag = 0x41324230L, /* 'A2B0' */
AToB1Tag = 0x41324231L, /* 'A2B1' */
AToB2Tag = 0x41324232L, /* 'A2B2' */
BlueMatrixColumnTag = 0x6258595AL, /* 'bXYZ' */
BlueTRCTag = 0x62545243L, /* 'bTRC' */
BToA0Tag = 0x42324130L, /* 'B2A0' */
BToA1Tag = 0x42324131L, /* 'B2A1' */
BToA2Tag = 0x42324132L, /* 'B2A2' */
CalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
CharTargetTag = 0x74617267L, /* 'targ' */
ChromaticAdaptationTag = 0x63686164L, /* 'chad' */
ChromaticityTag = 0x6368726DL, /* 'chrm' */
ColorantOrderTag = 0x636C726FL, /* 'clro' */
ColorantTableTag = 0x636C7274L, /* 'clrt' */
ColorantTableOutTag = 0x636C6F74L, /* 'clot' */
CopyrightTag = 0x63707274L, /* 'cprt' */
DeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
DeviceModelDescTag = 0x646D6464L, /* 'dmdd' */
GamutTag = 0x67616D74L, /* 'gamt' */
GrayTRCTag = 0x6B545243L, /* 'kTRC' */
GreenMatrixColumnTag = 0x6758595AL, /* 'gXYZ' */
GreenTRCTag = 0x67545243L, /* 'gTRC' */
LuminanceTag = 0x6C756D69L, /* 'lumi' */
MeasurementTag = 0x6D656173L, /* 'meas' */
MediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
MediaWhitePointTag = 0x77747074L, /* 'wtpt' */
NamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
OutputResponseTag = 0x72657370L, /* 'resp' */
Preview0Tag = 0x70726530L, /* 'pre0' */
Preview1Tag = 0x70726531L, /* 'pre1' */
Preview2Tag = 0x70726532L, /* 'pre2' */
ProfileDescriptionTag = 0x64657363L, /* 'desc' */
ProfileSequenceDescTag = 0x70736571L, /* 'pseq' */
RedMatrixColumnTag = 0x7258595AL, /* 'rXYZ' */
RedTRCTag = 0x72545243L, /* 'rTRC' */
TechnologyTag = 0x74656368L, /* 'tech' */
ViewingCondDescTag = 0x76756564L, /* 'vued' */
ViewingConditionsTag = 0x76696577L /* 'view' */
} ICCTAGSIGNATURE;

This enumerated type indicates the tag signatures for all ICC tags.


ICCTAGTYPESIGNATURE

typedef enum
{
ChromaticityTypeSig = 0x6368726DL, /* 'chrm' */
ColorantOrderTypeSig = 0x636c726fL, /* 'clro' */
ColorantTableTypeSig = 0x636c7274L, /* 'clrt' */
CurveTypeSig = 0x63757276L, /* 'curv' */
DataTypeSig = 0x64617461L, /* 'data' */
DateTimeTypeSig = 0x6474696DL, /* 'dtim' */
Lut16TypeSig = 0x6d667432L, /* 'mft2' */
Lut8TypeSig = 0x6d667431L, /* 'mft1' */
LutAtoBTypeSig = 0x6D414220L, /* 'mAB' */
LutBtoATypeSig = 0x6D424120L, /* 'mBA' */
MeasurementTypeSig = 0x6D656173L, /* 'meas' */
MultiLocalizedUnicodeTypeSig = 0x6D6C7563L, /* 'mluc' */
NamedColor2TypeSig = 0x6E636C32L, /* 'ncl2' */
ParametricCurveTypeSig = 0x70617261L, /* 'para' */
ProfileSequenceDescTypeSig = 0x70736571L, /* 'pseq' */
ResponseCurveSet16TypeSig = 0x72637332L, /* 'rcs2' */
S15Fixed16ArrayTypeSig = 0x73663332L, /* 'sf32' */
SignatureTypeSig = 0x73696720L, /* 'sig ' */
TextTypeSig = 0x74657874L, /* 'text' */
U16Fixed16ArrayTypeSig = 0x75663332L, /* 'uf32' */
UInt16ArrayTypeSig = 0x75693136L, /* 'ui16' */
UInt32ArrayTypeSig = 0x75693332L, /* 'ui32' */
UInt64ArrayTypeSig = 0x75693634L, /* 'ui64' */
UInt8ArrayTypeSig = 0x75693038L, /* 'ui08' */
ViewingConditionsTypeSig = 0x76696577L, /* 'view' */
XYZTypeSig = 0x58595A20L /* 'XYZ ' */
} ICCTAGTYPESIGNATURE;

This enumerated type indicates the tag type signatures for all ICC tag types.


ICCTECHNOLOGYSIGNATURE

typedef enum
{
FilmScanner = 0x6673636EL, /* 'fscn' */
DigitalCamera = 0x6463616DL, /* 'dcam' */
ReflectiveScanner = 0x7273636EL, /* 'rscn' */
InkJetPrinter = 0x696A6574L, /* 'ijet' */
ThermalWaxPrinter = 0x74776178L, /* 'twax' */
ElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
ElectrostaticPrinter = 0x65737461L, /* 'esta' */
DyeSublimationPrinter = 0x64737562L, /* 'dsub' */
PhotographicPaperPrinter = 0x7270686FL, /* 'rpho' */
FilmWriter = 0x6670726EL, /* 'fprn' */
VideoMonitor = 0x7669646DL, /* 'vidm' */
VideoCamera = 0x76696463L, /* 'vidc' */
ProjectionTelevision = 0x706A7476L, /* 'pjtv' */
CRTDisplay = 0x43525420L, /* 'CRT ' */
PMDisplay = 0x504D4420L, /* 'PMD ' */
AMDisplay = 0x414D4420L, /* 'AMD ' */
PhotoCD = 0x4B504344L, /* 'KPCD' */
PhotoImageSetter = 0x696D6773L, /* 'imgs' */
Gravure = 0x67726176L, /* 'grav' */
OffsetLithography = 0x6F666673L, /* 'offs' */
Silkscreen = 0x73696C6BL, /* 'silk' */
Flexography = 0x666C6578L /* 'flex' */
} ICCTECHNOLOGYSIGNATURE;

This enumerated type is used within the ICC_TAG_SIGNATURE_TYPE structure to indicate the technology signature.


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.

FAILURE | 0 | Function not successful.
SUCCESS | 1 | Function successful.
SUCCESS_ABORT | 2 | Function successful with an abort request.
SUCCESS_DELETE | 3 | Function successful with a delete file request.
SUCCESS_RETRY | 4 | Function successful with a retry request.
SUCCESS_IGNOREMARKER | 5 | Function successful. Ignore this marker.
SUCCESS_IGNOREALLMARKERS | 6 | Function successful. Ignore this marker and all remaining markers.
SUCCESS_IGNORETHISCOPYALL | 7 | Function successful. Ignore this marker but copy all remaining markers.
SUCCESS_PARTIAL_FAILURE | 8 | Function called recursively--at least one call was successful, but some failed.

Note:

All LEADTOOLS function errors will return a negative number.

Error | No. | Description
ERROR_NO_MEMORY | -1 | Not enough memory available.
ERROR_NO_BITMAP | -2 | Invalid bitmap handle.
ERROR_MEMORY_TOO_LOW | -3 | Not enough memory available.
ERROR_FILE_LSEEK | -4 | Error seeking to position.
ERROR_FILE_WRITE | -5 | Error writing file.
ERROR_FILE_GONE | -6 | File not present - abort.
ERROR_FILE_READ | -7 | Error reading file.
ERROR_INV_FILENAME | -8 | Invalid filename specified.
ERROR_FILE_FORMAT | -9 | Invalid file format.
ERROR_FILENOTFOUND | -10 | File not found.
ERROR_INV_RANGE | -11 | Invalid width/height.
ERROR_IMAGE_TYPE | -12 | Image format recognized, but sub-type not supported.
ERROR_INV_PARAMETER | -13 | Invalid parameter passed.
ERROR_FILE_OPEN | -14 | Not able to open file.
ERROR_UNKNOWN_COMP | -15 | Unknown compression format.
ERROR_FEATURE_NOT_SUPPORTED | -16 | Feature not supported.
ERROR_NOT_256_COLOR | -17 | VGA card only supports 256 colors (8 bit).
ERROR_PRINTER | -18 | Printer error.
ERROR_CRC_CHECK | -19 | Data CRC check error.
ERROR_QFACTOR | -21 | Invalid QFactor specified.
ERROR_TARGAINSTALL | -22 | TARGA not installed.
ERROR_OUTPUTTYPE | -23 | Invalid compression format.
ERROR_XORIGIN | -24 | X origin specified invalid.
ERROR_YORIGIN | -25 | Y origin specified invalid.
ERROR_VIDEOTYPE | -26 | Invalid video mode.
ERROR_BITPERPIXEL | -27 | Invalid bits/pixel.
ERROR_WINDOWSIZE | -28 | Invalid window size.
ERROR_NORMAL_ABORT | -29 | Escape key pressed - or user aborted operation.
ERROR_NOT_INITIALIZED | -30 | Internal error - call LEAD.
ERROR_CU_BUSY | -31 | Internal error - call LEAD.
ERROR_INVALID_TABLE_TYPE | -32 | Internal error - call LEAD.
ERROR_UNEQUAL_TABLES | -33 | Internal error - call LEAD.
ERROR_INVALID_BUFFER | -34 | Internal error - call LEAD.
ERROR_MISSING_TILE_DATA | -35 | Internal error - call LEAD.
ERROR_INVALID_QVALUE | -36 | Internal error - call LEAD.
ERROR_INVALIDDATA | -37 | Internal error - call LEAD.
ERROR_INVALID_COMPRESSED_TYPE | -38 | Internal error - call LEAD.
ERROR_INVALID_COMPONENT_NUM | -39 | Internal error - call LEAD.
ERROR_INVALID_PIXEL_TYPE | -40 | Internal error - call LEAD.
ERROR_INVALID_PIXEL_SAMPLING | -41 | Internal error - call LEAD.
ERROR_INVALID_SOURCE_FILE | -42 | Internal error - call LEAD.
ERROR_INVALID_TARGET_FILE | -43 | Internal error - call LEAD.
ERROR_INVALID_IMAGE_DIMS | -44 | Internal error - call LEAD.
ERROR_INVALID_TILE_DIMS | -45 | Internal error - call LEAD.
ERROR_INVALID_PIX_BUFF_DIMS | -46 | Internal error - call LEAD.
ERROR_SEGMENT_OVERFLOW | -47 | Internal error - call LEAD.
ERROR_INVALID_SUBSAMPLING | -48 | Internal error - call LEAD.
ERROR_INVALID_Q_VIS_TABLE | -49 | Internal error - call LEAD.
ERROR_INVALID_DC_CODE_TABLE | -50 | Internal error - call LEAD.
ERROR_INVALID_AC_CODE_TABLE | -51 | Internal error - call LEAD.
ERROR_INSUFFICIENT_DATA | -52 | Internal error - call LEAD.
ERROR_MISSING_FUNC_POINTER | -53 | Internal error - call LEAD.
ERROR_TOO_MANY_DC_CODE_TABLES | -54 | Internal error - call LEAD.
ERROR_TOO_MANY_AC_CODE_TABLES | -55 | Internal error - call LEAD.
ERROR_INVALID_SUBIMAGE | -56 | Internal error - call LEAD.
ERROR_INVALID_ABORTION | -57 | Internal error - call LEAD.
ERROR_CU_NO_SUPPORT | -58 | Internal error - call LEAD.
ERROR_CU_FAILURE | -59 | Internal error - call LEAD.
ERROR_BAD_POINTER | -60 | Internal error - call LEAD.
ERROR_HEADER_DATA_FAILUR | -61 | Internal error - call LEAD.
ERROR_COMPRESSED_DATA_FAILURE | -62 | Internal error - call LEAD.
ERROR_FIXEDPAL_DATA | -63 | Fixed palette data not found.
ERROR_LOADFONT_DATA | -64 | Fixed palette data not found.
ERROR_NO_STAMP | -65 | Stamp not found.
ERROR_G3CODE_INVALID | -70 | Invalid group 3 dat.
ERROR_G3CODE_EOF | -71 | Group3 code end of file.
ERROR_G3CODE_EOL | -72 | Group3 code end of code.
ERROR_PREMATURE_EOF | -73 | Premature EOF at scanline.
ERROR_PREMATURE_EOL | -74 | Premature end-of-line code.
ERROR_UNCOMP_EOF | -75 | Premature end-of-line code.
ERROR_ACT_INCOMP | -76 | Premature end-of-line code.
ERROR_BAD_DECODE_STATE | -77 | Premature end-of-line code.
ERROR_VERSION_NUMBER | -78 | Bad version number.
ERROR_TWAIN_NODSM | -79 | Source manager not found.
ERROR_TWAIN_BUMMER | -80 | Failure due to unknown causes.
ERROR_TWAIN_LOWMEMORY | -81 | Not enough memory to perform operation.
ERROR_TWAIN_NODS | -82 | No Data Source.
ERROR_TWAIN_MAXCONNECTIONS | -83 | DS is connected to max possible apps.
ERROR_TWAIN_OPERATIONERROR | -84 | DS or DSM reported error, app shouldn't (no need for your app to report the error).
ERROR_TWAIN_BADCAP | -85 | Unknown capability.
ERROR_TWAIN_BADPROTOCOL | -86 | Unrecognized MSG DG DAT combination.
ERROR_TWAIN_BADVALUE | -87 | Data parameter out of range.
ERROR_TWAIN_SEQERROR | -88 | DG DAT MSG out of expected sequence.
ERROR_TWAIN_BADDEST | -89 | Unknown destination App/Src in DSM_Entry.
ERROR_TWAIN_CANCEL | -90 | Operation was cancelled.
ERROR_PANWINDOW_NOT_CREATED | -91 | PanWindow creation failed.
ERROR_NOT_ENOUGH_IMAGES | -92 | Not enough images - more input images are required.
ERROR_TWAIN_CAPUNSUPPORTED | -93 | Twain capability unsupported.
ERROR_TWAIN_FILEXFER_UNSUPPORTED | -94 | Twain File Transfer unsupported.
ERROR_USER_ABORT | -100 | User has aborted operation
ERROR_FPX_INVALID_FORMAT_ERROR | -101 | Invalid FlashPix format
ERROR_FPX_FILE_WRITE_ERROR | -102 | Error writing file
ERROR_FPX_FILE_READ_ERROR | -103 | Error reading file
ERROR_FPX_FILE_NOT_FOUND | -104 | File not found
ERROR_FPX_COLOR_CONVERSION_ERROR | -105 | Color conversion error
ERROR_FPX_SEVER_INIT_ERROR | -106 | Server initialize error
ERROR_FPX_LOW_MEMORY_ERROR | -107 | Not enough memory available
ERROR_FPX_IMAGE_TOO_BIG_ERROR | -108 | Image too big
ERROR_FPX_INVALID_COMPRESSION_ERROR | -109 | Invalid compression
ERROR_FPX_INVALID_RESOLUTION | -110 | Invalid resolution
ERROR_FPX_INVALID_FPX_HANDLE | -111 | Invalid handle
ERROR_FPX_TOO_MANY_LINES | -112 | Too many lines
ERROR_FPX_BAD_COORDINATES | -113 | Invalid coordinates
ERROR_FPX_FILE_SYSTEM_FULL | -114 | File system full
ERROR_FPX_MISSING_TABLE | -115 | The table is missing
ERROR_FPX_RETURN_PARAMETER_TOO_LARGE | -116 | Parameter too large
ERROR_FPX_NOT_A_VIEW | -117 | Error view
ERROR_FPX_VIEW_IS_TRANFORMLESS | -118 | The view is tranformless
ERROR_FPX_ERROR | -119 | General error
ERROR_FPX_UNIMPLEMENTED_FUNCTION | -120 | Unimplemented function
ERROR_FPX_INVALID_IMAGE_DESC | -121 | Invalid image description
ERROR_FPX_INVALID_JPEG_TABLE | -122 | Invalid jpeg table
ERROR_FPX_ILLEGAL_JPEG_ID | -123 | Illegal jpeg identifier
ERROR_FPX_MEMORY_ALLOCATION_FAILED | -124 | Memory allocation failed
ERROR_FPX_NO_MEMORY_MANAGEMENT | -125 | No memory management
ERROR_FPX_OBJECT_CREATION_FAILED | -126 | Object creation failed
ERROR_FPX_EXTENSION_FAILED | -127 | Extension failed
ERROR_FPX_FREE_NULL_PTR | -128 | Free null pointer
ERROR_FPX_INVALID_TILE | -129 | Invalid tile
ERROR_FPX_FILE_IN_USE | -130 | File in use
ERROR_FPX_FILE_CREATE_ERROR | -131 | Error creating file
ERROR_FPX_FILE_NOT_OPEN_ERROR | -132 | File not open
ERROR_FPX_USER_ABORT | -133 | User abort
ERROR_FPX_OLE_FILE_ERROR | -134 | OLE file I/O error
ERROR_BAD_TAG | -140 | Bad TIFF tag
ERROR_INVALID_STAMP_SIZE | -141 | Stamp size is too big or invalid bits/pixel, etc
ERROR_BAD_STAMP | -142 | Stamp is present but data is corrupted
ERROR_DOCUMENT_NOT_ENABLED | -143 | Document capability is required to use this function
ERROR_IMAGE_EMPTY | -144 | Image is empty
ERROR_NO_CHANGE | -145 | The image hasn't changed
ERROR_LZW_LOCKED | -146 | The LZW capabilities are locked
ERROR_FPXEXTENSIONS_LOCKED | -147 | The FlashPix extension capabilities are locked
ERROR_ANN_LOCKED | -148 | One or more annotation objects are still locked
ERROR_EXCEPTION | -149 | An unspecified exception occurred - could be memory access violations
ERROR_DLG_FAILED | -150 | An error occurred during the creation of the common dialog.
ERROR_DLG_ALREADYINITIATED | -151 | The dialogs are already initialized.
ERROR_DLG_NOTINITIATED | -152 | The dialogs have not been initialized.
ERROR_DLG_COLORNOTINITIALIZED | -153 | The dialogs were not initialized with DLG_INIT_COLOR.
ERROR_DLG_COLORDLL_UNABLETOLOAD | -154 | The dialogs could not load the LTCLR dll.
ERROR_DLG_RESDLL_UNABLETOLOAD | -155 | The dialogs could not load the LTDLGRES dll.
ERROR_ISIS_NOCURSCANNER | -160 | ISIS No Scanner selected
ERROR_ISIS_SCANDRIVER_NOT_LOADED | -161 | ISIS Scanner driver failed to load
ERROR_ISIS_CANCEL | -162 | ISIS Operation canceled
ERROR_ISIS_BAD_TAG_OR_VALUE | -163 | ISIS Bad Tag or Bad Tag Value
ERROR_ISIS_NOT_READY | -164 | ISIS Scanner not ready
ERROR_ISIS_NO_PAGE | -165 | ISIS No page in the Scanner
ERROR_ISIS_JAM | -166 | ISIS Scanner Jam error
ERROR_ISIS_SCANNER_ERROR | -167 | ISIS Scanner driver error
ERROR_ISIS_BUSY | -168 | ISIS Scanner is busy
ERROR_ISIS_FILE_ERROR | -169 | ISIS File driver error
ERROR_ISIS_NETWORK_ERROR | -170 | ISIS Network error
ERROR_ISIS_NOT_INSTALLED | -171 | ISIS is not installed
ERROR_ISIS_NO_PIXDFLT | -172 | ISIS is not installed
ERROR_ISIS_PIXVERSION | -173 | ISIS version is incorrect
ERROR_ISIS_PERM_NOACCESS | -174 | ISIS No permission/access
ERROR_LTDIS_NOT_LOADED | -200 | LTDIS dll doesn't loaded.
ERROR_LTFIL_NOT_LOADED | -201 | LTFIL dll doesn't loaded.
ERROR_RECORDING | -250 | Wave device is currently recording
ERROR_COMPRESSOR | -251 | Invalid compressor
ERROR_SOUND_DEVICE | -252 | Problem with sound card
ERROR_DEVICE_INUSE | -253 | The sound card is currently in use
ERROR_INV_TRACKTYPE | -254 | Invalid track for operation
ERROR_NO_SOUNDCARD | -255 | No sound card is present
ERROR_NOT_RECORDING | -256 | Not currently recording
ERROR_INV_MODE | -257 | Invalid open mode for operation
ERROR_NO_VIDEO_MODULE | -258 | No video module present on machine
ERROR_QUEUE_FULL | -259 | The buffer queue is full
ERROR_CONFIGURE_RESTART | -260 | Configuration was successful, but you need to restart Windows
ERROR_INV_HANDLE | -261 | Invalid handle
ERROR_HOST_RESOLVE | -270 | Can't resolve hostname
ERROR_CANT_INITIALIZE | -271 | Can't initialize network
ERROR_NO_CONNECTION | -272 | No open network connections
ERROR_HOST_NOT_FOUND | -273 | Hostname not found
ERROR_NOT_SERVER | -274 | Computer is not a server
ERROR_NO_CONNECTIONS | -275 | No connection requests waiting
ERROR_CONNECT_REFUSED | -276 | Connection was refused
ERROR_IS_CONNECTED | -277 | Computer is already connected
ERROR_NET_UNREACH | -278 | Network is unreachable from host
ERROR_TIME_OUT | -279 | Connect attempt time out without connecting
ERROR_NET_DOWN | -280 | Network subsystem is down
ERROR_NO_BUFFERS | -281 | No buffer space is available, too many connections
ERROR_NO_FILE_DESCR | -282 | No more file handle available
ERROR_DATA_QUEUED | -283 | Data has been queued to send later
ERROR_UNKNOWN | -284 | Unknown network error has occurred
ERROR_CONNECT_RESET | -285 | Connection was reset - socket might be unusable
ERROR_TRANSFER_ABORTED | -286 | Transfer was aborted
ERROR_DSHOW_FAILURE | -287 | DirectShow isn't installed correctly
ERROR_REGISTRY_READ | -288 | Error reading from the registry
ERROR_WAVE_FORMAT | -289 | The wave format is not supported
ERROR_BUFFER_TOO_SMALL | -290 | The buffer size is too small
ERROR_WAVE_CONVERT | -291 | Error converting the wave format
ERROR_MULTIMEDIA_NOT_ENABLED | -292 | Video capability is required to use this function
ERROR_CAP_CONNECT | -293 | Error connecting to capture device
ERROR_CAP_DISCONNECT | -294 | Error disconnecting capture device
ERROR_DISK_ISFULL | -295 | Not enough disk space
ERROR_CAP_OVERLAY | -296 | Error setting capture overlay
ERROR_CAP_PREVIEW | -297 | Error setting capture preview
ERROR_CAP_COPY | -298 | Error copying to clipboard
ERROR_CAP_WINDOW | -299 | Error with capture window
ERROR_CAP_ISCAPTURING | -300 | Operation invalid during capture
ERROR_NO_STREAMS | -301 | No streams to play
ERROR_CREATE_STREAM | -302 | Error creating streams
ERROR_FRAME_DELETE | -303 | Error deleting frames
ERROR_DXF_FILTER_MISSING | -309 | The DXF filter is needed to use this function
ERROR_PAGE_NOT_FOUND | -310 | Page not found
ERROR_DELETE_LAST_PAGE | -311 | You cannot delete a page from a file containing only one page
ERROR_NO_HOTKEY | -312 | There is no hotkey
ERROR_CANNOT_CREATE_HOTKEY_WINDOW | -313 | Error creating the hotkey window
ERROR_MEDICAL_NOT_ENABLED | -314 | Medical Express capability is required to use this function
ERROR_JBIG_NOT_ENABLED | -315 | JBIG capability is required to use this function
ERROR_UNDO_STACK_EMPTY | -316 | Undo stack is empty - too many undos
ERROR_NO_TOOLBAR | -317 | ActiveX error - the toolbar window was not created
ERROR_MEDICAL_NET_NOT_ENABLED | -318 | Medical Network Express capability is required to use this function
ERROR_JBIG_FILTER_MISSING | -319 | The JBIG filter is needed to use this function
ERROR_CAPTURE_STILL_IN_PROCESS | -320 | Capture is still in progress
ERROR_INVALID_DELAY | -321 | Invalid delay specified
ERROR_INVALID_COUNT | -322 | Invalid capture count specified
ERROR_INVALID_INTERVAL | -323 | Invalid interval specified
ERROR_HOTKEY_CONFILCTS_WITH_CANCELKEY | -324 | Hotkey Conflicts With Cancelkey
ERROR_CAPTURE_INVALID_AREA_TYPE | -325 | Invalid Area Type specified
ERROR_CAPTURE_NO_OPTION_STRUCTURE | -326 | Invalid or missing options structure
ERROR_CAPTURE_INVALID_FILL_PATTERN | -327 | Invalid fill pattern
ERROR_CAPTURE_INVALID_LINE_STYLE | -328 | Invalid line style
ERROR_CAPTURE_INVALID_INFOWND_POS | -329 | Invalid info window position
ERROR_CAPTURE_INVALID_INFOWND_SIZE | -330 | Invalid info window size
ERROR_CAPTURE_ZERO_AREA_SIZE | -331 | Zero Area Size for capture
ERROR_CAPTURE_FILE_ACCESS_FAILED | -332 | The specified filename could not be read
ERROR_CAPTURE_INVALID_32BIT_EXE_OR_DLL | -333 | The specified filename is not a valid 32bit EXE/DLL
ERROR_CAPTURE_INVALID_RESOURCE_TYPE | -334 | The specified resource type is not supported
ERROR_CAPTURE_INVALID_RESOURCE_INDEX | -335 | The index resource is out of range
ERROR_CAPTURE_NO_ACTIVE_WINDOW | -336 | No active window for capture
ERROR_CAPTURE_CANNOT_CAPTURE_WINDOW | -337 | Could not capture the window
ERROR_CAPTURE_STRING_ID_NOT_DEFINED | -338 | String ID Not Defined
ERROR_CAPTURE_DELAY_LESS_THAN_ZERO | -339 | Delay value cannot be less than zero
ERROR_CAPTURE_NO_MENU | -340 | No menu to capture
ERROR_WMF_FILTER_MISSING | -349 | WMF filter is needed to use this function
ERROR_BROWSE_FAILED | -350 | Directory browsing failed
ERROR_NOTHING_TO_DO | -351 | There is nothing to do! - i.e. no files were found
ERROR_INTERNET_NOT_ENABLED | -352 | Internet capability is required to use this function
ERROR_LVKRN_MISSING | -353 | The LVKRN DLL is needed to use this function
ERROR_CMW_LOCKED | -354 | The CMW support is locked
ERROR_CMW_FILTER_MISSING | -355 | CMW filter is needed to use this function
ERROR_CMP_FILTER_MISSING | -356 | CMP filter is needed to use this function
ERROR_FAX_FILTER_MISSING | -357 | FAX filter is needed to use this function
ERROR_PDF_FILTER_MISSING | -358 | PDF filter is needed to use this function
ERROR_TIF_FILTER_MISSING | -359 | TIF filter is needed to use this function
ERROR_INV_HORZSIZE | -360 | The horizontal size is outside the specification
ERROR_INV_VERTSIZE | -361 | The vertical size is outside the specification
ERROR_ASPECTRATIO | -362 | Invalid pel aspect ratio
ERROR_BITRATE | -363 | Invalid bitrate
ERROR_VBV_BUFFER | -364 | VBV Buffer Size is isn't valid
ERROR_CHROMA_FORMAT | -365 | Invalid chroma format
ERROR_VIDEO_FORMAT | -366 | Invalid video format
ERROR_COLOR_PRIMARY | -367 | Invalid number of color primaries
ERROR_TRANSFER_CHAR | -368 | Invalid number of transfer characteristics
ERROR_MATRIX_COEFF | -369 | Invalid number of matrix coefficients
ERROR_DISPLAY_HORZSIZE | -370 | Invalid horizontal display size
ERROR_DISPLAY_VERTSIZE | -371 | Invalid vertical display size
ERROR_INTRA_DCPREC | -372 | Invalid Intra DC Precision
ERROR_FCODE | -373 | Invalid f code
ERROR_SRCH_WINDOW | -374 | Invalid motion data search window
ERROR_PROFILEID | -375 | Invalid profile id
ERROR_LEVELID | -376 | Invalid level id
ERROR_PROFILEID_NS | -377 | Encoder doesn't support scalable bitstreams
ERROR_INV_COMBINATION | -378 | Undefined Profile & Level id combination
ERROR_BPIC_NOTALLOWED | -379 | B Pictures not allowed
ERROR_RPTFIRST_MUSTBEZERO | -380 | Repeat first must be zero
ERROR_FRAME_RATE | -381 | Invalid frame rate
ERROR_VECTOR_NOT_ENABLED | -400 | Vector capability is required to use this function
ERROR_VECTOR_DXF_NOT_ENABLED | -401 | Vector DXF capability is required to use this function
ERROR_VECTOR_DWG_NOT_ENABLED | -402 | Vector DWG capability is required to use this function
ERROR_VECTOR_MISC_NOT_ENABLED | -403 | Vector Misc capability is required to use this function
ERROR_TAG_MISSING | -404 | Tag not found
ERROR_VECTOR_DWF_NOT_ENABLED | -405 | Vector DWF capability is required to use this function
ERROR_NO_UNDO_STACK | -406 | There is no undo stack
ERROR_UNDO_DISABLED | -407 | The undo is disabled
ERROR_PDF_NOT_ENABLED | -408 | PDF capability is required to use this function
ERROR_ENTENSIONS_MISSING | -409 | EXIF extensions are missing
ERROR_BARCODE_DIGIT_CHECK | -410 | Invalid error check digit
ERROR_BARCODE_INVALID_TYPE | -411 | Invalid bar code type
ERROR_BARCODE_TEXTOUT | -412 | Invalid bar code text out option
ERROR_BARCODE_WIDTH | -413 | Invalid bar code width
ERROR_BARCODE_HEIGHT | -414 | Invalid bar code height
ERROR_BARCODE_TOSMALL | -415 | Bar code string is too small
ERROR_BARCODE_STRING | -416 | Invalid bar code string for a specified bar code type
ERROR_BARCODE_NOTFOUND | -417 | No bar code recognition
ERROR_BARCODE_UNITS | -418 | Invalid bar code measurement unit
ERROR_BARCODE_MULTIPLEMAXCOUNT | -419 | Invalid multiple max count
ERROR_BARCODE_GROUP | -420 | Invalid bar code group
ERROR_BARCODE_NO_DATA | -421 | Invalid BARCODEDATA structure
ERROR_BARCODE_NOTFOUND_DUPLICATED | -422 | No duplicated bar code
ERROR_BARCODE_LAST_DUPLICATED | -423 | Reached the last duplicated bar code
ERROR_BARCODE_STRING_LENGTH | -424 | Invalid bar code data string length
ERROR_BARCODE_LOCATION | -425 | Invalid bar code area location
ERROR_BARCODE_1D_LOCK | -426 | Bar Code 1D is locked
ERROR_BARCODE_2D_READ_LOCKED | -427 | Bar Code Read 2D (CodeOne) is locked
ERROR_BARCODE_2D_WRITE_LOCKED | -428 | Bar Code Write 2D (CodeOne) is locked
ERROR_BARCODE_PDF_READ_LOCKED | -429 | Bar Code Read PDF is locked
ERROR_BARCODE_PDF_WRITE_LOCKED | -430 | Bar Code Write PDF is locked
ERROR_BARCODE_FOUNDCORRUPT | -431 | Barcode PDF417 symbol is found but cannot be read successfully
ERROR_BARCODE_DATAMATRIX_READ_LOCKED | -432 | Bar Code Read DataMatrix is locked.
ERROR_BARCODE_DATAMATRIX_WRITE_LOCKED | -433 | Bar Code Write DataMatrix is locked.
ERROR_BARCODE_QR_READ_LOCKED | -1380 | Bar Code Read QR is locked
ERROR_BARCODE_QR_WRITE_LOCKED | -1381 | Bar Code Write QR is locked
ERROR_NET_OUT_OF_HANDLES | -435 | No more handles could be generated at this time
ERROR_NET_TIMEOUT | -436 | The request has timed out
ERROR_NET_EXTENDED_ERROR | -437 | An extended error has occurred
ERROR_NET_INTERNAL_ERROR | -438 | An internal WinInet error
ERROR_NET_INVALID_URL | -439 | The URL is invalid
ERROR_NET_UNRECOGNIZED_SCHEME | -440 | The URL scheme could not be recognized or is not supported
ERROR_NET_NAME_NOT_RESOLVED | -441 | The server name could not be resolved
ERROR_NET_PROTOCOL_NOT_FOUND | -442 | The requested protocol could not be located
ERROR_NET_INVALID_OPTION | -443 | Invalid option specified
ERROR_NET_BAD_OPTION_LENGTH | -444 | The length of option is incorrect
ERROR_NET_OPTION_NOT_SETTABLE | -445 | The option can not be set
ERROR_NET_SHUTDOWN | -446 | The Win32 Internet function support is being shut down or unload
ERROR_NET_LOGIN_FAILURE | -449 | User could not connect to site
ERROR_NET_INVALID_OPERATION | -450 | The requested operation is invalid
ERROR_NET_OPERATION_CANCELLED | -451 | The operation was cancelled
ERROR_NET_INCORRECT_HANDLE_TYPE | -452 | The type of handle supplied is incorrect for the operation
ERROR_NET_INCORRECT_HANDLE_STATE | -453 | Handle is not in the correct state
ERROR_NET_NOT_PROXY_REQUEST | -454 | The request cannot be made via a proxy
ERROR_NET_REGISTRY_VALUE_NOT_FOUND | -455 | The registry value could not be found
ERROR_NET_BAD_REGISTRY_PARAMETER | -456 | Incorrect registry value
ERROR_NET_NO_DIRECT_ACCESS | -457 | Direct network access cannot be made at this time
ERROR_NET_NO_CONTEXT | -458 | An asynchronous request could not be made because a zero context value was supplied
ERROR_NET_NO_CALLBACK | -459 | A callback function has not been defined
ERROR_NET_REQUEST_PENDING | -460 | Operation could not be completed because one or more operations are pending
ERROR_NET_INCORRECT_FORMAT | -461 | The format of the request is invalid
ERROR_NET_ITEM_NOT_FOUND | -462 | The requested item could not be located
ERROR_NET_CANNOT_CONNECT | -463 | The attempt to connect to the server failed
ERROR_NET_CONNECTION_ABORTED | -464 | The connection with the server has been terminated
ERROR_NET_CONNECTION_RESET | -465 | The connection with the server has been reset
ERROR_NET_FORCE_RETRY | -466 | Calls for the Win32 Internet function to redo the request
ERROR_NET_INVALID_PROXY_REQUEST | -467 | The proxy request is invalid
ERROR_NET_HANDLE_EXISTS | -469 | The request failed because the handle already exits
ERROR_NET_SEC_CERT_DATE_INVALID | -470 | SSL certificate date that was received from the server is bad
ERROR_NET_SEC_CERT_CN_INVALID | -471 | SSL certificate common name is incorrect
ERROR_NET_HTTP_TO_HTTPS_ON_REDIR | -472 | Moving from a non-SSL to an SSL connection because of a redirect
ERROR_NET_HTTPS_TO_HTTP_ON_REDIR | -473 | Moving from an SSL to a no-SSL connection because of a redirect
ERROR_NET_MIXED_SECURITY | -474 | 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 | -475 | Changing the post is not secure.
ERROR_NET_POST_IS_NON_SECURE | -476 | Current posts is not secure.
ERROR_NET_CLIENT_AUTH_CERT_NEEDED | -477 | Client need certificate authority.
ERROR_NET_INVALID_CA | -478 | Invalid certificate authority
ERROR_NET_CLIENT_AUTH_NOT_SETUP | -479 | Client authorization wasn't setup yet.
ERROR_NET_REDIRECT_SCHEME_CHANGE | -481 | Redirect scheme change.
ERROR_NET_HTTPS_HTTP_SUBMIT_REDIR | -484 | HTTP submitting redir.
ERROR_NET_INSERT_CDROM | -485 | Please insert CD Rom into the CD drive.
ERROR_NET_HTTP_HEADER_NOT_FOUND | -486 | The requested header could not be located
ERROR_NET_HTTP_DOWNLEVEL_SERVER | -487 | The server did not return any headers
ERROR_NET_HTTP_INVALID_SERVER_RESPONSE | -488 | The server response could not be parsed
ERROR_NET_HTTP_INVALID_HEADER | -489 | The supplied header is invalid
ERROR_NET_HTTP_INVALID_QUERY_REQUEST | -490 | The request made to HttpQueryInfo is invalid
ERROR_NET_HTTP_HEADER_ALREADY_EXISTS | -491 | The header could not be added because it already exists
ERROR_NET_HTTP_REDIRECT_FAILED | -492 | An HTTP redirection failed
ERROR_NET_HTTP_NOT_REDIRECTED | -493 | The HTTP redirection did not occur
ERROR_NET_HTTP_COOKIE_NEEDS_CONFIRMATION | -494 | Before a cookie is set there needs to be confirmation
ERROR_NET_HTTP_COOKIE_DECLINED | -495 | Trying to assign a cookie was declined
ERROR_NET_HTTP_REDIRECT_NEEDS_CONFIRMATION | -496 | The HTTP redirection needs to be confirmed
ERROR_NET_NO_OPEN_REQUEST | -497 | Operation cannot be completed because there are no open requests
ERROR_VECTOR_IS_LOCKED | -500 | Vector handle is locked
ERROR_VECTOR_IS_EMPTY | -501 | Vector is empty
ERROR_VECTOR_LAYER_NOT_FOUND | -502 | Layer is not found
ERROR_VECTOR_LAYER_IS_LOCKED | -503 | Layer is locked
ERROR_VECTOR_LAYER_ALREADY_EXISTS | -504 | Layer already exists
ERROR_VECTOR_OBJECT_NOT_FOUND | -505 | Object is not found
ERROR_VECTOR_INVALID_OBJECT_TYPE | -506 | Invalid object type
ERROR_VECTOR_PEN_NOT_FOUND | -507 | Pen is not found
ERROR_VECTOR_BRUSH_NOT_FOUND | -508 | Brush is not found
ERROR_VECTOR_FONT_NOT_FOUND | -509 | Font is not found
ERROR_VECTOR_BITMAP_NOT_FOUND | -510 | Bitmap is not found
ERROR_VECTOR_POINT_NOT_FOUND | -511 | Point is not found
ERROR_VECTOR_ENGINE_NOT_FOUND | -512 | Vector engine not found
ERROR_VECTOR_INVALID_ENGINE | -513 | Invalid vector engine
ERROR_VECTOR_CLIPBOARD | -514 | Clipboard error
ERROR_VECTOR_CLIPBOARD_IS_EMPTY | -515 | Clipboard is empty
ERROR_VECTOR_CANT_ADD_TEXT | -516 | Cannot add text
ERROR_VECTOR_CANT_READ_WMF | -517 | Cannot read WMF
ERROR_VECTOR_GROUP_NOT_FOUND | -518 | Group is not found
ERROR_VECTOR_GROUP_ALREADY_EXISTS | -519 | Group already exists
ERROR_JP2_FAILURE | -530 | Error in JP2 Box values
ERROR_JP2_SIGNATURE | -531 | The header does not match the JP2 signature - not a JP2 file
ERROR_JP2_UNSUPPORTED | -532 | JP2 file has a feature that is unsupported
ERROR_J2K_FAILURE | -533 | Invalid save options were specified to the encoder
ERROR_J2K_NO_SOC | -534 | File header does not contain SOC marker
ERROR_J2K_NO_SOT | -535 | File contains complete header but no compressed image data
ERROR_J2K_INFORMATION_SET | -536 | Invalid save options were specified or file includes invalid encoded values
ERROR_J2K_LOW_TARGET_SIZE | -537 | Compression ratio, target file size, or tile size was too small for encoder
ERROR_J2K_DECOMPOSITION_LEVEL | -538 | Specified Wavelet decomposition level was too high
ERROR_J2K_MARKER_VALUE | -539 | Decoder could not translate J2K marker - file is corrupt or invalid
ERROR_J2K_UNSUPPORTED | -540 | J2K file has image with more than 30 bits per component
ERROR_J2K_FILTER_MISSING | -541 | J2K filter is needed to use this function
ERROR_J2K_LOCKED | -542 | J2K support is locked
ERROR_TWAIN_NO_LIBRARY | -560 | TWAIN libraries not found.
ERROR_TWAIN_NOT_AVAILABLE | -560 | At least one of the TWAIN DLLs is missing
ERROR_TWAIN_INVALID_DLL | -561 | Invalid DLL.
ERROR_TWAIN_NOT_INITIALIZED | -562 | TWAIN source not initialized.
ERROR_TWAIN_CANCELED | -563 | Cancel operation done.
ERROR_TWAIN_CHECK_STATUS | -564 | An error in the status of the TWAIN source.
ERROR_TWAIN_END_OF_LIST | -565 | End of the enumeration list.
ERROR_TWAIN_CAP_NOT_SUPPORTED | -566 | Required capability not supported.
ERROR_TWAIN_SOURCE_NOT_OPEN | -567 | TWAIN source not being open.
ERROR_TWAIN_BAD_VALUE | -568 | Invalid capability value
ERROR_TWAIN_INVALID_STATE | -569 | TWAIN source state is not valid for the required operation.
ERROR_TWAIN_CAPS_NEG_NOT_ENDED | -570 | Capability negotiation ended before the current operation.
ERROR_TWAIN_OPEN_FILE | -571 | Can't open required file.
ERROR_TWAIN_INV_HANDLE | -572 | Invalid handle was passed.
ERROR_TWAIN_WRITE_TO_FILE | -573 | Error trying write to a file.
ERROR_TWAIN_INV_VERSION_NUM | -574 | Invalid version number.
ERROR_TWAIN_READ_FROM_FILE | -575 | Error reading from file.
ERROR_TWAIN_NOT_VALID_FILE | -576 | Invalid file
ERROR_TWAIN_INV_ACCESS_RIGHT | -577 | Invalid access right to file
ERROR_TWAIN_CUSTOMBASE | -578 | Custom return code base
ERROR_TWAIN_DENIED | -579 | Operation denied (device not ready)
ERROR_TWAIN_FILEEXISTS | -580 | Specified output file name already exists
ERROR_TWAIN_FILENOTFOUND | -581 | Input file name not found or output file name invalid
ERROR_TWAIN_NOTEMPTY | -582 | Directory is not empty & can not be deleted
ERROR_TWAIN_PAPERJAM | -583 | Transfer failed because of a feeder error
ERROR_TWAIN_PAPERDOUBLEFEED | -584 | Transfer failed because of a feeder error
ERROR_TWAIN_FILEWRITEERROR | -585 | Error writing to the specified file
ERROR_TWAIN_CHECKDEVICEONLINE | -586 | The device has been powered off
ERROR_TWAIN_STOP_SCAN | -587 | The feeder is stopped by the user.
ERROR_TWAIN_STOP_ENUMERATION | 2 | Function successful with an abort request.
ERROR_PAINT_INTERNAL | -600 | Internal error (Call LEAD)
ERROR_PAINT_INV_DATA | -601 | Internal error (Call LEAD)
ERROR_PAINT_NO_RESOURCES | -602 | Internal error (Call LEAD)
ERROR_PAINT_NOT_ENABLED | -603 | DigitalPaint capability is required to use this function
ERROR_CONTAINER_INV_HANDLE | -630 | Invalid container handle.
ERROR_CONTAINER_INV_OPERATION | -631 | Invalid container operation
ERROR_CONTAINER_NO_RESOURCES | -632 | No container resources
ERROR_TOOLBAR_NO_RESOURCES | -660 | No toolbar resources available
ERROR_TOOLBAR_INV_STATE | -661 | Invalid toolbar state
ERROR_TOOLBAR_INV_HANDLE | -662 | Invalid toolbar handle
ERROR_AUTOMATION_INV_HANDLE | -690 | Invalid automation handle
ERROR_AUTOMATION_INV_STATE | -691 | Invalid automation state
ERROR_INV_SEG_HANDLE | -700 | Invalid segmentation handle
ERROR_INV_SEG_DATA | -701 | Invalid segmentation data
ERROR_INV_LAYER_DATA | -702 | Invalid layer data
ERROR_MRC_NOT_ALLOCATED | -703 | Segmentation handle not initialized
ERROR_INV_MIN_SEGMENT | -704 | Invalid minimum segment width or height
ERROR_SEGMENTATION_FAILURE | -705 | Segmentation process Failure
ERROR_MRC_INV_PAGE | -706 | Invalid MRC file's page number
ERROR_PDF_FILE_ENCRYPTED | -721 | The PDF file is encrypted and the szPassword member of the FILEPDFOPTIONS is not set. (No password.)
ERROR_PDF_INVALID_PASSWORD | -722 | Invalid password specified
ERROR_PDF_FAX_NOT_ENABLED | -723 | LFFAX is required for this function
ERROR_PDF_JPEG_NOT_ENABLED | -724 | LFCMP is required for this function
ERROR_PDF_INV_DOC_STRUCTURING_COMMENTS | -725 | Invalid Document Structuring Comments (PS and EPS)
ERROR_PDF_FONTS_DIRECTORY_NOT_FOUND | -726 | Could not find the Fonts directory.
ERROR_PDF_CANNOT_EDIT_FILE | -727 | Cannot insert, delete, append or replace pages.
ERROR_PDF_BAD_CONTENT | -728 | File is corrupted.
ERROR_PDF_BAD_INITIALIZATION_FILES | -729 | The files required for initializing the PDF engine were not found, or they were found, but are not correct.
ERROR_ISAPI_CONFIG_NOT_FOUND | -740 | Configuration not found in the registry
ERROR_ISAPI_DSN_NOT_FOUND | -741 | DSN not found in ODBC
ERROR_ISAPI_SQL_EXEC | -742 | Table or fields not found in database
ERROR_ISAPI_RECORD_NOT_FOUND | -743 | Record not found in database
ERROR_ISAPI_DATABASE_SETTING | -744 | Error on database settings in the registry
ERROR_ISAPI_DATABASE_SAVE_BITMAP | -745 | Can't save bitmap in database
ERROR_ISAPI_DATABASE_RECORD_DUPLICATE | -746 | Record already exists in the database, duplicate in primary key
ERROR_ISAPI_SESSION_FULL | -747 | Can't add user to ISAPI session
ERROR_ISAPI_CACHE_SYSTEM_NOT_ENABLED | -748 | The caching system is not enabled in the Configuration Settings
ERROR_ISAPI_CACHE_MAX_SIZE | -749 | The maximum size of the cache limit.
ERROR_ISAPI_CACHE_SETTING | -750 | Error On Cache System Settings in Registry
ERROR_SVG_FILE_SIZE_READ | -770 | SVG - Invalid File Size Read
ERROR_SVG_ROOT_NOT_SVG | -771 | SVG - ROOT is Not SVG
ERROR_SVG_NOFOUND_ROOT_ELEMENT | -772 | SVG - Root Element Not Found
ERROR_SVG_INV_ELEMENT | -773 | SVG - Invalid Element
ERROR_SVG_DUPLICATED_ATTRIBUTE | -774 | SVG - Duplicated Attribute
ERROR_SVG_INV_ATTRIBUTE | -775 | SVG - Invalid Attribute
ERROR_SVG_INV_ATTRIBUTE_VALUE | -776 | SVG - Invalid Attribute Value
ERROR_SVG_BAD_CSS_PROPERTY | -777 | SVG - Bad CSS Property
ERROR_SVG_MISSING_REQUIRED_ATTRIBUTE | -778 | SVG - Missing Required Attribute
ERROR_SVG_DUPLICATED_ID | -779 | SVG - Duplicated ID
ERROR_SVG_INV_COORDINATES_NUMBER | -780 | SVG - Invalid Coordinates Number
ERROR_SVG_INV_STRING_COMMA | -781 | SVG - Invalid String Comma
ERROR_INVALID_FORMAT | -785 | Invalid format.
ERROR_UNSUPPORTED_METHOD | -786 | Unsupported method.
ERROR_OPENING_PROFILE | -787 | Opening profile.
ERROR_INVALID_COLOR_PROFILE | -788 | Invalid color profile.
ERROR_INVALID_STRUCT_SIZE | -789 | Invalid structure size.
ERROR_U_V_NOT_MULTIPLES | -791 | 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 | -792 | Non-planar vertical sub-sampling is not supported.
ERROR_PLANAR_ALIGNMENT_NOT_SUPPORTED | -793 | Planar alignment is not supported.
ERROR_UNSUPPORTED_CONVERSION | -794 | Unsupported conversion.
ERROR_TRUNCATE_HEIGHT | -795 | Height was truncated.
ERROR_TRUNCATE_WIDTH | -796 | Width was truncated.
ERROR_TRUNCATE_WIDTH_AND_HEIGHT | -797 | Height and width were truncated.
ERROR_LAYER_MISSING | -800 | The PSD layer is missing.
ERROR_BAD_MARKER | -801 | Bad JPEG marker.
ERROR_AUDIO_MISSING | -802 | The audio data is not present.
ERROR_DICOM_NOT_ENABLED | -803 | DICOM support is required to use this function
ERROR_EXTGRAY_NOT_ENABLED | -804 | Extended grayscale support is required to use this function
ERROR_FILE_READONLY | -805 | File is read-only. Cannot open file with write access
ERROR_BAD_RESYNC_MARKER | -806 | Bad JPEG Resync marker
ERROR_LTCLR_MISSING | -807 | LTCLR DLL is missing
ERROR_MARKER_SIZE_TOO_BIG | -808 | The size of the JPEG marker cannot exceed 64K
ERROR_MARKER_MISSING | -809 | The required JPEG marker is missing
ERROR_EXTENSIONS_MISSING | -810 | This file does not contain Exif extensions
ERROR_MARKER_INDEX | -811 | The marker index is invalid (too big)
ERROR_NO_PROFILE | -812 | The ICC profile was not found
ERROR_DECODING_PROFILE | -813 | An error has occured while decoding the profile
ERROR_NULL_PTR | -814 | A NULL pointer was passed
ERROR_NO_OVERLAY | -815 | The overlay does not exist
ERROR_OVERLAY_INDEX | -816 | Something is wrong with the overlay index
ERROR_CORRUPT_PROFILE | -817 | The ICC profile was invalid
ERROR_LTSGM_MISSING | -818 | LTSGM DLL is missing
ERROR_DCR_FILTER_MISSING | -819 | LFDCR filter is needed to use this function
ERROR_KDC_FILTER_MISSING | -820 | LFKDC filter is needed to use this function
ERROR_DCS_FILTER_MISSING | -821 | LFDCS filter is needed to use this function
ERROR_LMC_FILTER_MISSING | -822 | LFLMC filter is needed to use this function
ERROR_ABC_FILTER_MISSING | -823 | LFABC (ABIC) filter is needed to use this function
ERROR_JB2_FILTER_MISSING | -824 | LFJB2 (JBIG2) filter is needed to use this function
ERROR_LTCLR_DLL_NOTLOADED | -900 | The LTCLR DLL is not loaded
ERROR_LTDLGRES_DLL_NOTLOADED | -901 | The LDLGRES DLL is not loaded
ERROR_LTDLG_COLOR_NOTINITIALIZE | -902 | You must initialize LTDLG using L_DlgInit
ERROR_IMAGE_SIZE | -910 | Image size not sufficient
ERROR_NO_MESSAGE | -911 | There is no message
ERROR_INV_PASSWORD | -912 | Invalid password
ERROR_TIFF_COMMAND_NOT_ALLOWED | -913 | The specified TIFF command is not allowed
ERROR_BAD_TIFF_TAG_VALUE | -914 | Bad TIFF Tag value
ERROR_NOT_MULTIPAGE_TIFF_FILE | -915 | Not Multi-Page TIFF file
ERROR_DELETE_TIFF_FILE_NOT_ALLOWED | -916 | Not allowed to delete the TIFF file
ERROR_COMPACT_ABORTED | -917 | The compact function was finished without copying all the pages.
ERROR_INV_COLORSPACE | -918 | Invalid color-space
ERROR_LTPRO_NOT_ENABLED | -930 | LEADTOOLS Pro Features are not enabled
ERROR_EPRINT_LOCKED | -1000 | ePrint is locked, Please execute a License Agreement
ERROR_OPT_ABORT | -1100 | Abort the optimization operation
ERROR_OPT_SKIPIMAGE | -1101 | Skip optimizing current image
ERROR_OPT_INVALID_INPUT_PATH | -1102 | Invalid input path
ERROR_OPT_INVALID_OUTPUT_PATH | -1103 | Invalid output path
ERROR_OPT_CANNOT_CREATE_OUTPUTPATH | -1104 | Cannot Create Output Directory
ERROR_ICC_UNKNOWN_TAG | -1150 | Unknown ICC profile Tag
ERROR_ICC_UNKNOWN_TYPE | -1151 | Unknown ICC profile Type
ERROR_ICC_UNKNOWN_TAG_AND_TYPE | -1152 | Unknown ICC profile Tag and Type
ERROR_INVALID_ICC_PROFILE | -1153 | Invalid ICC profile
ERROR_ICC_IMAGE_NOT_SUPPORTED | -1154 | Invalid ICC profile
ERROR_DOC_DLL_NOT_LOADED | -1200 | ScanSoft DLLs are not loaded
ERROR_DOC_INV_PAGE_INDEX | -1201 | Specified index is not corrected
ERROR_DOC_INV_FILLMETHOD | -1202 | Invalid fill method.
ERROR_DOC_INV_RECOG_MODULE | -1203 | Invalid recognition module
ERROR_DOC_INV_CHAR_FILTER | -1204 | Invalid character filter
ERROR_DOC_INV_ZONE_TYPE | -1205 | Invalid zone type
ERROR_DOC_INV_LANGID | -1206 | Invalid language Id
ERROR_DOC_INV_SPELL_LANGUAGE | -1207 | Invalid spell language
ERROR_DOC_INV_SECTION_ENUMERATION | -1208 | Invalid enumeration section
ERROR_DOC_INV_PAGE_COUNT | -1209 | Invalid page count
ERROR_DOC_ILLEGAL_CODE | -1210 | Illegal internal code as a parameter
ERROR_DOC_INV_PARAMETER | -1211 | Set parameter is not acceptable
ERROR_DOC_END_LIST_CODE_PAGES | -1212 | End of list of the available Code Pages
ERROR_DOC_LOAD_CODE_PAGE_FILE | -1213 | Error while loading the Code Page Definition file
ERROR_DOC_INV_BUFFER_SIZE | -1214 | The length of the exported code exceeds the buffer size
ERROR_DOC_INV_CHARACTER_CONVERSION | -1215 | Character conversion is not available for the given character
ERROR_DOC_INV_CHARACTER_LANGUAGE | -1216 | 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 | -1217 | Character Set and Code Pages module initialization error
ERROR_DOC_INITIALIZE_ENGINE | -1218 | OCR engine initialization error, or there is no appropriate license
ERROR_DOC_TERMINATE_ENGINE | -1219 | OCR engine termination error
ERROR_DOC_INITIALIZE_WARNING | -1220 | Module initialization warning
ERROR_DOC_PROCESS_USER_ABORT | -1221 | Application has aborted the current process
ERROR_DOC_FINISH_PROCESS | -1222 | Application has terminated the current recognition process without losing the recognized text
ERROR_DOC_MODULE_MISSING | -1223 | Module is not present
ERROR_DOC_MODULE_LOAD | -1224 | OS could not load a module
ERROR_DOC_MODULE_MISSING_ENTRY | -1225 | Missing entry in a module
ERROR_DOC_MODULE_INVALID | -1226 | Invalid module
ERROR_DOC_MODULE_INITIALIZE | -1227 | Module initialization error
ERROR_DOC_FEATURE_NOT_SUPPORTED | -1228 | The requested function is not available, or there is no appropriate license
ERROR_DOC_GENERAL | -1229 | General error in the engine
ERROR_DOC_GPF | -1230 | General Protection Fault in the engine
ERROR_DOC_NOT_SUPPORT_OS | -1231 | Not supported operational system
ERROR_DOC_INV_SETTING_FILE | -1232 | Syntax error in the specified engine Settings file
ERROR_DOC_INV_SETTING | -1233 | Invalid setting
ERROR_DOC_ENGINE_BUSY | -1234 | The engine is busy
ERROR_DOC_RECOGNITION_TIME_OUT | -1235 | Recognition process Time Out
ERROR_DOC_INV_IMAGE_MODULE_SETTING | -1236 | Internal error in image module
ERROR_DOC_NO_MEMORY | -1237 | Not enough memory during image processing
ERROR_DOC_INV_IMAGE_DIMENSIONS | -1238 | Invalid rectangle dimensions
ERROR_DOC_INV_IMAGE_RESOLUTION | -1239 | Non-supported resolution
ERROR_DOC_CANNOT_COMPRESS_IMAGE | -1240 | Cannot process compressed image
ERROR_DOC_BAD_BITMAP | -1241 | Invalid bitmap address
ERROR_DOC_NOT_SUPPORT_BPP | -1242 | Unsupported BitsPerPixel value
ERROR_DOC_INV_IMAGE_MODULE | -1243 | Internal error in image module
ERROR_DOC_INV_IMAGE_HANDLE | -1244 | Invalid image handle
ERROR_DOC_BUFFER_OVERFLOW | -1245 | Buffer overflow during processing the image
ERROR_DOC_ACCESS_DENIED | -1246 | Image operation denied
ERROR_DOC_NO_MORE_LINES | -1247 | No more lines in defined image area
ERROR_DOC_BAD_IMAGE_SIZE | -1248 | Non-supported image size
ERROR_DOC_BAD_ENGINE_MANAGER_MODULE | -1249 | Engine manager module error
ERROR_DOC_NO_RECOGNIZED_TEXT_AVAILABLE | -1250 | 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 | -1251 | There is no selected recognition module
ERROR_DOC_NO_ZONE | -1252 | There is no zone in the zone list
ERROR_DOC_INV_ZONE_INDEX | -1253 | Invalid zone index
ERROR_DOC_INV_ZONE_COORDINATES | -1254 | Invalid zone coordinates
ERROR_DOC_MOR_INITIALIZE_MODULE | -1255 | MOR recognition module initialization error
ERROR_DOC_MOR_BASE_FILE_NOT_FOUND | -1256 | MOR recognition module's knowledge base file not found
ERROR_DOC_MOR_BASE_FILE_CORRUPTED | -1257 | MOR recognition module's knowledge base file corrupted
ERROR_DOC_MOR_BASE_FILE_VERSION | -1258 | Incorrect knowledge base file version
ERROR_DOC_MOR_IMAGE_SIZE | -1259 | Size of image is too large
ERROR_DOC_MOR_FILE_CORRUPTED | -1260 | File is corrupted
ERROR_DOC_MOR_BAD_RECOG_MODULE | -1261 | Internal error in the MOR recognition module
ERROR_DOC_MOR_GPF_MODULE | -1262 | General Protection Fault in the MOR recognition module
ERROR_DOC_DOT_RECOGNITION | -1263 | Dot-matrix recognition error
ERROR_DOC_OMR_CHECKMARK_RECOGNITION | -1264 | Checkmark recognition error
ERROR_DOC_HNR_BASE_FILE__CORRUPTED | -1265 | HNR module's knowledge base file is corrupted
ERROR_DOC_HNR_PARAM_OUT_RANGE | -1266 | Parameter is out of valid range
ERROR_DOC_RER_MODULE | -1267 | Internal error in the RER module
ERROR_DOC_RER_BASE_FILE_NOT_FOUND | -1268 | RER module's knowledge base file not found
ERROR_DOC_RER_CHAR_SET_EMPTY | -1269 | Character Set is empty for the RER module
ERROR_DOC_RER_CHAR_SET_NOT_SUPPORTED | -1270 | The specified Character Set not fully supported by the RER recognition module
ERROR_DOC_RER_MODULE_NOT_FOUND | -1271 | RER specific file not found
ERROR_DOC_SPELL_NO_MEMORY | -1272 | Not enough memory for the SPL module
ERROR_DOC_SPELL_UNINITIALIZED | -1273 | Un-initialized spell object
ERROR_DOC_SPELL_FILE_OPEN | -1274 | Spell file open error
ERROR_DOC_SPELL_FILE_READ | -1275 | Spell file read error
ERROR_DOC_SPELL_USER_DICTIONARY_WRITE | -1276 | User dictionary write error
ERROR_DOC_SPELL_INV_FILE_FORMAT | -1277 | Invalid file format
ERROR_DOC_SPELL_INITIALIZE_MODULE | -1278 | Module initialization error
ERROR_DOC_SPELL_USER_DICTIONARY_CLOSE | -1279 | User dictionary close error
ERROR_DOC_SPELL_ILLEGAL_LANGUAGE_SETTING | -1280 | Illegal language setting
ERROR_DOC_SPELL_NO_MORE_ITEMS | -1281 | No more suggestions/items available
ERROR_DOC_SPELL_CHECK_ERROR | -1282 | Internal checking error
ERROR_DOC_SPELL_ITEM_ALREADY_EXIST | -1283 | Item already exists in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_EXIST | -1284 | Item doesn't exist in the User dictionary
ERROR_DOC_SPELL_ITEM_NOT_INSERTED | -1285 | Item wasn't inserted into the User dictionary
ERROR_DOC_SPELL_SECTION_NOT_EXIST | -1286 | Section does not exist in the User dictionary
ERROR_DOC_SPELL_BAD_SYNTEX | -1287 | Regular expression syntax error
ERROR_DOC_OUTPUT_NOT_INITIALIZED | -1288 | Output format conversion subsystem was not initialized
ERROR_DOC_OUTPUT_CONVERT_NOT_EXIST | -1289 | No more converters available
ERROR_DOC_OUTPUT_CONVERT_DLL_NOT_EXIST | -1290 | There is no converter DLL file
ERROR_DOC_OUTPUT_BAD_PARAMETER | -1291 | Wrong parameter or parameter not found
ERROR_DOC_OUTPUT_FILE_CORRUPTED | -1292 | TMP file is corrupted
ERROR_DOC_OUTPUT_FILE_NOT_FOUND | -1293 | TMP file not found
ERROR_DOC_OUTPUT_CREATE_FILE | -1294 | Cannot create TMP file
ERROR_DOC_OUTPUT_SEEK_FILE | -1295 | Cannot seek in TMP file
ERROR_DOC_OUTPUT_READ_FILE | -1296 | TMP file read error
ERROR_DOC_OUTPUT_WRITE_FILE | -1297 | TMP file write error
ERROR_DOC_OUTPUT_CLOSE_FILE | -1298 | Cannot close TMP file
ERROR_DOC_OUTPUT_LOAD_DLL | -1299 | Cannot load the DLL file
ERROR_DOC_OUTPUT_END_OF_FILE | -1300 | Internal error in ATMTXT module. (End-Of-File detected)
ERROR_DOC_OUTPUT_NO_MEMORY | -1301 | Not enough memory for ATMTXT/TMP module
ERROR_DOC_OUTPUT_IMAGE_NOT_AVAILABLE | -1302 | Image is not available for inserting into the output
ERROR_DOC_OUTPUT_NOT_REGISTER_INFO_ITEM | -1303 | Not enough memory to register an info item
ERROR_DOC_TXT_FILE_OPEN | -1304 | Output file open error
ERROR_DOC_TXT_FILE_READ | -1305 | Output file read error
ERROR_DOC_TXT_FILE_NOT_FOUND | -1306 | Output file not found
ERROR_DOC_TXT_FILE_WRITE | -1307 | Output file write error
ERROR_DOC_TXT_INV_COMMAND_SEQUENCE | -1308 | Invalid command sequence in the ICF file
ERROR_DOC_TXT_CREATE_FILE | -1309 | Cannot create the output file
ERROR_DOC_TXT_NO_MEMORY | -1310 | Not enough memory for ATMTXT/TXT module
ERROR_DOC_TXT_INV_DOCUMENT | -1311 | Invalid document type
ERROR_DOC_TXT_FILE_TOO_LARGE | -1312 | File too large
ERROR_DOC_TXT_WARNING_OUTPUT_FILE | -1313 | There was a WARNING during the output file conversion
ERROR_DOC_TXT_OPERATION_CANCELLED | -1314 | Operation cancelled.
ERROR_DOC_TXT_ILLEGAL_OPTION | -1315 | Illegal option specified
ERROR_DOC_TXT_ENCRYPTED_SOURCE | -1316 | Encrypted source
ERROR_DOC_TXT_SEEK_ERROR | -1317 | Output file seek error
ERROR_DOC_BRAILLE_BAD_INITIALIZATION | -1318 | Braille recognition module initialization error
ERROR_DOC_MATRIX_BAD_INITIALIZATION | -1319 | Matrix matching recognition module initialization error
ERROR_DOC_MTX_BAD_INITIALIZATION | -1320 | M/TEXT recognition module initialization error
ERROR_DOC_NON_IMPLEMENTED_FEATURE | -1321 | Non-implemented feature
ERROR_DOC_NOT_FOUND_ZONE | -1322 | couldn't find specific zone
ERROR_DOC_NO_SELECTED_ZONE | -1323 | No available selected zone
ERROR_DOC_EXPORT_PAGE | -1324 | can't export the specified page
ERROR_DOC_LOCK_PAGE | -1325 | can't lock the specified page
ERROR_DOC_ACTIVE_PAGE | -1326 | can't set the specified page to be activated.
ERROR_DOC_LOCKED | -1327 | The OCR document engine is locked
ERROR_DOC_OUTPUT_PDF_LOCKED | -1328 | Output PDF engine is locked.
ERROR_DOC_OMR_LOCKED | -1329 | OMR Options is locked
ERROR_DOC_ICR_LOCKED | -1330 | ICR Options is locked
ERROR_INV_VARIANT_TYPE | -1350 | Invalid Variant type
ERROR_INV_STRING | -1351 | Invalid string value
ERROR_INV_DISPATCH | -1352 | Invalid dispatch
ERROR_INV_FILTERNAME | -1353 | Invalid filter name
ERROR_SIGNED_DATA_NOT_SUPPORTED | -1360 | Signed image data not supported
ERROR_LMC_LOCKED | -1361 | LMC file format is locked
ERROR_JBIG2_LOCKED | -1362 | JBIG2 file format is locked


ANNENUMCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hObject, pUserData)

HANNOBJECT hObject; | /* object handle */
L_VOID L_FAR * pUserData; | /* pointer to additional data */

Processes each annotation object from the L_AnnEnumerate function.

Parameter | Description
hObject | Handle of the object to be processed.
pUserData | Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the L_AnnEnumerate function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

The L_AnnEnumerate function calls your callback function as it gets the handle of each annotation object.

Example

For an example, refer to L_AnnEnumerate.


ANNENUMHANDLECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hObject, pHandleInfo, pUserData)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */
L_VOID L_FAR * pUserData; | /* pointer to additional data */

Processes each annotation object from the L_AnnEnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.
pUserData | Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. This is the same pointer that you pass in the pUserData parameter of the L_AnnEnumerateHandles function. Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_CHANGE | [1] Change the object.
SUCCESS_NOCHANGE | [2] Do not change the object.

Comments

The L_AnnEnumerateHandles function calls your callback function for each handle of a single annotation object.

The pHandleInfo structure 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 node that can be changed with this function are:

ID

Visibility

Pen color

Fill color

Shape

Cursor

To change the location of a user-defined node, use L_AnnChangeUserHandle.

To change the properties of an annotation object handle, set the corresponding field in the pHandleInfo structure, and return SUCCESS_CHANGED. To leave the handle properties unchanged, return SUCCESS_UNCHANGED.

For more information, refer to the documentation for ANNHANDLEINFO.

Example

For an example, refer to L_AnnEnumerateHandles.


ANNENUMTEXTTOKENTABLECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(nTextTokenCount, nIndex, pTextToken, pUserData);

L_INT nTextTokenCount; | /* total number of tokens in the text token table */
L_INT nIndex; | /* index of the text token */
pANNTEXTTOKEN pTextToken; | /* structure that defines the text token */
L_VOID L_FAR * pUserData; | /* pointer to additional data */

Processes each text token in the annotation text token table from the L_AnnEnumerateTextTokenTable function. This function is called zero or more times as a result of a call to L_AnnEnumerateTextTokenTable.

Parameter | Description
nTextTokenCount | Total number of tokens in the text token table.
nIndex | Index of the particular token. The index is zero-based.
pTextToken | A pANNTEXTTOKEN structure that defines the the text token. For more information, see the documentation for the pANNTEXTTOKEN structure.
pUserData | Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the L_AnnEnumerateTextTokenTable function.) Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

The L_AnnEnumerateTextTokenTable function calls your callback function for each token in the annotation text token table. For example, suppose there are four entries in the text token table. A call to L_AnnEnumerateTextTokenTable will call your callback function four times—once for each token. For each of the four calls, nTextTokenCount will be 4. Since nIndex is zero-based, nIndex will be 0 in the first call to your callback function, and 3 in the last call to your callback function.

Example

For an example, refer to L_AnnEnumerateTextTokenTable.


BITMAPSLICECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, lpSliceRect, nAngle, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPRECT lpSliceRect; | /* pointer to the bounding rectangle of the extracted slice */
L_INT nAngle; | /* deskew angle */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles each Slice segment found by the L_SliceBitmap function.

Parameter

Description

pBitmap

Optional parameter that points to the bitmap handle referencing the sliced bitmaps. It is the programmer's responsibility to free this bitmap (using L_FreeBitmap(pBitmap), and GlobalFree(pBitmap)) when it is no longer needed. This parameter is updated only if SLC_CUTSLICES flag of the SLICEBITMAPOPTIONS structure is used, else it will be NULL.

lpSliceRect

Pointer to a RECT structure that contains the bounding rectangle of the extracted slice.

nAngle

Deskew angle. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_SliceBitmap)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | Continue the process.
-1 | Stop the process and return the specified error code. Refer to Return Codes.

Comments

The callback is called once for each slice that is detected. Return a positive number to continue the process. Return a negative number to abort.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_SliceBitmap.
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Raster Image Functions: Creating and Using a Region

Example

For an example, refer to L_SliceBitmap.


BORDERREMOVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hRgn, uBorderToRemove, pBoundingRect, pUserData)

HRGN hRgn; | /* windows region */
L_UINT32 uBorderToRemove; | /* border flag */
PRECT pBoundingRect; | /* pointer to a RECT structure */
L_VOID L_FAR* pUserData; | /* pointer to additional parameters */

Handles each border found by L_BorderRemoveBitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRgn | Windows region representing the border to be removed. It is the programmers responsibility to delete this region (using DeleteObject() when it is no longer needed.
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.
pBoundingRect | Pointer to a RECT structure that contains the bounding rectangle of the border being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_BorderRemoveBitmap.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Remove the border.
SUCCESS_NOREMOVE | Do not remove the border.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called once for each border found. It is called a maximum of four times for each call to the API. Return SUCCESS_REMOVE to have the border removed. Return SUCCESS_NOREMOVE to leave the border unchanged. Pass any other value to abort. This value will be the return value of the L_BorderRemoveBitmap(). If flags BORDER_IMAGE_UNCHANGED and BORDER_SINGLE_REGION are being used, then the return value of the callback affects only the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_BorderRemoveBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_BorderRemoveBitmap.


BROWSEDIRCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(pBitmap, pszFilename, pInfo, nStatusCode, nPercent, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_TCHAR L_FAR * pszFilename; | /* pointer to the filename */
pFILEINFO pInfo; | /* pointer to the file info structure */
L_INT nStatusCode; | /* status code */
L_INT nPercent; | /* percentage completion of a file load */
L_VOID L_FAR* pUserData; | /* pointer to additional parameters */

Handles the thumbnails generated by calling the L_BrowseDir function.

Parameter | Description
pBitmap | The pointer to the bitmap handle referencing the thumbnail generated by L_BrowseDir. You can copy this bitmap, save it to file, insert it into a LEADTOOLS ImageList Control, or otherwise process it as needed in your application.
pszFilename | Character string containing the filename from which this thumbnail was generated.
pInfo | Pointer to a FILEINFO structure containing information about pszFilename.
nStatusCode | Status code. If an error occurred during thumbnail generation, this will be < SUCCESS. Possible values are:
 | Value | Meaning
 | <SUCCESS | An error occurred.
 | SUCCESS | [1] Image was loaded.
 | BROWSE_LOADING | [2] Indicates image is being loaded, see nPercent.
 | BROWSE_SKIPPED | [3] Indicates image was skipped because it was larger than the specified range in L_BrowseDir.
 | BROWSE_PRELOAD | [4] Indicates that LEADTOOLS has found a file and is about to determine the file format. It will then attempt to create a thumbnail for it. If the user wishes to avoid the internal file information processing, return ERROR_FILE_FORMAT. This will cause LEADTOOLS to skip the file.
nPercent | Represents the percentage completion of a file load when nStatusCode is equal to BROWSE_LOADING.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.). Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

You must return SUCCESS to continue browsing for supported image files. The value you return from this callback will also be returned from L_BrowseDir.

Required DLLs and Libraries

LTFIL
LTIMG
LTTMB
File format DLLs

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

See Also

Functions: | L_BrowseDir, L_LoadBitmap, L_GetCompressFileStamp, L_SetExtFileOption, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution
Topics: | Thumbnail Browser

Example

For an example, refer to L_BrowseDir.


COLORRESCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, pBuffer, nLines, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle*/
L_UCHAR L_FAR * pBuffer; | /* pointer to a buffer of the caller's output data*/
L_INT nLines; | /* number of lines in the buffer*/
L_VOID L_FAR * pUserData; | /* pointer to additional parameters*/

Handles the converted image data that the L_ColorResBitmap function has written to a buffer.

Parameter | Description
pBitmap | The pointer to the bitmap handle referencing the bitmap that contains the image information.
pBuffer | A pointer to a buffer containing one or more lines of output image data that the calling function has already converted.
nLines | The number of lines in the pBuffer buffer.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This is an optional callback function for additional processing. (The bitmap is modified the same way, whether you provide a callback function or not.) For an explanation of how the callback function is used, refer to L_ColorResBitmap.

See Also

L_ColorResBitmap

Example

/* This COLORRESCALLBACK function paints the image as the image is processed. */

/**************** Global declarations **************************************/

HPALETTE hpalPaint; /* Paint palette handle */

RECT rLeadDest; /* Destination rectangle for painting */

RECT rLeadSource; /* Source rectangle for painting */

/* Structure used for the callback function's user data */

typedef struct tagIMAGECBPARM
{

HWND hwnd; /* Current window */

HDC hdc; /* Device context for the current window */

L_INT nRow; /* First row in the input buffer */

} IMAGECBPARM;

/*******************************************************************************/

L_INT L_EXPORT EXT_CALLBACK ColorResCallback (pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer, L_INT nLines,
IMAGECBPARM L_FAR* pUserData)
{
/* If this is the first call (row 0), select and realize the palette */
if( pUserData->nRow == 0 )
{
SendMessage (pUserData->hwnd, WM_QUERYNEWPALETTE, 0, 0L);
SelectPalette( pUserData->hdc, hpalPaint, TRUE );
RealizePalette(pUserData->hdc);
}

/* Paint the buffer to the specified device context */

L_PaintDCBuffer( pUserData->hdc, /* Device context - from function parameter */

pBitmap, /* Bitmap handle - from function parameter */

&rLeadSource, /* Source rect - set globally in WM_CREATE */

&rLeadSource, /* Source clip rect - same as source rect */

&rLeadDest, /* Destination rect - set globally in WM_CREATE */

&rLeadDest, /* Destination clip rect - same as destination rect */

SRCCOPY, /* ROP code for normal painting */

pBuffer, /* Input buffer - from function parameter */

pUserData->nRow, /* First row in buffer - from function parameter */

nLines ); /* Number of lines in the buffer - from function parameter */

/* Increment the current row by the number of lines in the buffer */
pUserData->nRow += nLines;

return( SUCCESS );
}


COMPBUFFCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, pBuffer, uBytes, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle*/
L_UCHAR L_FAR * pBuffer; | /* pointer to a buffer containing compressed data*/
L_UINT uBytes; | /* number of bytes in the buffer*/
L_VOID L_FAR * pUserData; | /* pointer to additional parameters*/

Writes output from the L_CompressBuffer function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that contains the image information.
pBuffer | Pointer to the caller's output buffer containing compressed data.
uBytes | The number of bytes in the buffer.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

See Also

Functions:

L_StartCompressBuffer, L_CompressBuffer, L_EndCompressBuffer

Example

For an example, refer to L_StartCompressBuffer.


DOTREMOVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hRgn, pBoundingRect, iWhiteCount, iBlackCount, pUserData)

HRGN hRgn; | /* windows region */
PRECT pBoundingRect; | /* pointer to a RECT structure */
L_INT32 iWhiteCount; | /* number of white pixels */
L_INT32 iBlackCount; | /* number of black pixels */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Handles each dot found by L_DotRemoveBitmap. This function is available in the Document/Medical toolkits.

Parameter | Description
hRgn | Windows region representing the dot to be removed. It is the programmer's responsibility to delete this region (using DeleteObject()) when it is no longer needed.
pBoundingRect | Pointer to a RECT structure that contains the bounding rectangle of the dot being processed.
iWhiteCount | Total number of white pixels in the dot being processed.
iBlackCount | Total number of black pixels in the dot being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_DotRemoveBitmap.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Remove the dot.
SUCCESS_NOREMOVE | Do not remove the dot.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called once for each dot, speck, or blob that is detected Return SUCCESS_REMOVE to have the dot removed. Return SUCCESS_NOREMOVE to leave the dot unchanged. Pass any other value to abort. This value will be the return value of the L_DotRemoveBitmap(). If DOT_IMAGE_UNCHANGED and DOT_SINGLE_REGION are being used, then the return value of the callback affects only the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_DotRemoveBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_DotRemoveBitmap.


ENUMGEOKEYSCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(uTag, uType, uCount, pData, pUserData)

L_UINT16 uTag; | /* GeoKey ID */
L_UINT16 uType; | /* GeoKey type */
L_UINT32 uCount; | /* number of GeoKey values */
L_VOID L_FAR * pData; | /* pointer to GeoKey data */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

This function is called for each GeoKey enumerated by the L_EnumFileGeoKeys function.

Parameter

Description

uTag

GeoKey ID identifying the GeoTIFF key.

uType

The type of GeoKey. This indicates whether the data pointed to by pData 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.

uCount

The number of items in the pData buffer. Note that this doesn't describe the number of bytes. For example, if uCount is 10 and uType is TAG_DOUBLE, you will need 10 x 8 = 80 bytes to read the tag data.

pData

A void pointer that you can use to access a variable or structure containing the GeoKey data. This gives you a way to receive data indirectly from the function that uses this callback function.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the L_EnumFileGeoKeys function.)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This function will be called for every GeoKey on the page.

See Also

Functions: | L_EnumFileGeoKeys, L_ReadFileGeoKey
Topics: | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

For an example, refer to L_EnumFileGeoKeys function.


ENUMMARKERSCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (uMarker, uMarkerSize, pMarkerData, pUserData, pfnLEADCallback, pLEADUserData)

L_UINT uMarker; | /* marker type */
L_UINT uMarkerSize; | /* marker size */
L_VOID L_FAR * pMarkerData; | /* marker data */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */
LEADMARKERCALLBACK pfnLEADCallback; | /* LEADMARKERCALLBACK callback function */
L_VOID L_FAR * pLEADUserData; | /* pointer to additional parameters */

Handles each marker provided by calling the L_EnumMarkers function.

Parameter | Description
uMarker | Value that represents the type of marker passed to the callback function. Possible values are range between 0xE0 and 0xFE. Other values are possible. To determine what marker types are allowed, refer to the JPEG specification.
uMarkerSize | Size of the type of marker indicated in uMarker, in bytes.
pMarkerData | A void pointer that you can use to access a variable or structure containing data associated with the marker indicated in uMarker, that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. This parameter is needed only if uMarkerSize > 0. The marker data should be at least uMarkerSize bytes.
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the L_EnumMarkers function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.
pfnLEADCallback | Callback function for writing each enumerated marker. Call this function if you want to insert an extra marker at the current position.
 | ENUMMARKERSCALLBACK calls this callback function as it gets the handle of each marker. The callback function is provided by LEADTOOLS and will adhere to the function prototype described in the LEADMARKERCALLBACK Function.
pLEADUserData | Void pointer that you should pass to pfnLEADCallback if you call it directly.

Returns

SUCCESS | Copy the current marker to the resulting marker collection. This resulting marker collection will be referenced by hMarkers when the L_EnumMarkers function successfully returns. Continue enumerating the remaining markers.
SUCCESS_IGNOREMARKER | Ignore the current marker. The current marker will be removed from the resulting marker collection. Continue enumerating the remaining markers.
SUCCESS_IGNOREALLMARKERS | Ignore the current marker and all remaining markers. Abort the enumeration without writing any other markers.
SUCCESS_IGNORETHISCOPYALL | Ignore the current marker but copy all the remaining markers to the resulting marker collection. Abort the enumeration but copy all remaining markers
SUCCESS_ABORT | Copy this and all remaining markers. Abort the enumeration.

Comments

This function will be called for every marker present in the handle. Return SUCCESS to leave the current marker in the marker collection. Return SUCCESS_IGNOREMARKER to delete the current marker from the collection.

Call pfnLEADCallback to insert a new marker in the collection before the current marker.

Required DLLs and Libraries

LTFIL

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

See Also

Functions: | L_EnumMarkers
Topics: | Working with Markers

Example

/* This example will demonstrate how you insert a marker AFTER the current marker.
I will insert a APP2 marker after the APP1 marker
APP2_marker_size and APP2_marker_data describe the APP2 marker data.

Replace them with your variables */

#define APP1 0xE1
#define APP2 0xE2

L_INT EXT_CALLBACK MyCallback(L_UINT uMarker, L_UINT uMarkerSize, L_UCHAR L_FAR* pMarkerData, L_VOID L_FAR* pUserData, LEADMARKERCALLBACK pfnLEADCallback, L_VOID L_FAR* pLEADUserData)
{
L_INT nRet;

if(uMarker == APP1)
{
/* Write the APP1 data by calling pfnLEADCallback */
nRet = pfnLEADCallback(uMarker, uMarkerSize, pMarkerData, pLEADUserData);
if(nRet != SUCCESS)
return nRet;

/* Write my APP2. You can call this function several times
if you need to write more than one marker. Make sure you replace APP2_marker_size and APP2_marker_data with your variables */
nRet = pfnLEADCallback(APP2, APP2_marker_size, APP2_marker_data, pLEADUserData);
if(nRet != SUCCESS)
return nRet;

/* do not write the current marker, because I have already done that */
return SUCCESS_IGNOREMARKER;
}

/* preserve the marker */
return SUCCESS;
}


ENUMTAGSCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (uTag, uType, uCount, pUserData)

L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16 uType; | /* tag data type */
L_UINT32 uCount; | /* number of values */
L_VOID L_FAR * pUserData; | /* user data that was passed to L_EnumFileTags */

L_EnumFileTags calls this callback for each tag present on the page.

Parameter | Description
uTag | Tag to identify the data in the TIFF file. This may be any tag specified in L_SetTag, 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 | 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.
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.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the L_EnumMarkers function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

L_EnumFileTags calls this callback for each tag in the page.

Do not attempt to use the L_DeleteTag function to delete tags from inside an ENUMTAGSCALLBACK callback function. If you want to delete tags that you enumerate, use ENUMTAGSCALLBACK to add the tags to a list. Upon returning from L_EnumFileTags, you can delete all the tags from the list.

See Also

Functions: | L_EnumFileTags, L_ReadFileTag
Topics: | Implementing TIFF Comments and Tags

Example

For an example, refer to L_ReadFileTag.


FILEREADCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pFileInfo, pBitmap, pBuffer, uFlags, nRow, nLines, pUserData)

pFILEINFO pFileInfo; | /* pointer to the file information handle */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to a buffer of the caller's output data */
L_UINT uFlags; | /* flags for first and last row, and first and last pass */
L_INT nRow; | /* current row number of the first line in the buffer */
L_INT nLines; | /* number of lines in the buffer */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles the output image data that the calling function has written to a buffer.

Parameter | Description
pFileInfo | The pointer to the FILEINFO structure that contains image information.
pBitmap | The pointer to the bitmap handle referencing the bitmap that contains the image information.
pBuffer | A pointer to a buffer containing one or more lines of output image data that the calling function has already processed (read or decompressed).
uFlags | Flags that describe whether this is the first or last call of the callback, and whether the buffer contains first or last row of image data. The following are possible flags:
 | Constant | Meaning
 | FILEREAD_FIRSTPASS | [0x0001] This is the first pass through a progressive JPEG or CMP file.
 | FILEREAD_LASTPASS | [0x0002] This is the last pass through a progressive JPEG or CMP file.
 | FILEREAD_FIRSTROW | [0x0004] The first row of the buffer is the first row of the bitmap.
 | FILEREAD_LASTROW | [0x0008] The last row of the buffer is the last row of the bitmap.
 | FILEREAD_COMPRESSED | [0x0010] The data in the buffer is 1-bit compressed data, which you can handle as explained in Speeding Up 1-Bit Documents.
nRow | The current bitmap row number of the first line in the buffer.
nLines | The number of lines in the pBuffer buffer.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

Returns SUCCESS to indicate the function was successful.

Returns any other value to terminate the calling function. The calling function will pass this value along to its caller. For a list of error values you may want to use, refer to the Return Codes.

Comments

Several LEADTOOLS functions use this type of callback function. In some cases, The pBuffer buffer contains data that your callback function must output in order for the calling function to accomplish anything. In other cases, where the callback is optional, the callback gets a copy of the data, and the callback's output is in addition to the calling function's output. Refer to the description of the calling function to see how it uses the callback.

The FILEINFO structure that gets passed to the FILEREADCALLBACK function does not contain the total number of pages. To get the total number of pages, you should call L_FileInfo and set the FILEINFO_TOTALPAGES flag.

See Also

Functions:

L_DecompressMemory, L_LoadFile, L_LoadFileOffset, L_LoadMemory, L_StartFeedLoad

Example

/* This FILEREADCALLBACK function paints the image as it loads */

/**************** Global declarations **************************************/

HPALETTE hpalPaint; /* Paint palette handle */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */

RECT rLeadDest; /* Destination rectangle for painting */

RECT rLeadSource; /* Source rectangle for painting */

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{

HWND hwnd; /* Current window */

HDC hdc; /* Device context for the current window */

L_INT nRow; /* First row in the input buffer */

} IMAGECBPARM;

/*******************************************************************************/

L_INT L_EXPORT EXT_CALLBACK LoadImageCB(pFILEINFO pFileInfo,
pBITMAPHANDLE pBitmap, L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData )
{
/* If this is the first call (row 0), select and realize the palette */
if((uFlags & FILEREAD_FIRSTPASS) && (uFlags & FILEREAD_FIRSTROW) )
{
/* Set the source rectangle to use the whole bitmap */
SetRect(&rLeadSource, 0, 0, pFileInfo->Width, pFileInfo->Height);
SendMessage (pUserData->hwnd, WM_QUERYNEWPALETTE, 0, 0L);
SelectPalette( pUserData->hdc, hpalPaint, TRUE );
RealizePalette(pUserData->hdc);
}

/* Paint the buffer to the specified device context */

L_PaintDCBuffer( pUserData->hdc, /* Device context - from function parameter */

pBitmap, /* Bitmap handle - from function parameter */

&rLeadSource, /* Source rect - set globally in WM_CREATE */

&rLeadSource, /* Source clip rect - same as source rect */

&rLeadDest, /* Destination rect - set globally in WM_CREATE */

&rLeadDest, /* Destination clip rect - same as destination rect */

SRCCOPY, /* ROP code for normal painting */

pBuffer, /* Input buffer - from function parameter */

nRow, /* First row in the buffer - from function parameter */

(uFlags & FILEREAD_COMPRESSED) ? -nLines : nLines );

return( SUCCESS );
}


FILESAVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, pBuffer, uRow, uLines, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle*/
L_UCHAR L_FAR * pBuffer; | /* pointer to a buffer for the caller's input data*/
L_UINT uRow; | /* first line to write to the buffer*/
L_UINT uLines; | /* number of lines to write to the buffer*/
L_VOID L_FAR * pUserData; | /* pointer to additional parameters*/

Provides input to the L_SaveFile or L_SaveFileOffset function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that contains the image information.
pBuffer | Pointer to the caller's input buffer where the callback function must put the data.
uRow | The number of the first line that the callback function must put in the buffer.
uLines | The number of lines that the callback function must put in the buffer.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This type callback function is optional. If you provide a callback function, it must supply the image data. It can also do other useful things, such as updating a status bar. If you do not provide a callback function, the calling function saves data from the specified bitmap.

See Also

Functions:

L_SaveFile, L_SaveFileOffset, L_StartCompressBuffer

Example

/* This FILESAVECALLBACK function supplies image data from the LEAD bitmap,
to fulfill the minimum requirements of the callback */
L_INT L_EXPORT EXT_CALLBACK SaveImageCB (pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR * pBuffer,
L_UINT nRowBegin,
L_UINT nRowsToGet,
L_VOID L_FAR * pUserData)
{
L_UINT i; /* Row counter */
L_UINT nRowLast = nRowBegin + nRowsToGet; /* Used when counting rows */
/* Put the required rows in the buffer */
for (i = nRowBegin; i < nRowLast; i++)
{
/* Get a row from the bitmap and put it in the buffer */
L_AccessBitmap (pBitmap);
L_GetBitmapRow (pBitmap, pBuffer, i, pBitmap->BytesPerLine);
L_ReleaseBitmap (pBitmap);
/* Move the pointer to the position in the buffer for the next row */
pBuffer += pBitmap->BytesPerLine;
}
return (SUCCESS);
}


HOLEPUNCHREMOVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (hRgn, pBoundingRect, iHoleIndex, iHoleTotalCount, iWhiteCount, iBlackCount, pUserData)

HRGN hRgn; | /* windows region */
PRECT pBoundingRect; | /* pointer to a RECT structure */
L_INT32 iHoleIndex; | /* index value */
L_INT32 iHoleTotalCount; | /* total number of holes */
L_INT32 iWhiteCount; | /* number of white pixels */
L_INT32 iBlackCount; | /* number of black pixels */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles each hole punch found by L_HolePunchRemoveBitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRgn | Windows region representing one of the holes of the hole punch pattern. It is the programmers responsibility to delete this region (using DeleteObject())when it is no longer needed.
pBoundingRect | Pointer to a RECT structure that contains the bounding rectangle of one of the holes in a hole punch pattern.
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 | The total number of holes that make up the hole punch pattern. This value will not change for a particular call to L_HolePunchRemoveBitmap().
iWhiteCount | Total number of white pixels in one of the holes of a hole punch pattern.
iBlackCount | Total number of black pixels in one of the holes of a hole punch pattern.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_HolePunchRemoveBitmap).
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Remove the hole.
SUCCESS_NOREMOVE | Do not remove the hole.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called once for each occurring hole in the hole punch configuration. For example, if there are three holes, the callback gets called three times. Return SUCCESS_REMOVE to have a particular hole removed. Return SUCCESS_NOREMOVE to leave the hole unchanged. Pass any other value to abort. This value will be the return value of the L_HolePunchRemoveBitmap() . If HOLEPUNCH_IMAGE_UNCHANGED and HOLEPUNCH_SINGLE_REGION are being used, then the return value of the callback affects the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_HolePunchRemoveBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_HolePunchRemoveBitmap.


INVERTEDTEXTCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hRgn, pBoundingRect, iWhiteCount, iBlackCount, pUserData)

HRGN hRgn; | /* windows region */
PRECT pBoundingRect; | /* pointer to a RECT structure */
L_INT32 iWhiteCount; | /* number of white pixels */
L_INT32 iBlackCount; | /* number of black pixels */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles each inverted text segment found by L_InvertedTextBitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRgn | Windows region representing the inverted text to be removed. It is the programmers responsibility to delete this region (using DeleteObject()) when it is no longer needed.
pBoundingRect | Pointer to a RECT structure that contains the bounding rectangle of the inverted text region being processed.
iWhiteCount | Total number of white pixels in the inverted text region being processed.
iBlackCount | Total number of black pixels in the inverted text region being processed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_InvertedTextBitmap.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Invert the text.
SUCCESS_NOREMOVE | Do not invert the text.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called once for each area of inverted text that is detected. Return SUCCESS_REMOVE to have the area modified. Return SUCCESS_NOREMOVE to leave the area unchanged. Pass any other value to abort. This value will be the return value of the L_InvertedTextBitmap() . If flags INVERTEDTEXT_IMAGE_UNCHANGED and INVERTEDTEXT _SINGLE_REGION are being used, then the return value of the callback affects only the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_InvertedTextBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_InvertedTextBitmap.


ISISCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(pBitmap, nPage, pszFileName, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT32 nPage; | /* page number */
L_CHAR L_FAR *pszFileName; | /* filename */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Callback function called after each page is acquired from the ISIS Scanner Driver. This function is available in Document/Medical toolkits only.

Parameter | Description
pBitmap | The pointer to the bitmap handle referencing the bitmap that contains the image.
nPage | Number of the page just acquired
pszFileName | Character string containing the name of the file saved
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful, continue scanning
< 1 | An error occurred. Refer to Return Codes and cancel scanning.

Comments

Refer to L_SetLoadInfoCallback for a description of how this type of callback function is used. For general information on using ISIS, refer to Using Isis to Scan Images.

Example

For an example, refer to L_ISISAcquireMulti.


LEADMARKERCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (uMarker, uMarkerSize, pMarkerData, pLEADUserData)

L_UINT uMarker; | /* ID of the JPEG marker */
L_UINT uMarkerSize; | /* size of the JPEG marker */
L_UCHAR L_FAR * pMarkerData; | /* marker data */
L_VOID L_FAR * pLEADUserData; | /* pointer to additional parameters */

Writes the updated marker data to the destination file.

Parameter | Description
uMarker | 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.)
uMarkerSize | Size of the JPEG marker to write. The size will be less than 65535. If this value is 0, then the marker does not have any extra data.
pMarkerData | Pointer to a buffer containing the marker data. This parameter is valid only if the uMarkerSize is > 0.
pLEADUserData | Void pointer that was passed to the TRANSFORMFILECALLBACKfunction.

Returns

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

Comments

This is a callback function provided by LEADTOOLS, for writing updated marker data. Any user data required by this callback function is passed to the TRANSFORMFILECALLBACKfunction and is in turn passed on to this function.

This function is called only from within the TRANSFORMFILECALLBACK function.

Please note that this callback function is different from most other LEADTOOLS callback functions. The code for this function resides entirely within LEADTOOLS. No code for this callback function is provided by the user.

See Also

Functions: | L_TransformFile, TRANSFORMFILECALLBACK
Topics: | Raster Image Functions: Processing an Image

Example

For an example, refer to TRANSFORMFILECALLBACK.


LINEREMOVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK Your Function(hRgn, iStartRow, iStartCol, iLength, pUserData)

HRGN hRgn; | /* windows region */
L_INT32 iStartRow; | /* starting row */
L_INT32 iStartCol; | /* starting column */
L_INT32 iLength; | /* line length */
L_VOID L_FAR* pUserData; | /* pointer to additional parameters */

Handles each line found by L_LineRemoveBitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRgn | Windows region representing a line to be removed. It is the programmer’s responsibility to delete this region, using DeleteObject() when it is no longer needed.
iStartRow | The starting row of the line. The rows are zero-based.
iStartCol | The starting column of the line. The columns are zero-based.
iLength | Length (in pixels) of the line.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_LineRemoveBitmap)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Remove the line.
SUCCESS_NOREMOVE | Do not remove the line.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called for each line found. Return SUCCESS_REMOVE to have the line removed. Return SUCCESS_NOREMOVE to leave the line unchanged. Pass any other value to abort. This value will be the return value of the L_LineRemoveBitmap(). If flags LINE_IMAGE_UNCHANGED and LINE_SINGLE_REGION are being used, then the return value of the callback affects the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_LineRemoveBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_LineRemoveBitmap.


LOADINFOCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(fd, pInfo, pUserData)

L_INT fd; | /* file handle of the file to load */
pLOADINFO pInfo; | /* pointer to the structure with file information */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

This function handles input data that is in a format (such as raw FAX) that LEADTOOLS cannot recognize.

Parameter | Description
fd | The Windows file handle of the file to load.
pInfo | Pointer to the LOADINFO structure that supplies information about the file that LEADTOOLS needs.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

Refer to L_SetLoadInfoCallback for a description of how this type of callback function is used.

Example

/* This LOADINFOCALLBACK function provides information for a raw fax
file. This example uses hard-coded and saved information. Your application
probably would get the information in some other way. */
/**************** Global declaration **************************************/
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image */
/*******************************************************************************/
L_INT L_EXPORT EXT_CALLBACK LoadInfoCallBack( L_INT fd, pLOADINFO pInfo, L_VOID L_FAR pUserData )
{
UNREFERENCED_PARAMETER(fd);
/ Set the LOADINFO structure’s fields /
pInfo->BitsPerPixel = 1;
pInfo->Flags = LOADINFO_TOPLEFT;
pInfo->Format = FILE_FAX_G3_2D;
pInfo->Height = LeadBitmap.Height; / Value set before we created the file /
pInfo->Offset = 0;
pInfo->Width = LeadBitmap.Width; / Value set before we created the file */
return SUCCESS;
}


MAGGLASSCALLBACK Callback Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hWnd, nMaskPlaneStart, nMaskPlaneEnd, pMaskPlane, nMaskPlaneSize, pUserData)

HWND hWnd; | /* handle to a window */
L_INT nMaskPlaneStart | /* start position of the mask array */
L_INT nMaskPlaneEnd | /* end position of the mask array */
L_UCHAR L_FAR *pMaskPlane | /* array of bit flags */
L_INT nMaskPlaneSize | /* size of the bit flags array */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Handles the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached.

Parameter

Description

hWnd

Handle of the window to which the Magnifying Glass is attached.

nMaskPlaneStart

The start position of the mask plane array.

nMaskPlaneEnd

The end position of the mask plane array.

pMaskPlane

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.

nMaskPlaneSize

The size of the bit flags array in bytes.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_StartMagGlass.)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This is an optional callback function used by the L_StartMagGlass function. It is called by L_StartMagGlass for each WM_LBUTTONDOWN, WM_MOUSEMOVE and WM_LBUTTONUP message received by the window to which the magnifying glass is attached.

In order to use this callback function, a pointer to this function must be passed to L_StartMagGlass. Once that is done, information about the non-updated parts of the bitmap can be obtained from this callback function, in the pMaskPlane parameter. This callback function 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 determine when to call L_UpdateMagGlass.

The information received by this function can be passed to the LEADTOOLS Internet functions to get pixel values of the non-updated parts of the bitmap. This information can then be passed to L_UpdateMagGlass to update the Magnifying Glass zoomed image.

If a callback function is passed to L_StartMagGlass, L_UpdateMagGlass must be called in order to paint the zoomed image in the Magnifying Glass display area.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_UpdateMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_StartMagGlass.


MAGGLASSOWNERDRAWCALLBACK Callback Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hWnd, hMemDC, nXPos, nYPos, pMagGlass, pUserData)

HWND hWnd; | /* handle to a window */
HDC hMemDC; | /* memory DC for the Magnifying Glass */
L_INT32 nXPos; | /* x coordinate of the position of the Magnifying Glass */
L_INT32 nYPos; | /* y coordinate of the position of the Magnifying Glass */
LPRECT pMagGlass; | /* bounding rectangle of the Magnifying Glass */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Provides additional, user-defined Magnifying Glass painting.

Parameter

Description

hWnd

Handle of the window to which the Magnifying Glass is attached.

hMemDC

Memory HDC into which the Magnifying Glass has been rendered. This is the HDC into which the callback should render any additional information.

nXPos

The X-coordinate of the current position (in client coordinates) of the Magnifying Glass.

nYPos

The Y-coordinate of the current position (in client coordinates) of the Magnifying Glass.

pMagGlass

The current bounding rectangle (in client coordinates) of the Magnifying Glass.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_SetMagGlassOwnerDrawCallback.)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This is an optional callback function that is set by calling the L_SetMagGlassOwnerDrawCallback function.

If a user-defined callback function matching this prototype is set by calling L_SetMagGlassOwnerDrawCallback, then after L_StartMagGlass 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 user-defined callback function. 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 discontinue using this callback function to render the Magnifying Glass, call L_SetMagGlassOwnerDrawCallback with the pfnCallback parameter set to NULL.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_UpdateMagGlass, L_SetMagGlassOwnerDrawCallback, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_SetMagGlassOwnerDrawCallback.


OPTIMIZEBUFFERCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (nPercent, pUserData)

L_INT nPercent; | /* percentage completion of optimizing a buffer.*/
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

This callback function is called repeatedly by the L_OptOptimizeBuffer function to notify the user of the percentage of the optimization operation that has been completed. The callback function is called for every 1% of optimization that is completed.

Parameter | Description
nPercent | An integer from 0 to 100 that indicates the completion percentage of the buffer optimization operation.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the L_OptOptimizeBuffer function. (This is the same pointer that you pass in the pUserData parameter of L_OptOptimizeBuffer function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

If the callback function returns a failure, the L_OptOptimizeBuffer will terminate and return the same error that the callback returned.

See Also

Functions: | L_OptOptimizeBuffer, L_OptGetDefaultOptions, L_OptOptimizeDir, OPTIMIZEIMAGEDIRCALLBACK.
Topics: | Optimizer: Callback Functions

Example

For an example, refer to L_OptOptimizeBuffer.


OPTIMIZEIMAGEDIRCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pOptImgDirInfo, pUserData)

pOPTIMIZEIMAGEDIRINFO pOptImgDirInfo; | /* pointer to optimization Info structure */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Gives the user information about the image(s) being optimized by L_OptOptimizeDir.

Parameter | Description
pOptImgDirInfo | Pointer to an OPTIMIZEIMAGEDIRINFO structure that contains information about the image(s) being optimized, such as the completion percentage for the current image being optimized, and the completion percentage for all files being optimized.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the L_OptOptimizeDir function. (This is the same pointer that you pass in the pUserData parameter of L_OptOptimizeDir function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
ERROR_OPT_SKIPIMAGE | Skip the current image and optimize the next image.
Any other value | An error occurred. Stop the whole optimization operation. Refer to Return Codes.

Comments

To skip the current image being processed and continue optimizing the next image, have this function return ERROR_OPT_SKIPIMAGE.

If the callback function returns a failure, the L_OptOptimizeDir will terminate and return the same error that the callback returned.

See Also

Functions: | L_OptOptimizeBuffer, L_OptGetDefaultOptions, L_OptOptimizeDir, OPTIMIZEBUFFERCALLBACK, OPTIMIZEIMAGEDIRINFO
Topics: | Optimizer: Callback Functions.

Example

For an example, refer to L_OptOptimizeDir.


OVERLAYCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(pOverlayCallbackData, pUserData)

pFILEOVERLAYCALLBACKDATA pOverlayCallbackData; | /* pointer to a structure */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Gets the overlay bitmap and other information from the user when loading a file containing an overlay.

Parameter | Description
pOverlayCallbackData | Pointer to a FILEOVERLAYCALLBACKDATAstructure that contains information for the callback. Some members of this structure are for input, some are for output. For more information, refer to FILEOVERLAYCALLBACKDATA.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.).

Returns

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

Comments

When loading a file containing an overlay, typically PTOCA files, LEADTOOLS will call this function to let the user provide the overlay bitmap. Typically, the overlay bitmap is in a different file on the disk. The callback can be called before or after LEADTOOLS tries to load the overlay bitmap. For more information, refer to L_SetOverlayCallback.

Required DLLs and Libraries

LTFIL

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

See Also

Functions: | L_SetOverlayCallback, L_LoadBitmap, L_GetOverlayCallback
Topics: | Raster Image Functions: Loading Files

Example

L_INT EXT_FUNCTION MyOverlayCallback(pFILEOVERLAYCALLBACKDATA pOverlayCallbackData, L_VOID* pUserData)
{
L_TCHAR szBuffer[800];
L_TCHAR szOverlayFileName[_MAX_PATH];
FILEINFO FileInfo;
L_INT nRet;

// show overlay information
wsprintf(szBuffer, TEXT("File: %s\nPageNumber: %d\nInfo: %d"),
pOverlayCallbackData->pszFilename,
pOverlayCallbackData->nPageNumber,
pOverlayCallbackData->bInfo);
MessageBox(NULL, szBuffer, TEXT("Overlay Callback"), 0);

// construct the overlay file name (assume its c:\temp\overlay_#.tmp where # is the page number)
wsprintf(szOverlayFileName, TEXT("c:\\temp\\overlay_%d.tmp"), pOverlayCallbackData->nPageNumber);

if(pOverlayCallbackData->bInfo)
{
// info, we only need to fill in the nInfoXXX members of the structure
ZeroMemory(&FileInfo, sizeof(FILEINFO));
nRet = L_FileInfo(szOverlayFileName, &FileInfo, 0, NULL);

if(nRet == SUCCESS)
{
pOverlayCallbackData->nInfoWidth = FileInfo.Width;
pOverlayCallbackData->nInfoHeight = FileInfo.Height;
pOverlayCallbackData->nInfoXResolution = FileInfo.Xresolution;
pOverlayCallbackData->nInfoYResolution = FileInfo.Yresolution;
}
}
else
{
// we need to load the overlay bitmap into the pLoadBitmap member
nRet = L_LoadBitmap(
szOverlayFileName,
pOverlayCallbackData->pLoadBitmap,
0,
ORDER_BGRORGRAY,
NULL,
NULL);
}

return nRet;
}

L_INT OverlayTest(L_VOID)
{
L_TCHAR* pszPtokaFileName = TEXT("c:\\temp\\SUPPLEMENT ON CHECK.tmp");
L_TCHAR* pszTiffFileName = TEXT("c:\\temp\\test.tif");
L_INT nRet;
OVERLAYCALLBACK pfnOldCallback;
L_VOID* pOldUserData;
L_UINT uOldFlags;
BITMAPHANDLE Bitmap;

ZeroMemory(&Bitmap, sizeof(BITMAPHANDLE));
nRet = SUCCESS;

// set the overlay callback

// first, save the old overlay callback
nRet = L_GetOverlayCallback(&pfnOldCallback, &pOldUserData, &uOldFlags);
if(nRet == SUCCESS)
{
// set the new one
nRet = L_SetOverlayCallback(MyOverlayCallback, NULL, OVERLAY_CALLLOAD);
if(nRet == SUCCESS)
{

// load the PTOKA file from memory
nRet = L_LoadBitmap(pszPtokaFileName, &Bitmap, 0, ORDER_BGRORGRAY, NULL, NULL);

// stop the overlay by resetting the old callback.
nRet = L_SetOverlayCallback(pfnOldCallback, pOldUserData, uOldFlags);
}
}

// save the bitmap as TIFF
nRet = L_SaveBitmap(pszTiffFileName, &Bitmap, FILE_TIF, 1, 0, NULL);

// free the bitmap
if(Bitmap.Flags.Allocated)
L_FreeBitmap(&Bitmap);

return nRet;
}


PANWNDCALLBACK Callback Function

#include "l_bitmap.h"

L_VOID pEXT_CALLBACK YourFunction(hPanWindow, hWndParent, uFlag, prcPan, pUserData)

HWND hPanWindow; | /* handle to the Pan Window */
HWND hWndParent; | /* handle to the associated main window */
L_UINT uFlag; | /* Pan Window notification flag */
LPRECT prcPan; | /* pointer to the Pan Rect */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Called to notify the main window of changes to the associated Pan Window.

Parameter | Description
hPanWindow | Handle to the Pan Window which has changed.
hWndParent | Handle to the associated main window.
uFlag | Flag indicating the reason for the Pan Window 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 was repainted.
prcPan | Pointer to a RECT that contains the current coordinates of the Pan Rect in 1:1 zoom factor, when uFlag = PANWIN_UPDATED. Otherwise, this will be NULL. You must convert these coordinates to match your main window’s current zoom factor.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

None

Comments

This function will be called when the Pan Window updates itself when responding to end-user input, or when the Pan Window repaints itself after being invalidated.

You can use this callback as a notification that the Pan Window has been updated by the end-user. You can also use this function to do your own custom painting in the Pan Window, for example render annotation objects to the Pan Window using the L_AnnDraw function.

You must set a PANWNDCALLBACK callback function when you create the Pan Window using the L_CreatePanWindow function in order to be notified of updates to the Pan Window.

See Also

Functions:

L_CreatePanWindow, L_UpdatePanWindow, L_DestroyPanWindow

Example

For an example, refer to L_CreatePanWindow.


PICTURIZECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pCellBitmap, x, y, pUserData)

pBITMAPHANDLE pCellBitmap; | /* pointer to the bitmap handle */
L_INT x; | /* x coordinate */
L_INT y; | /* y coordinate */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

This callback is called every time the best match is found to replace the rectangle starting at (x, y) in the original bitmap.

Parameter | Description
pCellBitmap | The pointer to the bitmap handle referencing the bitmap that will be placed in the position starting at (x, y). Do not delete or change this bitmap in any way.
X | X coordinate (column) where the new bitmap has been placed.
Y | Y coordinate (row) where the new bitmap has been placed.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This is an optional callback function for additional processing. For more information, refer to L_PicturizeBitmap.

Example

For an example, refer to L_PicturizeBitmap.


REDIRECTCLOSE Callback Function

#include "l_bitmap.h"

L_INT L_FAR L_EXPORT YourClose(FD, pUserData)

L_INT FD; | /* file handle */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for closing a file.

Parameter | Description
FD | Identifies the file to be closed. The file handle is returned by the REDIRECTOPEN callback function.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

0 | The file was closed.
-1 | The function failed.

Comments

For information about using this type of callback, refer to L_RedirectIO.

Example

To see how the following function is defined and called, refer to L_RedirectIO.

/* This procedure is a replacement to the built in Close procedure.
This may be called many times, especially by L_FileInfo, so
we need to reset the internal data structure to the defaults. */

/************************** Global Declarations **********************************/

typedef struct tagUSERDATA
{

L_INT32 dwSize; | /* Size of the buffer. */
L_INT32 dwUsed; | /* Number of bytes used. */
L_CHAR L_HUGE *pData; | /* Pointer to the buffer. */
L_CHAR L_HUGE *pCurData; | /* Current pointer location. */
} USERDATA, L_FAR * LPUSERDATA; | /* Pointer to DATA structure */

/******************************************************************************/

L_INT L_FAR L_EXPORT WindowsClose (L_INT FD)
{
UNREFERENCED_PARAMETER (FD);

UserData.pCurData = UserData.pData;
UserData.dwUsed = 0;
return (TRUE);
}


REDIRECTOPEN Callback Function

#include "l_bitmap.h"

L_INT L_FAR L_EXPORT YourOpen(pFile, nMode, nShare, pUserData)

const L_TCHAR L_FAR *pFile; | /* file name */
L_INT nMode; | /* access mode */
L_INT nShare; | /* share mode */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for opening a file.

Parameter | Description
pFile | Character string containing the name of the file to load.
nMode | Access mode. LEADTOOLS uses the following definitions for the nMode parameter:
 | Constant | Meaning
 | O_APPEND | [0x0008] Repositions the file pointer to the end of the file before every write operation.
 | O_BINARY | [0x8000] Opens file in binary mode.
 | O_CREAT | [0x0100] Creates and opens a new file for writing; this has no effect if the file exists.
 | O_EXCL | [0x0400] Returns an error if the file name exists. Only applies when used with O_CREAT.
 | O_RDONLY | [0x0000] Opens file for reading only; if this flag is given, neither O_RDWR nor O_WRONLY can be given.
 | O_RDWR | [0x0002] Open file for both reading and writing; if this flag is given, neither O_RDONLY nor O_WRONLY can be given.
 | O_TEXT | [0x4000] Open file in text mode.
 | O_TRUNC | [0x0200] Opens and truncates an existing file to zero length. The contents of the file are destroyed. If this flag is given, you cannot specify O_RDONLY.
 | O_WRONLY | [0x0001] Opens file for writing only; if this flag is given, neither O_RDONLY nor O_RDWR can be given.
 | LEADTOOLS assumes you will open the file as binary, unless the nMode value specifically indicates otherwise. If you use a function that does not open the file as binary by default (ex. _topen) then you should be sure to open the file as binary.
nShare | Share mode. The following are valid constants:
 | Value | Meaning
 | S_IREAD | [0000400] Opens the file and denies other programs read access to the file. If the file has been opened for read access by any other program, the callback should return an error.
 | S_IWRITE | [0000200] Opens the file and denies other programs write access to the file. If the file has been opened for write access by any other program, the callback should return an error.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | File handle to be used with other I/O functions.
-1 | An error occurred.

Comments

For information about using this type of callback, refer to L_RedirectIO.

Example

To see how the following function is defined and called, refer to L_RedirectIO.

/* This procedure is a replacement to the built in Open procedure.
It returns the number 5 (which looks like a file handle)
to indicate that the function was successful. */
/************************** Global Declarations **********************************/
typedef struct tagUSERDATA
{
L_INT32 dwSize; /* Size of the buffer. /
L_INT32 dwUsed; / Number of bytes used. */
L_CHAR L_HUGE pData; / Pointer to the buffer. */
L_CHAR L_HUGE pCurData; / Current pointer location. */
} USERDATA, L_FAR * LPUSERDATA;
DATA Data; /* Pointer to DATA structure */
/***************************************************************************************/
L_INT L_FAR L_EXPORT WindowsOpen (const L_TCHAR L_FAR * pFile, L_INT nMode,
L_INT nShare)
{
UNREFERENCED_PARAMETER (pFile);
UNREFERENCED_PARAMETER (nMode);
UNREFERENCED_PARAMETER (nShare);
UserData.pCurData = UserData.pData;
UserData.dwUsed = 0;
return (5);
}


REDIRECTREAD Callback Function

#include "l_bitmap.h"

L_UINT L_FAR L_EXPORT YourRead(FD, pBuf, nCount, pUserData)

L_INT FD; | /* file handle */
L_CHAR L_FAR *pBuf; | /* address of buffer for read data */
L_UINT nCount; | /* length of data buffer */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for reading a file.

Parameter | Description
FD | Identifies the file to be read. The file handle is returned by the REDIRECTOPEN callback function.
pBuf | Points to a buffer that is to receive the data read from the file.
nCount | Specifies the number of bytes to be read from the file.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | The number of bytes that the function read from the file.
-1 | The function failed.

Comments

For information about using this type of callback, refer to L_RedirectIO.

Example

To see how the following function is defined and called, refer to L_RedirectIO.

/* This procedure is a replacement to the built in read procedure.
It reads the data from the allocated memory and adjusts the internal data. */

/************************** Global Declarations **********************************/

typedef struct tagUSERDATA
{

L_INT32 dwSize; | /* Size of the buffer. */
L_INT32 dwUsed; | /* Number of bytes used. */
L_CHAR L_HUGE *pData; | /* Pointer to the buffer. */
L_CHAR L_HUGE *pCurData; | /* Current pointer location. */

} USERDATA, L_FAR * LPUSERDATA;

DATA Data;

/* Pointer to DATA structure */

/***************************************************************************************/

L_UINT L_FAR L_EXPORT WindowsRead (L_INT FD, L_CHAR L_FAR * pBuf, L_UINT uCount)
{
UNREFERENCED_PARAMETER (FD);

/* Is the request for more data than is left in memory? /
if (uCount + UserData.pCurData > UserData.pData + UserData.dwSize)
uCount = (L_UINT) (UserData.dwSize - UserData.dwUsed); / adjust request */

/* Copy data to the buffer of the caller. */
_fmemcpy (pBuf, UserData.pCurData, uCount);

/* Adjust internal data. */
UserData.pCurData += uCount;
UserData.dwUsed += uCount;
return (uCount);
}


REDIRECTSEEK Callback Function

#include "l_bitmap.h"

L_INT32 L_FAR L_EXPORT YourSeek(FD, lnPos, nOrigin, pUserData)

L_INT FD; | /* file handle */
L_INT32 lnPos; | /* number of bytes to move */
L_INT nOrigin; | /* position to move from */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for repositioning a file pointer.

Parameter | Description
FD | Identifies the file, using the file handle returned by the REDIRECTOPEN callback function.
lnPos | Specifies the number of bytes the pointer is to be moved.
nOrigin | Specifies the starting position and direction of the pointer. This parameter must be one of the following values:
 | Value | Meaning
 | 0 | Move the file pointer lnPos bytes from the beginning of the file.
 | 1 | Move the file pointer lnPos bytes from its current position.
 | 2 | Move the file pointer lnPos bytes from the end of the file.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | The number of bytes that the function wrote to the file.
-1 | The function failed.

Comments

For information about using this type of callback, refer to L_RedirectIO.

Example

To see how the following function is defined and called, refer to L_RedirectIO.

/* This procedure is a replacement to the built-in seek procedure.
This emulates the whole seek operation on a memory block, and
adjusts the internal data structures accordingly. */

/************************** Global Declarations **********************************/

typedef struct tagUSERDATA
{
L_INT32 dwSize; /* Size of the buffer. /
L_INT32 dwUsed; / Number of bytes used. */
L_CHAR L_HUGE pData; / Pointer to the buffer. */
L_CHAR L_HUGE pCurData; / Current pointer location. */
} USERDATA, L_FAR * LPUSERDATA;
DATA Data; /* Pointer to DATA structure */

/***************************************************************************************/
L_INT32 L_FAR L_EXPORT WindowsSeek (L_INT FD, L_INT32 lnPos, L_INT nOrigin, LPUSERDATA pUserData)
{
UNREFERENCED_PARAMETER (FD);

switch (nOrigin)
{
case 0: /* SEEK_SET /
pUserData->pCurData = pUserData->pData + lnPos;
pUserData->dwUsed = lnPos;
break;
case 1: / SEEK_CUR /
pUserData->pCurData += lnPos;
pUserData->dwUsed += lnPos;
break;
case 2: / SEEK_END /
if (0 <= lnPos) / Positive value, but at the end, so go to
the end. /
lnPos = 0;
else
lnPos = -(lnPos); / Seek backwards from the end of the buffer. */
pUserData->pCurData = pUserData->pData + pUserData->dwSize – lnPos;
pUserData->dwUsed = pUserData->dwSize – lnPos;
break;
}
return (pUserData->pCurData – pUserData->pData);
}


REDIRECTWRITE Callback Function

#include "l_bitmap.h"

L_INT L_FAR L_EXPORT YourWrite(FD, pBuf, nCount, pUserData)

L_INT FD; | /* file handle */
L_CHAR L_FAR *pBuf; | /* address of buffer for write data */
L_UINT nCount; | /* length of data buffer */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for writing a file.

Parameter | Description
FD | Identifies the file to be written. The file handle is returned by the REDIRECTOPEN callback function.
pBuf | Points to a buffer that contains data to be written to the file.
nCount | Specifies the number of bytes to be written to the file.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | The number of bytes that the function wrote to the file.
-1 | The function failed.

Comments

For information about using this type of callback, refer to L_RedirectIO.

When nCount is 0, the file should be truncated. That is, mark the current write position as the last position in the file. Please note that previous operating system write functions automatically truncated a file when 0 bytes were written. However, the WIN32 WriteFile function does not truncate the file.

Example

To see how the following function is defined and called, refer to L_RedirectIO.

/* This procedure is a replacement to the built in Write procedure.
In this example no I/O operation will be done, so we do nothing. */
L_UINT L_FAR L_EXPORT WindowsWrite (L_INT FD, L_CHAR L_FAR * pBuf, L_UINT uCount)
{
UNREFERENCED_PARAMETER (FD);
UNREFERENCED_PARAMETER (pBuf);
return (uCount);
}


RESIZECALLBACK Callback Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(pBitmap, pBuffer, nRow, nCol, uBytes, pUserData)

pBITMAPHANDLE pBitmap; | /* bitmap handle */
L_UCHAR L_FAR *pBuffer; | /* buffer for data */
L_INT nRow; | /* number of the row to retrieve*/
L_INT nCol; | /* column offset within the row to retrieve */
L_UINT32 uBytes; | /* number of bytes to retrieve */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Replaces the normal LEADTOOLS function for writing a file.

Parameter | Description
pBitmap | Pointer to a bitmap handle.
pBuffer | Buffer that contains image data.
nRow | The number of the row to retrieve. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to retrieve. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uBytes | The number of bytes to retrieve. Consider the bits per pixel, and avoid specifying a number that goes past the end of the row.
 | For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For 48-bit images, every six bytes represents one pixel. For 64-bit images, every eight bytes represents one pixel.
 | You can use the bitmap handle’s BitsPerPixel field with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.BitsPerPixel * NumberOfPixels) / 8;
 | if ((Bitmap.BitsPerPixel * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

>0 | The number of bytes that the function wrote to the file.
-1 | The function failed.

Comments

This is an optional callback function used by the L_StartResizeBitmap function. It is called by L_StartResizeBitmap to get the data from the bitmap. One possible use of this is to resize bitmaps that are too large to fit into memory. You can use the callback to feed to the resizing engine one line at a time.

This serves as a replacement for L_GetBitmapRowCol, which may be unable to retrieve certain images, such as extremely large images. This callback allows you to retrieve portions of an image for resizing.

Example

L_INT pEXT_CALLBACK RESIZECALLBACK (
pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_INT nRow,
L_INT nCol,
L_UINT32 uBytes,
L_VOID L_FAR *pUserData)
{

L_INT32 uBytesRead = L_GetBitmapRowCol(pBitmap, pBuffer, nRow, nCol, uBytes);
return uBytesRead == uBytes ? SUCCESS : FAILURE;
}


SAVEBUFFERCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (uRequiredSize, ppBuffer, pdwBufferSize, pUserData)

L_UINT32 uRequiredSize; | /* buffer size */
L_UCHAR ** ppBuffer; | /* address of a pointer to the buffer */
L_UINT32 L_FAR * pdwBufferSize; | /* pointer to a variable */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Provides input to the L_SaveFileBuffer or L_SaveBitmapBuffer function.

Parameter | Description
uRequiredSize | Minimum buffer size required to save the bitmap or file.
ppBuffer | Address of a pointer to the buffer to save. The callback function allows the user to reallocate the buffer. When reallocating a buffer, the buffer address can change. This parameter should be updated with the new address of the reallocated buffer.
pdwBuffersize | Pointer to a variable that contains the actual buffer size. For the bitmap or file to be saved, *pdwBufferSize must be greater than or equal to uRequiredSize.
pUserData | A void pointer that can be used to access a variable or structure containing data that the callback function needs. This provides a way to receive data indirectly from the function that uses this callback function. (This is the same pointer passed in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within the callback function.

Returns

SUCCESS | The function was successful.
FAILURE | An error occurred.

Comments

This callback function is optional, but recommended. If the callback is not used, then the user must allocate a buffer that is large enough to hold the memory file. If the buffer is not large enough and the callback is not used, the function will fail.

If the user provides a callback function, it must reallocate the buffer to be at least uRequiredSize bytes. The ppBuffer parameter must be updated with the new buffer. The pdwBufferSize parameter must be updated with the size of the new buffer.

If the callback successfully reallocates the buffer, it should return SUCCESS.

If the callback fails to successfully reallocate the buffer, it should return FAILURE.

See Also

Functions:

L_SaveFileBuffer, L_SaveBitmapBuffer

Example

L_INT L_EXPORT EXT_CALLBACK ExampleSaveBufferCB(
L_UINT32 uRequiredSize,
L_UCHAR **ppBuffer,
L_UINT32 L_FAR *pdwBufferSize,
pMYBUFFER pMyBuffer
)
{
L_UCHAR *pTempBuffer;
L_INT nRet;
L_TCHAR szMsg[400];

pTempBuffer = (L_UCHAR )realloc(pMyBuffer->pBuffer, uRequiredSize);
if (pTempBuffer)
{
wsprintf(szMsg, TEXT("** Reallocate from\n\t[0x%x, %d] to\n\t[0x%x, %d]\n"),
pMyBuffer->pBuffer,
pMyBuffer->dwBufferSize,
pTempBuffer,
uRequiredSize);

//MessageBox(NULL, szMsg, TEXT(""), MB_OK);
OutputDebugString(szMsg);

pMyBuffer->pBuffer = pTempBuffer;
pMyBuffer->dwBufferSize = uRequiredSize;

*ppBuffer = pMyBuffer->pBuffer;
*pdwBufferSize = uRequiredSize;
nRet = SUCCESS;
}
else
{
nRet = FAILURE;
}
return nRet;
}


SMOOTHCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK Your Function(uBumpOrNick, iStartRow, iStartCol, iLength, uHorV, pUserData)

L_UINT32 uBumpOrNick; | /* flag */
L_INT iStartRow; | /* starting row */
L_INT iStartCol; | /* starting column */
L_INT iLength; | /* length */
L_UINT32 uHorV; | /* flag */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles each bump or nick found by L_SmoothBitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
uBumpOrNick | 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.
iStartRow | The starting row of the bump or nick. The rows are zero-based.
iStartCol | The starting column of the bump or nick. The columns are zero-based.
iLength | Length (in pixels) of the bump or nick.
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
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_SmoothBitmap).
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE | Remove the bump or nick.
SUCCESS_NOREMOVE | Do not remove the bump or nick.
Otherwise | An error occurred. Refer to Return Codes.

Comments

The callback is called for each bump and nick found. Return SUCCESS_REMOVE to have the bump or nick removed. Return SUCCESS_NOREMOVE to leave the bump or nick unchanged. Pass any other value to abort. This value will be the return value of the L_SmoothBitmap(). If flags SMOOTH_IMAGE_UNCHANGED and SMOOTH_SINGLE_REGION are being used, then the return value of the callback affects only the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMG

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

See Also

Functions: | L_SmoothBitmap
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to L_SmoothBitmap.


STATUSCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(nPercentComplete, pUserData)

L_INT nPercentComplete; | /* completion percentage */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Lets you update a status bar or interrupt the calling function’s operation.

Parameter | Description
nPercentComplete | An integer from 0 to 100 that indicates the completion percentage of the function that uses the callback.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

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

Comments

This generalized callback function can be called by many different functions. If the callback function returns a failure, the calling function will terminate and return the same error that the callback returned. For a description of how the callback is used, refer to L_SetStatusCallBack.

Example

For an example, refer to L_SetStatusCallBack.


TRANSFORMFILECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (uMarker, uMarkerSize, pMarkerData, pUserData, uTransform, pfnLEADCallback, pLEADUserData)

L_UINT uMarker; | /* ID of the JPEG marker */
L_UINT uMarkerSize; | /* size of the JPEG marker */
L_UCHAR L_FAR * pMarkerData; | /* marker data */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */
LEADMARKERCALLBACK pfnLEADCallback; | /* pointer to a LEAD callback function */
L_VOID L_FAR * pLEADUserData; | /* pointer to additional parameters for pfnLEADCallback */

Handles the processing of every JPEG marker present in the file transformed by L_TransformFile.

Parameter | Description
uMarker | 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.)
uMarkerSize | 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.
pMarkerData | Pointer to a buffer containing the marker data. This parameter is valid only if the uMarkerSize is > 0.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.
uTransform | Binary flags that indicate the transform to be performed. These are the same flags passed to the L_TransformFile function. 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.
pfnLEADCallback | Pointer to a callback function, provided by LEADTOOLS, for writing transformed markers.
 | The callback function adheres to the function prototype described in LEADMARKERCALLBACK Function.
pLEADUserData | Void pointer that you can use to pass one or more additional parameters that the LEADMARKERCALLBACK function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pLEADUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful. The default processing for this marker can be performed.
SUCCESS_IGNOREMARKER | The function was successful. Do not process this marker and do not write it to the file.
< 1 | An error occurred. Refer to Return Codes.

Comments

This callback function is called by the L_TransformFile function.

This callback can also be used to enumerate the markers in a JPEG file. The last marker enumerated by this function is always the SOS (0xDA) marker.

If the marker data is transformed, make sure the size of the marker data is less than 0xFFFE.

Note that uMarkerSize is the size of the data contained in the pMarkerData buffer. It does not include the size of the marker size (like the size stored in the file). If you are not familiar with JPEG markers and the previous didn’t make sense to you, then you can safely ignore this paragraph.

If the marker data is transformed, it should be written by calling the pfnLEADCallback function. Then, SUCCESS_IGNOREMARKER should be returned by the TRANSFORMFILECALLBACK function. If SUCCESS is returned by the TRANSFORMFILECALLBACK function instead of SUCCESS_IGNOREMARKER, LEADTOOLS will perform the default transformation and will also write this marker information to the file. Therefore, there will be two copies of the marker in the file.

As an example, if a user-defined marker that contains a stamp of the image is stored in a file and that file is transformed, the stamp should be transformed in the same way and resaved.

If this function returns an error code, the transformation is aborted and L_TransformFile will return the error code returned by this callback function.

See Also

Functions: | L_TransformFile, LEADMARKERCALLBACK
Topics: | Raster Image Functions: Processing an Image

Example

#define APP0 0xE0

L_INT EXT_CALLBACK MyRotateMarker
(
L_UINT uMarker,
L_UINT uMarkerSize,
L_UCHAR L_FAR*pMarkerData,
L_VOID L_FAR*pUserData,
LEADMARKERCALLBACK pfnLEADCallback,
L_VOID L_FAR*pLEADUserData
)
{
L_INT nRet;

/* I will transform only the APP0 marker */
if(uMarker != APP0)
return SUCCESS;

/* Transform the marker data. Do your transformation here… */

/* write the transformed data */
nRet = pfnLEADCallback(uMarker, uMarkerSize, pMarkerData, pLEADUserData);
if(nRet != SUCCESS)
return nRet;

/* since I wrote the marker, tell LEADTOOLS not to transform it */
return SUCCESS_IGNOREMARKER;
}

/* This example rotates the file by 90 degrees */
L_TransformFile (TEXT("IMAGE1.JPG"), NULL, FILE_TRANSFORM_ROTATE90, MyRotateMarker, NULL);


Implementing an Automated Annotation Program

Take the following steps to create and run a program that implements automated annotations. Remember, the purpose of the annotation tutorials is to provide you a quick and easy way to generate an annotation program. For more in depth annotation programming, refer to the Annotate demo.

1. | Create a new directory in the LTWINxxx\EXAMPLES\DLL directory called EZAUTO.
2. | Copy everything in the EZFUNC directory into the EZAUTO directory.
3. | Compile the project as is and run EZFUNC32.exe to familiarize yourself with the basic program. You can run the exe file from the MS-DOS prompt, or set the image file to load through the Build -> Settings ->Debug->Program Arguments menu.
4. | On the Insert menu, select Files into Project. Add the Ltann_n.lib file to the project from the LTWINxxx\LIB directory.
5. | Define the following global variables in EZFUNC.C in the EZAUTO directory:

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
RECT rClientSize; /* RECT for the client area. */
HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT hAutoObject; /* Automation object */
HWND ToolbarWnd; /* Window for the annotation toolbar */
POINT ToolbarPt; /* Point that positions the toolbar */

6.

In the MainWndProc in EZFUNC.C add the following declaration:

ANNRECT ContainerRect; /* Defining rectangle for the container */

7.

Under WM_CREATE in EZFUNC.C, add the following code before “return (TRUE);” :

GetClientRect(hWnd, &rClientSize);

/* Specify the point that positions the toolbar */
ToolbarPt.x = 0;
ToolbarPt.y = 0;
/* Create the toolbar and position its top left corner at 0,0 */
L_AnnCreateToolBar(hWnd, &ToolbarPt,
ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP, TRUE, &ToolbarWnd, 0, NULL);
/* Create the annotation container, which we will use as the root container */
ContainerRect.left = 0;
ContainerRect.top = 0;
ContainerRect.right = BITMAPWIDTH(&LeadBitmap) -1;
ContainerRect.bottom = BITMAPHEIGHT(&LeadBitmap) - 1;
L_AnnCreateContainer(hWnd, &ContainerRect, TRUE, &hContainer);

/* Set the annotation scalars and offsets, assuming that the display
dimensions are the same as the client area dimensions */
L_AnnSetScalarX(hContainer, (L_DOUBLE) rClientSize.right / BITMAPWIDTH(&LeadBitmap), 0);
L_AnnSetScalarY(hContainer, (L_DOUBLE) rClientSize.bottom / BITMAPHEIGHT(&LeadBitmap), 0);
L_AnnSetOffsetX(hContainer, (L_DOUBLE) 0, 0);
L_AnnSetOffsetY(hContainer, (L_DOUBLE) 0, 0);
/* Create the automation object */
L_AnnCreate(ANNOBJECT_AUTOMATION, &hAutoObject);

/* Assign the automation object to the container */
L_AnnSetAutoContainer(hAutoObject, hContainer);
/* Enable the automation object */
L_AnnSetActiveState(hAutoObject, ANNACTIVE_ENABLED);
/* Set design mode, which allows creation of annotations */
L_AnnSetUserMode(hContainer, ANNUSER_DESIGN);
/* Set the dots per inch for interpreting physical measurements */
L_AnnSetDpiX(hAutoObject, 600, 0);
L_AnnSetDpiY(hAutoObject, 600, 0);

/* Set the number of possible undo actions */
L_AnnSetUndoDepth(hAutoObject, 3);
/* Set the line tool as the initial annotation tool */
L_AnnSetTool(hAutoObject, ANNTOOL_LINE);
L_AnnSetToolBarChecked(ToolbarWnd, ANNTOOL_LINE);

8.

Code the WM_PAINT option as follows:

/* Get the handle to the device context */
hdc = BeginPaint (hWnd, &ps);
if (LeadBitmap.Flags.Allocated) /* Do we have an image? */
{
if (hpalPaint) /* If we have a paint palette, select it */
{
hPalette = SelectPalette (hdc, hpalPaint, FALSE);
/* Uncomment this if you do not process WM_QUERYNEWPALETTE */
/* RealizePalette (hdc); */
}

/* Paint the image */
L_PaintDC (hdc,
&LeadBitmap,
&rLeadSource, /* Source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
&ps.rcPaint, /* Dest clip set by WM_PAINT */
SRCCOPY); /* Normal Paint */
if (hpalPaint) /* Return old palette */
SelectPalette (hdc, hPalette, FALSE);

L_AnnDraw(hdc, &ps.rcPaint, hContainer);
}
EndPaint (hWnd, &ps); /* Return DC */
return (0);

9.

Add the following case to the switch statement in the MainWndProc procedure:

case WM_LTANNEVENT:
/* Match the toolbar selection */
if ((int) wParam == LTANNEVENT_TOOLCHECKED)
{
L_AnnSetTool(hAutoObject, (L_UINT) lParam);
}
return(0);

10.

Add the following line to WM_DESTROY, immediately before “/* Post WM_QUIT to end the application */” :

L_AnnDestroy(hContainer, ANNFLAG_RECURSE);

11. | On the Build menu, select Build Ezfunc32.exe.
12. | On the Build menu, select Execute Ezfunc32.exe.
13. | Save this project to use for testing other annotation code samples and for implementing the Using Automated Annotations in Run Mode tutorial.


Using Automated Annotations in Run Mode

Take the following steps to add code, to the existing project, that will let you display annotations in run mode and activate a button annotation.

1. | Start with the program you created in Implementing an Automated Annotation Program.
2. | Add a menu resource to the project. If you are familiar with this process, you can skip to the next step.
 | a. | From the Insert menu, select Resource. Highlight Menu and click on OK.
 | b. | The IDR_MENU will appear. Right click on IDR_MENU, select Properties and change the name to MAIN_MENU1.
 | c. | Right click on the menu entry (the outlined rectangle), and select Properties.
 | d. | In the Caption box enter User Mode. Make sure Pop-up is selected and press Enter.
 | e. | Another rectangle appears under the User Mode button on the menu. Right click on that box and select Properties.
 | f. | Set the ID to IDM_DESIGN and the Caption to Design Mode. Make sure Checked has been selected. Press Enter.
 | g. | Another rectangle appears under the Design Mode button on the menu. Right click on that box and select Properties.
 | h. | Set the ID to IDM_RUN and the Caption to Run Mode. Press Enter. Save the resource.
 | i. | Within the resource.h file in the EZAUTO directory, check the values listed for IDM_DESIGN and IDM_RUN. You can either change these values or leave them as they are, but you must define IDM_DESIGN and IDM_RUN in EZFUNC.H using the same values.
3. | In InitApplication, change the line:

wcWindowClass.lpszMenuName = NULL; to

wcWindowClass.lpszMenuName = "MAIN_MENU1";

4.

In InitInstance, change the menu parameter in CreateWindow from NULL to

LoadMenu(hInstance, MAKEINTRESOURCE(MAIN_MENU1)).

5.

In the MainWndProc procedure, add the following code to the switch statement:

case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_RUN:
L_AnnSetUserMode(hContainer, ANNUSER_RUN);
CheckMenuItem(GetMenu(hWnd), IDM_DESIGN, MF_UNCHECKED);
CheckMenuItem(GetMenu(hWnd), IDM_RUN, MF_CHECKED);
break;
case IDM_DESIGN:
L_AnnSetUserMode(hContainer, ANNUSER_DESIGN);
CheckMenuItem(GetMenu(hWnd), IDM_RUN, MF_UNCHECKED);
CheckMenuItem(GetMenu(hWnd), IDM_DESIGN, MF_CHECKED);
break;
}
return 0;

6.

Add the following code to WM_LTANNEVENT, before return 0;

if ((int)wParam == LTANNEVENT_AUTOCLICKED)

{

L_AnnGetType((HANNOBJECT)lParam, &uType);

if (uType == ANNOBJECT_BUTTON)

{

#ifdef UNICODE

_wsystem(TEXT("Calc"));

#else

system("Calc");

#endif

}

}

7.

Add the following declaration to MainWndProc:

L_UINT uType;

8. | Build Ezfunc32.exe.
9. | Run Ezfunc32.exe. Create an audio annotation. Right click on the annotation and set the file to any .wav file available on your system. Create a button annotation. Right click on the annotation and change any of the button properties you wish. On the User Mode menu, select Run Mode. As you move the cursor over the audio annotation and the button annotation, the cursor changes to a hand. Click on the audio annotation to hear the .wav file. Click on the button annotation to call the program listed under WM_LTANNEVENT.


Implementing a Non-automated Annotations Program

Take the following steps to create and run a program that implements non-automated annotations.

1. | Create a new directory in the LTWINxxx\EXAMPLES\DLL directory called EZNON.
2. | Copy everything in the EZFUNC directory into the EZNON directory.
3. | Compile the project as is and run EZFUNC32.exe to familiarize yourself with the program. You can run the exe file from the MS-DOS prompt, or set the image file to load through the Build -> Settings ->Debug->Program Arguments menu.
4. | On the Insert menu, select Files into Project. Add the Ltann_n.lib file to the project from the LTWINxxx\LIB directory.
5. | Declare the following global variables:

HANNOBJECT hContainer;
HANNOBJECT MyNote;

and the following functions:

void TestCreateAnn(HWND hWnd);
void TestCreateNoteAnn(HWND hWnd);

6.

Add the following code:

void TestCreateAnn(HWND hWnd)
{
RECT rClientArea; /* Client area of the current window */
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Defining rectangle for the container */
RECT rAnnBounds; /* Bounding rectangle for displaying */

/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd, &rClientArea);
/* Create the annotation container, which we will use as the root container */
ContainerRect.left = 0;
ContainerRect.top = 0;
ContainerRect.right = BITMAPWIDTH(&LeadBitmap) -1;
ContainerRect.bottom = BITMAPHEIGHT(&LeadBitmap) - 1;
L_AnnCreateContainer(hWnd, &ContainerRect, TRUE, &hContainer);

/* Set the annotation scalars and offsets, assuming that the display
dimensions are the same as the client area dimensions */
L_AnnSetScalarX(hContainer, (L_DOUBLE) rClientArea.right / BITMAPWIDTH(&LeadBitmap), 0);
L_AnnSetScalarY(hContainer, (L_DOUBLE) rClientArea.bottom / BITMAPHEIGHT(&LeadBitmap), 0);
L_AnnSetOffsetX(hContainer, (L_DOUBLE) 0, 0);
L_AnnSetOffsetY(hContainer, (L_DOUBLE) 0, 0);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, NULL);
L_AnnDraw(hWindowDC, &rAnnBounds, hContainer);
ReleaseDC(hWnd, hWindowDC);
return;
}

7.

Add the following code:

void TestCreateNoteAnn(HWND hWnd)
{

ANNRECT ContainerRect;
ANNRECT MyNoteRect;
RECT rAnnBounds;
HDC hWindowDC;

hWindowDC = GetDC(hWnd);

/* Create a Note Annotation */
L_AnnCreateItem(hContainer, ANNOBJECT_NOTE, TRUE, &MyNote);

L_AnnGetRect(hContainer, &ContainerRect, NULL);

/* Size and position the note */
MyNoteRect.left = ContainerRect.right / 8;
MyNoteRect.top = ContainerRect.bottom / 8;
MyNoteRect.right = ContainerRect.right / 2;
MyNoteRect.bottom = ContainerRect.bottom / 2;
L_AnnSetRect(MyNote, &MyNoteRect);
/* Set the text of the note */
L_AnnSetText(MyNote, TEXT("This is my text"), 0);
L_AnnSetBackColor(MyNote, RGB(0, 255, 255), 0);
L_AnnSetFontBold(MyNote, TRUE, 0);
L_AnnSetFontItalic(MyNote, FALSE, 0);
L_AnnSetFontName(MyNote, TEXT("Arial"), 0);
L_AnnSetFontSize(MyNote,16, 0);
L_AnnSetFontStrikeThrough(MyNote, FALSE, 0);
L_AnnSetFontUnderline(MyNote, TRUE, 0);
L_AnnSetForeColor(MyNote, RGB(255, 0, 0), 0);
/* Display the note */
L_AnnGetBoundingRect(MyNote, &rAnnBounds, NULL);
L_AnnDraw(hWindowDC, &rAnnBounds, MyNote);

/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
ReleaseDC(hWnd, hWindowDC);
return;
}

8.

Add the following lines of code to WM_CREATE, just before return (TRUE); :

TestCreateAnn(hWnd);
TestCreateNoteAnn(hWnd);

9.

Add the following line to WM_PAINT, immediately after

if(hpalPaint)
SelectPalette(hdc, hPalette, FALSE); :

L_AnnDraw(hdc, &ps.rcPaint, hContainer);

10.

Add the following line to WM_DESTROY, immediately before “/* Post WM_QUIT to end the application */” :

L_AnnDestroy(hContainer, ANNFLAG_RECURSE);

11. | On the Build menu, select Build Ezfunc32.exe.
12. | On the Build menu, select Execute Ezfunc32.exe. Keep this project for testing other annotation code samples and for implementing Using Non-automated Annotations in Run Mode.


Using Non-automated Annotations in Run Mode

Using Non automated Annotations in Run Mode:

Take the following steps to add code to the existing project that will let you create an audio annotation and a button annotation, set the user mode through a menu, and activate the annotations by left clicking on the annotation.

1. | Start with the program you created in Implementing a Non-automated Annotation Program.
2. | Add a menu resource to the project. If you are familiar with this process, you can skip to the next step.
 | a. | From the Insert menu, select Resource. Highlight Menu and click on OK.
 | b. | The IDR_MENU will appear. Right click on IDR_MENU, select Properties and change the name to MAIN_MENU1.
 | c. | Right click on the menu entry (the outlined rectangle), and select Properties.
 | d. | In the Caption box enter User Mode. Make sure Pop-up is selected and press Enter.
 | e. | Another rectangle appears under the User Mode button on the menu. Right click on that box and select Properties.
 | f. | Set the ID to IDM_DESIGN and the Caption to Design Mode. Make sure Checked has been selected. Press Enter.
 | g. | Another rectangle appears under the Design Mode button on the menu. Right click on that box and select Properties.
 | h. | Set the ID to IDM_RUN and the Caption to Run Mode. Press Enter. Save the resource.
 | i. | Within the resource.h file in the EZNON directory, check the values listed for IDM_DESIGN and IDM_RUN. You can either change these values or leave them as they are, but you must define IDM_DESIGN and IDM_RUN in EZFUNC.H using the same values.
3. | In InitApplication, change the line:

wcWindowClass.lpszMenuName = NULL; to

wcWindowClass.lpszMenuName = "MAIN_MENU1";

4.

In InitInstance, change the menu parameter in CreateWindow from NULL to:

LoadMenu(hInstance, MAKEINTRESOURCE(MAIN_MENU1)).

5.

In the MainWndProc procedure, add the following code to the switch statement:

case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_RUN: /* set the user mode to run mode */
L_AnnSetUserMode(hContainer, ANNUSER_RUN);
CheckMenuItem(GetMenu(hWnd), IDM_DESIGN, MF_UNCHECKED);
CheckMenuItem(GetMenu(hWnd), IDM_RUN, MF_CHECKED);
nAnnUserMode = ANNUSER_RUN;
break;
case IDM_DESIGN: /* set the user mode to design mode */
L_AnnSetUserMode(hContainer, ANNUSER_DESIGN);
CheckMenuItem(GetMenu(hWnd), IDM_RUN, MF_UNCHECKED);
CheckMenuItem(GetMenu(hWnd), IDM_DESIGN, MF_CHECKED);
nAnnUserMode = ANNUSER_DESIGN;
break;
}
return 0;

6.

Declare the following global variables:

HANNOBJECT MyAudio; /* audio annotation object */
HANNOBJECT MyButton; /* button annotation object */
L_INT nAnnUserMode = ANNUSER_DESIGN;

and the following functions:

void TestCreateAudioAnn(HWND hWnd);
void TestCreateButtonAnn(HWND hWnd);
void TestAnnHit(int xFromWindow, int yFromWindow, pHANNOBJECT phAnnObject);

7.

Add the following declarations to MainWndProc:

int xPos, yPos;
HANNOBJECT hCurrentObject;
L_UINT uCurrentObjectType;

8.

Add the following code:

void TestCreateAudioAnn(HWND hWnd)
{
/* This code creates the audio annotation and associates a .wav file with the annotation. */
HDC hdc;
ANNRECT ContainerRect;
ANNRECT MyAudioRect;
RECT rAnnBounds;

hdc = GetDC(hWnd);

/* Create the audio annotation object */
L_AnnCreate(ANNOBJECT_AUDIO, &MyAudio);
/* Insert the audio annotation in the container created in TestCreateAnn. */
L_AnnInsert(hContainer, MyAudio, FALSE);
/* Make the annotation visible. */
L_AnnSetVisible(MyAudio, TRUE, 0);

/* Get the dimensions of the container’s rectangle. */
L_AnnGetRect(hContainer, &ContainerRect);

/* Set the placement of the audio annotation. */
MyAudioRect.left = ContainerRect.right * 5/8;
MyAudioRect.top = ContainerRect.bottom * 5/8;
MyAudioRect.right = ContainerRect.right * 3/4;
MyAudioRect.bottom = ContainerRect.bottom * 3/4;
L_AnnSetRect(MyAudio, &MyAudioRect);

/* Set the name of the .wav file to associate with this annotation. This .wav file will play when you click on the annotation in run mode. Change the path and filename to suit your system */
L_AnnSetText(MyAudio, TEXT("tada.wav"), 0);
/* Display the annotation. */
L_AnnGetBoundingRect(MyAudio, &rAnnBounds);
L_AnnDraw(hdc, &rAnnBounds, MyAudio);

/* Remove the queued paint message. */
ValidateRect(hWnd, &rAnnBounds);
return;
}

9.

Add the following code:

void TestCreateButtonAnn(HWND hWnd)
{
/* This function creates a button annotation. */
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT MyButtonRect; /* Rectangle for the button object */
RECT rAnnBounds; /* Bounding rectangle used to draw the object */

/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the container's rectangle */
L_AnnGetRect(hContainer, &ContainerRect);
/* Create the button annotation */
L_AnnCreateItem(hContainer, ANNOBJECT_BUTTON, TRUE, &MyButton);
/* Size and position the button */
MyButtonRect.left = ContainerRect.right / 8;
MyButtonRect.top = ContainerRect.bottom / 2;
MyButtonRect.right = ContainerRect.right / 2;
MyButtonRect.bottom = ContainerRect.bottom * 5/8 ;
L_AnnSetRect(MyButton, &MyButtonRect);

/* Set the text of the button */
L_AnnSetText(MyButton, TEXT(“This is a No. 3 button"), 0);
/* Enable the button */
L_AnnSetActiveState(MyButton, ANNACTIVE_ENABLED);
/* Set the tag to 3. You can base actions on the tag number */
L_AnnSetTag(MyButton, 3, 0);
/* Display the button */
L_AnnGetBoundingRect(MyButton, &rAnnBounds);
L_AnnDraw(hWindowDC, &rAnnBounds, MyButton);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return;
}

10.

Add the following code:

void TestAnnHit(int xFromWindow, int yFromWindow, pHANNOBJECT phAnnObject)
{
/* This function determines which annotation object you have clicked. */

HANNOBJECT ThisObject; /* Local variable for the annotation object */
POINT PointToTest; /* The point in the window's client area to test */
L_UINT TestResult; /* Result of the test */
/* Use incoming coordinates to specify the point to test */
PointToTest.x = xFromWindow;
PointToTest.y = yFromWindow;

/* Get the object at the specified point */
L_AnnHitTest(hContainer, &PointToTest, &TestResult, &ThisObject);
/* Update the caller's object variable */
if (TestResult == ANNHIT_NONE)
*phAnnObject = 0;
else
*phAnnObject = ThisObject;
return;
}

11.

Code the WM_LBUTTONDOWN message as follows:

case WM_LBUTTONDOWN:
if (nAnnUserMode == ANNUSER_RUN)
{
xPos = LOWORD(lParam);
yPos = HIWORD(lParam);
TestAnnHit(xPos, yPos, &hCurrentObject);
L_AnnGetType (hCurrentObject, &uCurrentObjectType);

switch (uCurrentObjectType)
{
case ANNOBJECT_AUDIO:
SendMessage(hWnd, WM_LTANNEVENT, LTANNEVENT_ACTIVATE, ANNTOOL_AUDIO);
break;
case ANNOBJECT_BUTTON:
SendMessage(hWnd, WM_LTANNEVENT, LTANNEVENT_ACTIVATE, ANNTOOL_BUTTON);
break;
}
}
return 0;

12.

Code the WM_LTANNEVENT message as follows:

case WM_LTANNEVENT:

switch((int)wParam)

{

case LTANNEVENT_ACTIVATE:

if ((int)lParam == ANNTOOL_AUDIO)

L_AnnSetActiveState(MyAudio, ANNACTIVE_ENABLED);

if ((int)lParam == ANNTOOL_BUTTON)

{

#ifdef UNICODE

_wsystem(TEXT("c:\\Windows\\calc"));

#else

system("c:\\Windows\\calc");

#endif

}

break;

}

return 0;

13.

Comment out the TestCreateNoteAnn(hWnd) line in WM_CREATE and add the following lines:

TestCreateAudioAnn(hWnd);
TestCreateButtonAnn(hWnd);

14. | Build Ezfunc32.exe.
15. | Run Ezfunc32.exe. Click on the audio and button annotations. Since the User Mode is Design Mode, nothing happens. Under the User Mode menu, select Run Mode then click on each annotation. Save this project for testing Annotation code samples.


Updating Old Code to Use the New Palette Mechanism

The BITMAPHANDLE structure has changed and new functions have been added to allow the user to limit the number of GDI resources LEAD bitmaps require. This change could cause existing source code to no longer compile. However, this change WILL NOT affect existing applications/binaries. The purpose of this change is to allow users to load many images, without each using up GDI resources by creating an HPALETTE. The former (and default) behavior is that for each image that is loaded from file, an HPALETTE GDI object is created. With these new functions/features, you can avoid this. The BITMAPHANDLE structure has changed. The hPalette member has been changed to Palette.hPalette. If your code was accessing the hPalette member directly, you will need to modify your code when you re-compile.

The following are scenarios where you could have accessed hPalette directly, and examples of how you should change your code:

If you were doing a simple test of hPalette:

if(pBitmap->hPalette)

then you should change your code to:

if(pBitmap->Palette.hPalette)

If you were copying a palette from one bitmap to another:

BitmapDst.hPalette = BitmapSrc.hPalette;

then you should use L_CopyBitmapPalette():

L_CopyBitmapPalette(&BitmapDst, &BitmapSrc);

If you were duplicating the hPalette or copying a reference to the hPalette:

hPalette = pBitmap->hPalette;

then you should use L_DupBitmapPalette, and delete the hPalette when you no longer need it.:

hPalette = L_DupBitmapPalette;
// use the palette
DeleteObject(hPalette);"

If you were assigning the bitmap’s hPalette:

BitmapDst.hPalette = hPalette;

then you should use L_SetBitmapPalette:

L_SetBitmapPalette(&Bitmap, hPalette);
DeleteObject(hPalette);


Print a Real Image Size in Inches

1.

Define the following global variables:

BITMAPHANDLE LeadBitmap; // LEAD bitmap
HDC hdcPrinter = NULL; // Printer device context
L_FLOAT fRealWidth; // Image real width in inches
L_FLOAT fRealHeight; // Image real height in inches
L_FLOAT fPrnDPIX; // Number of pixels per logical inch along the screen width
L_FLOAT fPrnDPIY; // Number of pixels per logical inch along the screen height

2.

Load the image in a LEAD bitmap:

L_LoadBitmap (TEXT("C:\\IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

3.

Calculate the real width and height of the bitmap in inches:

fRealWidth = (L_FLOAT)LeadBitmap.Width / (L_FLOAT)LeadBitmap.XResolution;
fRealHeight = (L_FLOAT)LeadBitmap.Height / (L_FLOAT)LeadBitmap.YResolution;

4.

Get the printer device context:

hdcPrinter = L_PrintBitmap(NULL, NULL, 0, 0, 0, 0, FALSE);

5.

Get the width and height DPI:

fPrnDPIX = (L_FLOAT)GetDeviceCaps(hdcPrinter, LOGPIXELSX);
fPrnDPIY = (L_FLOAT)GetDeviceCaps(hdcPrinter, LOGPIXELSY);

6.

Now you are ready to print the image at its real size in inches:

L_PrintBitmap(hdcPrinter, &LeadBitmap, 1, 1, (L_INT)(fRealWidth * fPrnDPIX), (L_INT)(fRealHeight * fPrnDPIX), TRUE);


Combining Images with Regions

1.

Define the following global variables:

HWND hWndClient; /* Handle of the current child window */
RGNXFORM XForm; /* Structure for transforming display coordinates */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the region */
BITMAPHANDLE BitmapDst; /* Destination bitmap */
BITMAPHANDLE BitmapSrc; /* Source bitmap */
L_INT XDst; /* Column offset of the destination */
L_INT YDst; /* Row offset of the destination */
L_INT XSize;/* Pixel width of the rectangle to combine */
L_INT YSize;/* Pixel height of the rectangle to combine */
L_INT XSrc; /* Column offset of the source */
L_INT YSrc; /* Column offset of the source */

2.

Load two images as follows:

L_LoadBitmap(TEXT("c:\\sample1.cmp"), &BitmapDst, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("C:\\sample2.cmp"), &BitmapSrc, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

3.

Get the client area of the current child window as follows:

GetClientRect(hWndClient, &rClientArea);

4.

Set RGNXFORM fields, assuming that the display rectangle is the same as the client area of the current child window as follows:

XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = BITMAPWIDTH(&BitmapDst);
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BITMAPHEIGHT(&BitmapDst);
XForm.nYScalarDen = rClientArea.bottom;
XForm.nXOffset = 0;
XForm.nYOffset = 0;

5.

Specify a rectangle to define the region and then create a rectangular region as follows:

SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8, rClientArea.right/2, rClientArea.bottom/2);
L_SetBitmapRgnRect(&BitmapDst, &XForm, &rRgnRect, L_RGN_SET);

6.

Specify a position in the top left part of the displayed image and use the full size of the source bitmap as follows:

XDst = BITMAPWIDTH(&BitmapDst) / 8;
YDst = BITMAPHEIGHT(&BitmapDst) / 8;
YSize = BITMAPHEIGHT(&BitmapSrc);
XSize = BITMAPWIDTH(&BitmapSrc);
XSrc = 0;
YSrc = 0;

7.

Combine BitmapDst with &BitmapSrc, using flags for an ordinary paste:

L_CombineBitmap(&BitmapDst, XDst, YDst, XSize, YSize, &BitmapSrc, XSrc, YSrc, CB_OP_ADD | CB_DST_0);

8.

At the end you should free the rectangle:

L_FreeBitmapRgn(&BitmapDst);


L_2bFixed2bNumberToDouble

#include "ltkrn.h"
#include "ltclr.h"

L_DOUBLE EXT_FUNCTION L_2bFixed2bNumberToDouble(uNumber)

L_UINT32 uNumber;

/* integer value */

Converts a 2-bytes fixed, 2-bytes fraction number format into a double fractional value.

Parameter | Description
uNumber | Value that represents the 2-bytes fixed, 2-bytes fraction number value to convert.

Returns

A double value that contains a fraction number representing the value passed to the function.

Comments

This function is used for ICC profiles purposes. The number passed must be one of the following types: L_IccS15Fixed16Number or L_IccU16Fixed16Number.

Each of these types is 4-bytes, divided into 2-bytes that contain the fixed part of the number, and 2-bytes that contain the fractional part of the number.

The (2b) found in the function name means (2-bytes).

Required DLLs and Libraries

LTCLR

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

For an example, refer to L_DoubleTo2bFixed2bNumber.


L_2DGetViewMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_2DGetViewMode(L_VOID)

Gets the current view port mode used when loading 3D file formats.

Returns

The current view mode. Possible values are:

Value | Meaning
L2D_USE_BEST | Fit the drawing into 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.

Comments

To set the view mode, use L_2DSetViewMode.

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

L_2DGetViewMode

L_2DSetViewMode

L_2DGetViewport

L_2DSetViewport

This function may be used with the following Vector file formats: DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector. For more information on these file formats and their availability, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution
 | For Vector files: L_2DSetViewMode, L_2DGetViewport, L_2DSetViewport
Topics: | Raster Image Functions: Rasterizing Files
 | Unlocking Vector File Format Support

Example

/* This example get current viewport mode and size and show them in a message box */

void CheckViewportSettings( void )
{
L_TCHAR szBuffer[ 80 ]; /* buffer to hold the message */
L_INT nViewportMode; /* current viewport mode */
L_INT nViewportWidth; /* current viewport width */
L_INT nViewportHeight; /* current viewport height */

/* Get viewport mode, width and height */
nViewportMode = L_2DGetViewMode();
L_2DGetViewport ( &nViewportWidth, &nViewportHeight );

/* format into a message box */
wsprintf( szBuffer,
TEXT("Viewport mode = %d\nWidth = %d\nHeight = %d"),
nViewportMode, nViewportWidth, nViewportHeight );
MessageBox( NULL, szBuffer, TEXT("Viewport Settings"), 0 );
}


L_2DGetViewport

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_2DGetViewport(pnWidth, pnHeight)

L_INT L_FAR *pnWidth; | /* pointer to a variable to be updated */
L_INT L_FAR *pnHeight; | /* pointer to a variable to be updated */

Gets the current viewport width and height used when loading 3D file formats.

Parameter | Description
pnWidth | Pointer to a variable to be updated with the current viewport width in pixels.
pnHeight | Pointer to a variable to be updated with the current viewport height in pixels.

Returns

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

Comments

To set the viewport width and height in pixels, use L_2DSetViewport.

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

L_2DGetViewMode

L_2DSetViewMode

L_2DGetViewport

L_2DSetViewport

This function may be used with the following Vector file formats: DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector. For more information on these file formats and their availability, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTKRN
LTFIL

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution For Vector files: L_2DGetViewMode, L_2DSetViewport
 | L_2DSetViewMode,
Topics: | Raster Image Functions: Rasterizing Files
 | Unlocking Vector File Format Support

Example

For an example, refer to L_2DSetViewMode.


L_2DSetViewMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_2DSetViewMode(uViewportMode)

L_UINT uViewportMode;

/* viewport mode */

Sets the current viewport mode used when loading 3D file formats.

Parameter | Description
uViewportMode | New viewport mode. Possible values are:
 | Value | Meaning
 | L2D_USE_BEST | Fit the drawing into 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.

Returns

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

Comments

A 3D file format usually doesn't have a physical size. The user can specify a viewport (physical size upto which the drawing can be rendered) with L_2DSetViewport . How the drawing is to be rendered inside this viewport depends on the current viewport mode set with L_2DSetViewMode. Default viewport size is 640x480 pixels.

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

L_2DGetViewMode

L_2DSetViewMode

L_2DGetViewport

L_2DSetViewport

This function may be used with the following Vector file formats: DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector. For more information on these file formats and their availability, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution For Vector files: L_2DGetViewMode, L_2DGetViewport,
 | L_2DSetViewport
Topics: | Raster Image Functions: Rasterizing Files
 | Unlocking Vector File Format Support

Example

/* 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 */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */

void TestLoad( L_TCHAR L_FAR *pszDXFFileName )
{
/* Set viewport mode to L2D_USE_WIDTH_HEIGHT */
L_2DSetViewMode( L2D_USE_WIDTH_HEIGHT );

/* Set viewport size to 400*400 pixels */
L_2DSetViewport( 400, 400 );

/* Loads a DXF file */
L_LoadBitmap( pszDXFFileName, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL );
}


L_2DSetViewport

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_2DSetViewport(nWidth, nHeight)

L_INT nWidth; | /* new viewport width in pixels */
L_INT nHeight; | /* new viewport height in pixels */

Sets the current viewport width and height used when loading 3D file formats.

Parameter | Description
nWidth | New viewport width.
nHeight | New viewport height.

Returns

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

Comments

A 3D file format usually doesn't have a physical size. The user can specify a viewport (physical size upto which the drawing can be rendered) with L_2DSetViewport . How the drawing is to be rendered inside this viewport depends on the current viewport mode set with L_2DSetViewMode. Default viewport size is 640x480 pixels.

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

L_2DGetViewMode

L_2DSetViewMode

L_2DGetViewport

L_2DsetViewport

This function may be used with the following Vector file formats: DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector. For more information on these file formats and their availability, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPCDResolution, L_SetWMFResolution, L_SetLoadResolution
 | For Vector files: L_2DGetViewMode, L_2DGetViewport, L_2DSetViewMode
Topics: | Raster Image Functions: Rasterizing Files
 | Unlocking Vector File Format Support

Example

For an example, refer to L_2DSetViewMode.


L_AccessBitmap

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_AccessBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Provides exclusive access to the image data contained in a bitmap handle.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to lock.

Returns

None.

Comments

This call locks the memory. If you do not call this function before accessing the data with a low-level function such as L_GetBitmapRow or L_PutBitmapRow, the application will fail.

To make the most of available system resources, you should only keep a bitmap handle locked when you need to access the image data. Call L_ReleaseBitmap to unlock the bitmap data for more efficient use of Windows memory resources.

Required DLLs and Libraries

LTKRN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For a short example, refer to L_GetBitmapRow. For complete sample code, refer to the GETROW example.


L_AdaptiveContrastBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AdaptiveContrastBitmap (pBitmap, uDim, uAmount, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */
L_UINT uAmount; | /* adjustment factor */
L_UINT uFlag; | /* flag */

Performs adaptive contrast enhancement (ACE) to regions that are originally low in contrast. This function is available in the Medical and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uDim | Dimensions of the neighborhood used for filtering (uDim x uDim), in pixels.
uAmount | Value that represents an adjustment factor. Its range starts from 100 and has no upper limit.
uFlag | Value that indicates the adjustment method. Possible values are:
 | Value | Meaning
 | ACE_EXP | [0x0001] Apply exponential adjustment.
 | ACE_LIN | [0x0002] Apply linear adjustment.

Returns

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

Comments

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 L_LocalHistoEqualizeBitmap to perform a local histogram equalization.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_HistoEqualizeBitmap, L_ChangeBitmapContrast, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_LocalHistoEqualizeBitmap, L_ChangeHueSatIntBitmap, L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

/* This example loads a bitmap and applies Adaptive Contrast Enhancement */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply Adaptive Contrast Enhancement */
L_AdaptiveContrastBitmap(&LeadBitmap, 9, 200, ACE_LIN);


L_AddBitmapNoise

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddBitmapNoise(pBitmap, uRange, uChannel)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uRange; | /* percentage of coverage */
L_UINT uChannel; | /* color plane constant */

Adds random pixels to a bitmap, letting you specify the percentage of coverage and the color plane.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to process.
uRange | Percentage of coverage, expressed in tenths of a percent. Valid values are 0 to 1000.
uChannel | 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.

Returns

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

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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

Use this function in order to add random noise to a bitmap.

Use the L_PerlinBitmap function to use a pseudo-random number generator in order to create a Perlin noise, and then procedurally transform that noise into a texture. Depending 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 L_PerlinBitmap function.

Use the L_CloudsBitmap function in order to use Perlin equations to generate pseudo-random noise, and then procedurally transform that noise into a cloud-like texture. The L_CloudsBitmap function applies equations to the Perlin noise that are different than those used by the L_PerlinBitmap function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgAddNoise , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and adds red noise to it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Add red noise with 25 percent coverage */
L_AddBitmapNoise(&LeadBitmap, 250, CHANNEL_RED);


L_AddBitmaps

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddBitmaps(pBitmap, uStructSize, hList, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */
HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uFlag; | /* operation flag */

Adds or averages the bitmaps in a list.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the resulting bitmap on which the effect is applied.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hList | Handle to the list of bitmaps.
uFlag | 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.

Returns

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

Comments

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 function performs operations between data byte-by-byte. An image can be any color resolution. pBitmap is assumed to be unallocated. If pBitmap contains a bitmap, you should free it prior to calling this function. L_AddBitmaps will allocate and store the resulting bitmap in pBitmap. The image resulting from this operation is internally copied from the first image in the list, before performing the adding operation. The operations are performed based on the smallest width and height of the input images.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap, L_AdjustBitmapTint, L_GammaCorrectBitmapExt, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Removing Noise

Example

/* This example creates a bitmap list from one loaded bitmap, rotating each copy by 72 degrees than others, then average them */

HBITMAPLIST hList; /* Bitmap list */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for manipulating the list */
BITMAPHANDLE ResultBitmap; /* Bitmap resulting from the operation */
L_INT i; /* Loop counter */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Create and populate the bitmap list */
L_CreateBitmapList(&hList);
for (i = 0; i < 4; i++)
{
L_CopyBitmap(&TmpBitmap, &LeadBitmap, sizeof(BITMAPHANDLE));
L_RotateBitmap(&TmpBitmap, i*720, ROTATE_RESAMPLE, RGB(255, 0, 0));
L_InsertBitmapListItem(hList, (L_UINT)-1, &TmpBitmap);
}

/*take the average between all rotated bitmaps and store it in ResultBitmap */
L_AddBitmaps(&ResultBitmap, sizeof(BITMAPHANDLE), hList, BC_AVG);
L_DestroyBitmapList(hList);


L_AddBorder

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddBorder(pBitmap, pAddBorderInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPADDBORDERINFO pAddBorderInfo; | /* pointer to a structure */

Adds a border to the specified bitmap. The border is specified by the pAddBorderInfo parameter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.
pAddBorderInfo | Pointer to an ADDBORDERINFO structure that contains information about the border to add.

Returns

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

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddFrame, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* This example loads a bitmap and adds a simple border to it. */
BITMAPHANDLE pBitmap;
LPADDBORDERINFO pAddBorderInfo;

pAddBorderInfo = (LPADDBORDERINFO) GlobalAllocPtr(GHND,
sizeof(ADDBORDERINFO));
if(!pAddBorderInfo)
return;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

pAddBorderInfo->uStructSize = sizeof(ADDBORDERINFO);
pAddBorderInfo->nTopThickness = 20;
pAddBorderInfo->nBottomThickness= 20;
pAddBorderInfo->nLeftThickness = 20;
pAddBorderInfo->nRightThickness = 20;
pAddBorderInfo->crGradientStart = RGB(200, 150,150);
pAddBorderInfo->nLocation = BORDER_OUTSIDE;
pAddBorderInfo->nStyle = BORDER_STYLE_OPAQUE;

L_AddBorder(&pBitmap, pAddBorderInfo);


L_AddFrame

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddFrame(pBitmap, pAddFrameInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPADDFRAMEINFO pAddFrameInfo; | /* pointer to a structure */

Adds a frame to the specified bitmap. The frame is specified by the pAddFrameInfo parameter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.
pAddFrameInfo | Pointer to an ADDFRAMEINFO structure that contains information about the frame to add.

Returns

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

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBorder, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* This example loads a bitmap and adds frame for it. */
BITMAPHANDLE pBitmap;
BITMAPHANDLE pBitmapFrame;
LPADDFRAMEINFO pAddFrameInfo;

pAddFrameInfo = (LPADDFRAMEINFO) GlobalAllocPtr(GHND,
sizeof(ADDFRAMEINFO));
if(!pAddFrameInfo)
return;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("FRAME.CMP"), &pBitmapFrame, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

pAddFrameInfo->uStructSize = sizeof(ADDFRAMEINFO);
pAddFrameInfo->pBitmapFrame = &pBitmapFrame;
pAddFrameInfo->bKeepFrameState =TRUE;
pAddFrameInfo->SmoothEdge = 40;

L_AddFrame(&pBitmap, pAddFrameInfo);


L_AddMessageToBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddMessageToBitmap(pBitmap, pAddMesgInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPADDMESGINFO pAddMesgInfo; | /* pointer to a structure */

Adds a message (text or file) to the specified bitmap. The message is specified by the pAddMesgInfo parameter. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.
pAddMesgInfo | Pointer to an ADDMESGINFO structure that contains information about the message that will be added.

Returns

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

Comments

The purpose of this function 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 function can add message to any type of losslese image such as bmp, tiff, lossless jpeg, and so forth. If used with lossy format types the message may be corrupted or lost.

This function supports 24- and 48-bits images, and 8- and 16-bits grayscale images.

To extract the embedded message use the L_ExtractMessageFromBitmap function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ExtractMessageFromBitmap
Topics: | Raster Image Functions: Getting and Setting File Information
 | Non-Image Data

Example

/* This example loads a bitmap and adds a text message to it. */
BITMAPHANDLE pBitmap;
LPADDMESGINFO pAddMesgInfo;

pAddMesgInfo = (LPADDMESGINFO) GlobalAllocPtr(GHND, sizeof(ADDMESGINFO));
if(!pAddMesgInfo)
return;

pAddMesgInfo->uStructSize = sizeof(ADDMESGINFO);
pAddMesgInfo->pStrMsg = (L_TCHAR *) GlobalAllocPtr(GHND, 200);
if(!pAddMesgInfo->pStrMsg)
return;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

lstrcpy(pAddMesgInfo->pStrMsg, TEXT("LEAD Technologies, Inc."));

/*Add the above message to image in the default position and with the default password */
L_AddMessageToBitmap(&pBitmap, pAddMesgInfo);

/*Free the temporary buffers. */
if(pAddMesgInfo->pStrMsg)
GlobalFreePtr(pAddMesgInfo->pStrMsg);

if(pAddMesgInfo)
GlobalFreePtr(pAddMesgInfo);


L_AddShadowBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddShadowBitmap(pBitmap, uAngle, uThreshold, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAngle; | /* shadow or light direction */
L_UINT uThreshold; | /* threshold value */
L_UINT uFlags; | /* flag */

Adds shadows to the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAngle | 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
uThreshold | Threshold value used to determine which pixels will be affected . Valid values range from 0 through 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 through 4095 for 12-bit grayscale images. Otherwise, it is from 0 through 255. When uFlags = COLOR_RGB, any component (R, G, or B) of a pixel with a value less than the uThreshold value is not affected. When uFlags = COLOR_GRAY, any pixel where the master channel value is less than the uThreshold value is not affected.
uFlags | Type of the shadow. Possible values are:
 | Value | Meaning
 | SHADOW_CLR_RGB | [0] Shadows are colored.
 | SHADOW_CLR_GRAY | [1] Shadows are grayscale.

Returns

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

Comments

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EdgeDetectorBitmap, L_LensFlareBitmap, L_LightBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply shadow effect to the image*/
L_AddShadowBitmap(&LeadBitmap, SHADOW_SE, 0, SHADOW_CLR_GRAY);


L_AddWeightedBitmaps

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddWeightedBitmaps(pBitmap, uStructSize, hList, puFactor, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */
HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT L_FAR * puFactor; | /* array of weight factors */
L_UINT uFlag; | /* operation flag */

Adds or averages the bitmaps in a list according to their weight factors.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the resulting bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hList | Handle to the list of bitmaps.
puFactor | Array of unsigned integer values that represent weights associated with the bitmaps in the specified list. Used only if uFlag is BC_ADDWEIGHTED or BC_AVGWEIGHTED.
uFlag | 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, puFactor.
 | BC_ADDWEIGHTED | [0x0004] Add the bitmaps in the specified list, according to the array of weight factors, puFactor.

Returns

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

Comments

This function can be used to modify the brightness (with the add operations) or remove the noise (with the average operations). Typically, you would call this function for a series of images taken of the same object at short intervals.

If the value of uFlag parameter is:

BC_ADD, the function can be used to add several images of the same view to improve the lightness or brightness of the image. In this case, puFactor is ignored.

BC_AVG, the function can be used to average several images. In this case, puFactor is ignored.

BC_ADDWEIGHTED, the function 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 puFactor array. 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 puFactor equals NULL, each bitmap has the same weight factor of 100 and the result is the same as for BC_ADD.

BC_AVGWEIGHTED, the function can eliminate random noise by performing a weighted average. Each bitmap in any position in the list has a corresponding weight factor in the puFactor 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 puFactor equals NULL, each bitmap has the same weight factor of 100 and the result is the same as for BC_AVG.

This function performs operations between data byte-by-byte. An image can be any color resolution. The resulting image of this operation will be allocated in the pBitmap where it is internally copied from the first image in the list. The operations are performed based on the smallest width and height of the input images.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_AddBitmaps, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap, L_AdjustBitmapTint, L_GammaCorrectBitmapExt, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Removing Noise

Example

/* This example creates a bitmap list from one loaded bitmap, rotating each copy by 72 degrees than others, then average them */

HBITMAPLIST hList; /* Bitmap list */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for manipulating the list */
BITMAPHANDLE ResultBitmap; /* Resulting bitmap */
L_INT i; /* Loop counter */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Create and populate the bitmap list */
L_CreateBitmapList (&hList);
for (i = 0; i < 4; i++)
{
L_CopyBitmap (&TmpBitmap, &LeadBitmap, sizeof(BITMAPHANDLE));
L_RotateBitmap (&TmpBitmap, i*720, ROTATE_RESAMPLE, RGB(255, 0, 0));
L_InsertBitmapListItem (hList, (L_UINT)-1, &TmpBitmap);
}

/*take the average between all rotated bitmaps, and put the result in the ResultBitmap */
L_AddWeightedBitmaps (&ResultBitmap, sizeof(BITMAPHANDLE), hList, NULL, BC_AVG);

L_FreeBitmap(&LeadBitmap);
L_DestroyBitmapList(hList);


L_AdjustBitmapTint

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AdjustBitmapTint(pBitmap, nAngleA, nAngleB)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngleA; | /* angular amount to change the A angle */
L_INT nAngleB; | /* angular amount to change the B angle */

Adjusts the bitmap tint by changing the colors in an image by using two separate color wheel rotations. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
nAngleA | Value that represents the amount of change in the A angle, in hundredths of degrees. Valid values range between –18000 and 18000.
nAngleB | Value that represents the amount of change in the B angle, in hundredths of degrees. Valid values range between –18000 and 18000.

Returns

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

Comments

This function changes the colors in an image by using two separate color wheel rotations. For the nAngleA parameter, a positive rotation takes blue toward green and red, as shown in the following figure:

Negative rotation has the opposite effect. For the nAngleB parameter, a positive rotation takes red toward green. Negative rotation has the opposite effect.

Use the L_ChangeBitmapHue function 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 function only supports colored images.

This function supports 48 and 64 bit color images. Support for 48 and 64 bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapHue, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_ChannelMix, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_SelectiveColorBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ContBrightIntBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_SampleTargetBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and adjusts the tint: */BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. *//* Load the bitmap, keeping the bits per pixel of the file */L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);/* Rotate the A angle by –65 and the B angle by 20 */L_AdjustBitmapTint(&LeadBitmap, -6500, 2000 );


L_AgingBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AgingBitmap (pBitmap, uHScratchCount, uVScratchCount,uMaxScratchLen, uDustDensity, uPitsDensity, uMaxPitSize, crScratch, crDust,crPits, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uHScratchCount; | /* number of horizontal scratch lines */
L_UINT uVScratchCount; | /* number of vertical scratch lines */
L_UINT uMaxScratchLen; | /* maximum scratch line length */
L_UINT uDustDensity; | /* dust density */
L_UINT uPitsDensity; | /* density of pits */
L_UINT uMaxPitSize; | /* maximum pit size */
COLORREF crScratch; | /* color of the scratch lines */
COLORREF crDust; | /* dust color */
COLORREF crPits; | /* color of pits */
L_UINT uFlags; | /* flags */

Adds effects that simulate random color changes, scratches, dust and pits, making a bitmap look like it was made from an old film. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uHScratchCount | Number of horizontal scratch lines.
uVScratchCount | Number of vertical scratch lines.
uMaxScratchLen | Maximum scratch line length, in pixels. Its minimum value is 2.
uDustDensity | Dust density, expressed in tenths of percent of the bitmap area. Valid values range between 0 and 1000. This value is divided internally by 10. If uDustDen = 1000 then dust density = 100% (that is, the number of dust points = the entire bitmap area.)
uPitsDensity | Density of the pits, expressed in tenths of percent of the bitmap area. Valid values range between 0 and 1000. This value is divided internally by 10. If uPitsDen = 1000 then the density of the pits = 100% (that is, the number of pits = the entire bitmap area.)
uMaxPitSize | Maximum pit size, in pixels. The size of the pits will be selected at random between 1 and uMaxPitSize.
crScratch | A COLORREF value representing the color of the scratch lines.
crDust | A COLORREF value representing the color of the dust.
crPits | A COLORREF value representing the color of the pits.
uFlags | 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.

Returns

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

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

The width of the scratches is 1 pixel. The length of the scratches is random (between 2 and uMaxScratchLen).

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 uMaxPitSize x uMaxPitSize.

The function will also make random changes to the pixel’s intensities.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_EmbossBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_MosaicBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Applying Artistic Effects
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS

Example

/* This example loads a bitmap and applies aging effect */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* apply aging effect */
L_AgingBitmap (&LeadBitmap, 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);


L_AllocateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AllocateBitmap(pBitmap, nMemoryType)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
L_INT nMemoryType; | /* flag for the type of memory to allocate */

Allocates storage to hold an image that is referenced by a bitmap handle.

Parameter | Description
pBitmap | Pointer to the bitmap handle that describes the bitmap for which to allocate storage.
nMemoryType | Flag to request the type of memory to allocate. Valid values are:
 | Value | Meaning
 | TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk.
 | TYPE_USER | [0x0002] Create a bitmap where the user maintains the data pointer.
 | TYPE_TILED | [0x0004] Create tiled bitmaps.
 | TYPE_NOTILED | [0x0008] Do not create tiled bitmaps, even if the conventional memory has failed.
 | TYPE_DISK | [0x0080] Do not use conventional memory. Swap to disk only.
 | TYPE_NODISK | [0x0100] Do not swap to disk using LEAD's virtual memory. Windows virtual memory is not affected.
 | TYPE_COMPRESSED | [0x0200] (Document/Medical only) Allocate an RLE-compressed bitmap. You can use this flag with TYPE_CONV or TYPE_NODISK. For more information, refer to Speeding Up 1-Bit Documents.
 | TYPE_SUPERCOMPRESSED | [0x0400] (Document/Medical only) Keep images compressed in memory. This option causes slow access, but very low memory usage. This option is available for 1-bit, 8-bit grayscale, and 24-bit images only.

Returns

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

Comments

The amount allocated depends on the size of the image indicated in the bitmap handle (Width, Height, and BitsPerPixel). L_InitBitmap must be called prior to calling this function.

This is a low-level function that is used only when you create a bitmap from scratch using L_InitBitmap. Normally, the functions that load or create a bitmap allocate the required memory for you. (In that case, calling L_AllocateBitmap causes your application to lose memory.)

If TYPE_USER is set in nMemory, the bitmap is marked as having the data pointer set using L_SetBitmapDataPointer. Freeing this type of bitmap will not free the data pointer set by L_SetBitmapDataPointer.

There is some speed penalty (loss) for accessing tiled bitmaps. Therefore, it is not recommended for use with all bitmaps.

The tiled bitmaps are not used by default. LEADTOOLS will create them only if it failed to create conventional bitmaps and TYPE_NOTILED was not specified.

There are now three distinct types of bitmaps:

a. | Conventional (uncompressed and contiguous) This is the most common type.
b. | Compressed (1-bit only)
c. | Tiled (uncompressed, stored internally as up to 64MB tiles)

Required DLLs and Libraries

LTKRN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreateBitmap, L_InitBitmap, L_FreeBitmap
Topics: | Raster Image Functions: Creating and Deleting Images

Example

For a short example, refer to L_ResizeBitmap. For complete sample code, refer to the FEATURE1 example.


L_AllocFTArray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AllocFTArray(pBitmap, ppFTArray, uStructSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pFTARRAY L_FAR * ppFTArray; | /* pointer to pointer to FTARRAY structure */
L_UINT uStructSize; | /* the size of the FTARRAY structure */

Allocates a FTARRAY structure large enough to hold Fourier Transform coefficients for pBitmap. The structure’s uWidth and uHeight values are the same as the bitmap’s width and height. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap.
ppFTArray | Pointer to a pointer to a FTARRAY structure. The function will allocate a FTARRAY structure large enough to contain the Fourier transform coefficients for the bitmap. The address of this structure will be stored into *ppFTData. When the array is no longer needed, the user should free this structure by calling the L_FreeFTArray function.
uStructSize | The size of the structure. Should be sizeof(FTARRAY).

Returns

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

Comments

The amount allocated depends on the width and height of the image indicated in the bitmap handle

This function is used only when you are dealing with Fourier Transform functions.

When you are finished, you should free the allocated array by calling the L_FreeFTArray function.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

For an example, refer to L_DFTBitmap.


L_AlphaBlendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AlphaBlendBitmap(pBitmapDst, nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, nOpacity)

pBITMAPHANDLE pBitmapDst; | /* pointer to a bitmap handle */
L_INT nXDst; | /* x coordinate */
L_INT nYDst; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
pBITMAPHANDLE pBitmapSrc; | /* pointer to a bitmap handle */
L_INT nXSrc; | /* x coordinate */
L_INT nYSrc; | /* y coordinate */
L_INT nOpacity; | /* opacity value */

Combines image data from two bitmaps, using the specified opacity value.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle that references the destination bitmap. The function will update this bitmap.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
nWidth | Width of the area to be combined, in pixels. This width applies to both the source and the destination areas.
nHeight | Height of the area to be combined, in pixels. This height applies to both the source and the destination areas.
pBitmapSrc | Pointer to the bitmap handle that references the source bitmap.
nXSrc | The X coordinate of the origin of the source rectangle.
nYSrc | The Y coordinate of the origin of the source rectangle.
nOpacity | Opacity value used when combining the areas from the source and destination bitmaps. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

Returns

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

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_FeatherAlphaBlendBitmap, L_CreateFadedMask, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE BitmapDst; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE BitmapSrc; /* source bitmap */
L_INT XDst; /* Column offset of the destination */
L_INT XSize; /* Pixel width of the rectangle to combine */
L_INT YDst; /* Row offset of the destination */
L_INT YSize; /* Pixel height of the rectangle to combine */
L_INT XSrc; /* Column offset of the source */
L_INT YSrc; /* Column offset of the source */
/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &BitmapDst, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("IMAGE2.BMP"), &BitmapSrc, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Specify a position in the top left part of the displayed image */
XDst = BITMAPWIDTH(&BitmapDst) / 8;
YDst = BITMAPHEIGHT(&BitmapDst) / 8;
/* Use the full size of the source bitmap */
YSize = BITMAPHEIGHT(&BitmapSrc);
XSize = BITMAPWIDTH(&BitmapSrc);
XSrc = 0;
YSrc = 0;
/* Combine BitmapSrc with BitmapDst, with half opacity */
L_AlphaBlendBitmap (&BitmapDst, XDst, YDst, XSize, YSize,
& BitmapSrc, XSrc, YSrc, 128);
/* Free the temporary bitmap */
L_FreeBitmap(&BitmapSrc);


L_AnnAddUndoNode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnAddUndoNode(hObject);

HANNOBJECT hObject;

/* handle to the automation object */

Manually adds an undo node to the automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.

Returns

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

Comments

This function allows you to programmatically add a node to the undo stack maintained by the automation object hObject. This function can only be called for automation objects.

This function should be called before making any changes programmatically to the objects inside the container linked to the automation object. That way, these changes can be reversed using the Undo menu brought up by the automation or by calling L_AnnUndo.

The number of actions that can be undone should be set with L_AnnSetUndoDepth before calling this function.

Calling L_AnnSetAutoUndoEnable(FALSE) disables the undo mechanism of the automation object. Therefore the automation object cannot change the undo stack until the undo mechanism is enabled by calling L_AnnSetAutoUndoEnable(TRUE).

ERROR_NO_UNDO_STACK will be returned if L_AnnSetUndoDepth has not been called before this function or if L_AnnSetUndoDepth has been called with uUndoLevels set to 0;

ERROR_UNDO_DISABLED will be returned if the undo has been disabled by calling L_AnnSetAutoUndoEnable(hObject, FALSE).

Basically, the process is as follows:

1. | Call L_AnnSetUndoDepth to set the number of undo actions that can take place.
2. | Call L_AnnAddUndoNode to add an undo node to the automation object.
3. | Disable the undo feature by calling L_AnnSetAutoUndoEnable (FALSE).
4. | Perform the operations to be combined into one undo.
5. | Re-enable the undo feature by calling L_AnnSetAutoUndoEnable (TRUE).

Now, all three operations can be undone with one call to L_AnnUndo instead of three calls to L_AnnUndo.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoUndoEnabled, L_AnnGetAutoUndoEnabled, L_AnnGetUndoDepth, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Undoing Automation Operations
 | Annotation Functions (Document/Medical only): Implementing Automation

Example

For an example, refer to L_AnnSetAutoDefaults.


L_AnnAddUserHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnAddUserHandle(hObject, pAnnHandle)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLE pAnnHandle; | /* pointer to a structure that defines the user handle */

Adds a user-defined handle to an annotation object, where pAnnHandle is a pointer to the structure defining an annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object to which to add the user handle.
pAnnHandle | Pointer to a structure that defines the user handle.

Returns

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

Comments

Before calling this function, you must create the annotation object.

Call this function one or more times to add user handles to an existing annotation object.

The user handle location can be defined using container coordinates or client coordinates.

Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

For more information on defining a user handle, see the documentation for the ANNHANDLE structure.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example adds user handles to the center of the top and bottom lines of a rectangle
// hRect is a rectangle
L_VOID ExampleAnnAddUserHandle(HANNOBJECT hRect)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

L_AnnGetType(hRect, &uType);
if (uType == ANNOBJECT_RECT)
{
L_AnnGetRect(hRect, &arc, NULL);

memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(ANNHANDLE);
AnnHandle.nID = 100;
AnnHandle.bVisible = TRUE;
AnnHandle.crPen = RGB(0,0,0);
AnnHandle.crFill = RGB(255,0,0);
AnnHandle.nShape = ANNHANDLE_SHAPE_CIRCLE;
AnnHandle.hCursor = NULL;
AnnHandle.uFlags = ANNHANDLE_ID | ANNHANDLE_LOCATION |
ANNHANDLE_CONTAINER_COORDINATES | ANNHANDLE_VISIBLE |
ANNHANDLE_PEN_COLOR | ANNHANDLE_FILL_COLOR | ANNHANDLE_SHAPE;

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.top;
L_AnnAddUserHandle(hRect, &AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
L_AnnAddUserHandle(hRect, &AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Rectangle."), TEXT("Error"), MB_OK);
}


L_AnnAdjustPoint

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnAdjustPoint(pptAnchor, pptMove, dAngle, nType)

pANNPOINT pptAnchor; | /* pointer to an ANNPOINT structure that contains the anchor point */
pANNPOINT pptMove; | /* pointer to an ANNPOINT structure that contains the point to be adjusted */
L_DOUBLE dAngle; | /* angle of rotation */
L_INT nType; | /* type of adjustment to point */

Modifies the point pptMove based on the angle from line (pptAnchor, pptMove) and the horizontal. This function is available in the Document/Medical Toolkits.

Parameter | Description
pptAnchor | Pointer to an ANNPOINT structure representing the anchor point.
pptMove | Pointer to an ANNPOINT structure representing the point to be adjusted
dAngle | Angle of rotation in radians. Ranges from -Pi to Pi, (-3.1415… - 3.1415…) where a positive angle corresponds to clockwise rotation.
nType | Type of adjustment to point. Possible values are:
 | ANNADJUST_HORIZONTAL | [1]
 | ANNADJUST_VERITCAL | [2]
 | ANNADJUST_45_DEGREES_FAVOR_X | [3]
 | ANNADJUST_45_DEGREES_FAVOR_Y | [4]

Returns

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

Comments

This utility function 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 ptMove point is adjusted to contain only the horizontal component.

The adjusted ptMove can be seen in step 4.

L_AnnAdjustPoint(&ptAnchor, &ptMove, 35*PI/180, ANNADJUST_HORIZONTAL)

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 give adjusted Move point.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This is part of the custom annotations demo (from example1.c)
// This handler gets called when there is a mouse move message on a user handle
// There are four user handles that are processed differently
// HANDLE_ID_VERTICAL_LEFT
// HANDLE_ID_VERTICAL_RIGHT
// These two both restrict the mouse cursor to a line parallel to the top of the rectangle,
// even if the rectangle is rotated
// HANDLE_ID_HORIZONTAL_BOTTOM
// Restricts the mouse cursor to a line parallel to the side of the rectangle,
// even if the rectangle is rotated
// HANDLE_ID_HORIZONTAL_TOP
// Rotates the rectangle around the bottom handle (HANDLE_ID_HORIZONTAL_BOTTOM)
L_VOID Example1_Handle_MouseMove(LPCHILDDATA pData, pANNMOUSEPOS pMousePos)
{
L_DOUBLE dAngle;
ANNPOINT ptAnchor, ptMove;
L_AnnGetRotateAngle(pData->hObjectChange, &dAngle);

ptAnchor.x = pData->pt0.x;
ptAnchor.y = pData->pt0.y;

ptMove.x = pMousePos->pt.x;
ptMove.y = pMousePos->pt.y;

switch (pData->nUserHandleID)
{
case HANDLE_ID_VERTICAL_LEFT:
case HANDLE_ID_VERTICAL_RIGHT:
{
L_DOUBLE dx, dy;
POINT pt;

L_AnnAdjustPoint(&ptAnchor, &ptMove, dAngle, ANNADJUST_HORIZONTAL);
dx = (ptMove.x - ptAnchor.x)/2;
dy = (ptMove.y - ptAnchor.y)/2;

pt = pMousePos->pt;
pt.x = (LONG)(ptAnchor.x + dx);
pt.y = (LONG)(ptAnchor.y + dy);

L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_APPEND);
L_AnnDefine(pData->AnnObjectNeighbors[1], &pt, ANNDEFINE_APPEND);
}
break;

case HANDLE_ID_HORIZONTAL_BOTTOM:
L_AnnAdjustPoint(&ptAnchor, &ptMove, dAngle, ANNADJUST_VERTICAL);
L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_APPEND);
L_AnnDefine(pData->AnnObjectNeighbors[1], &pMousePos->pt, ANNDEFINE_APPEND);
break;

case HANDLE_ID_HORIZONTAL_TOP:
L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_APPEND);
L_AnnDefine(pData->AnnObjectNeighbors[1], &pMousePos->pt, ANNDEFINE_APPEND);
break;

}

pMousePos->fUpdatePos = FALSE;
if (
(pData->nUserHandleID == HANDLE_ID_VERTICAL_LEFT) ||
(pData->nUserHandleID == HANDLE_ID_VERTICAL_RIGHT) ||
(pData->nUserHandleID == HANDLE_ID_HORIZONTAL_TOP) ||
(pData->nUserHandleID == HANDLE_ID_HORIZONTAL_BOTTOM)
)
{
if (ISDIFFERENT(&ptMove,&pMousePos->pt))
{
pMousePos->pt.x = ROUND(ptMove.x);
pMousePos->pt.y = ROUND(ptMove.y);

pMousePos->fUpdatePos = TRUE;
}
}
}


L_AnnBringToFront

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnBringToFront(hObject)

HANNOBJECT hObject;

/* handle to the annotation object */

Reorders the specified annotation object so that it is displayed on top of other objects in the same container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.

Returns

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

Comments

(Document/Medical) This function moves the object to the end of the enumeration order for objects in the same container. When the container is displayed, using the L_AnnDraw function, this object is displayed last.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDraw, L_AnnSendToBack,
 | L_AnnGetBoundingRect
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For complete sample code, refer to the Annotate example.

/* This example toggles an object, bringing it to the front or sending it to the back */
void TestAnnBringToFront(HANNOBJECT hAnnObject)
{
static BOOL InFront;
if (InFront)
{
L_AnnSendToBack(hAnnObject);
InFront = FALSE;
}
else
{
L_AnnBringToFront(hAnnObject);
InFront = TRUE;
}
return;
}


L_AnnCalibrateRuler

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCalibrateRuler (hObject, dCalibrateLength, uCalibrateUnit, dDpiRatioXtoY)

HANNOBJECT hObject; | /* handle to an ANNOBJECT_RULER object */
L_DOUBLE dCalibrateLength; | /* length to assign to the ruler */
L_UINT uCalibrateUnit; | /* units of the length */
L_DOUBLE dDpiRatioXtoY; | /* ratio of dpiX to dpiY */

Calibrates an ANNOBJECT_RULER annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an ANNOBJECT_RULER object.
dCalibrateLength | Length to be assigned to the ruler.
uCalibrateUnit | Units of the length. Possible values are:
 | Value | Meaning
 | ANNUNIT_INCHES | [0] Inches.
 | ANNUNIT_FEET | [1] Feet.
 | ANNUNIT_YARDS | [2] Yards.
 | ANNUNIT_MICROMETERS | [3] Micrometers.
 | ANNUNIT_MILLIMETERS | [4] Millimeters.
 | ANNUNIT_CENTIMETERS | [5] Centimeters.
 | ANNUNIT_METERS | [6] Meters.
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.

Returns

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

Comments

Call this function to calibrate an ANNOBJECT_RULER object. This function is used to assign any existing ANNOBJECT_RULER object to a specific length.

Note that this function only works on ANNOBJECT_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 ANNOBJECT_RULER objects, it can be used indirectly to calibrate any or all ruler objects, including ANNOBJECT_POLYRULER, ANNOBJECT_CROSSPRODUCT, and ANNOBJECT_POLYRULER. To do this, calibrate an ANNOBJECT_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 passed a negative value to the dDpiRatioXtoY parameter, the ERROR_INV_PARAMETER error will be returned.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiX, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetDistance, L_AnnGetDistance2, L_AnnSetOptions, L_AnnGetOptions
Topics: | Calibrating Annotation Ruler Objects
 | Annotation Functions:Getting and Setting Ruler Properties
 | New Annotation Features of Version 14.5

Example

// This 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.
L_VOID ExampleAnnCalibrateRuler(HANNOBJECT hContainer, HANNOBJECT hAutomation, HANNOBJECT hObjectRuler)
{
L_INT nRet = SUCCESS;
L_UINT uObjectType = 0;
L_DOUBLE dDpiX = 0;
L_DOUBLE dDpiY = 0;

nRet = L_AnnGetType(hObjectRuler, &uObjectType);
if (nRet != SUCCESS)
return;

if (uObjectType!= ANNOBJECT_RULER)
{
MessageBox(NULL, "Error: L_AnnCalibrateRuler only works on ANNOBJECT_RULER objects", "Error", MB_OK);
return;
}
nRet = L_AnnCalibrateRuler(hObjectRuler, 10, ANNUNIT_INCHES, 1.0);
if (nRet != SUCCESS)
return;

MessageBox(NULL, "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.", "Error", MB_OK);

L_AnnGetBitmapDpiX (hObjectRuler, &dDpiX);
L_AnnGetBitmapDpiY (hObjectRuler, &dDpiY);

// Match calibration to existing objects in container
L_AnnSetBitmapDpiX(hContainer, dDpiX, ANNFLAG_RECURSE);
L_AnnSetBitmapDpiY(hContainer, dDpiY, ANNFLAG_RECURSE);

// Set automation defaults so that all newly created objects have this calibration
L_AnnSetBitmapDpiX(hAutomation, dDpiX, ANNFLAG_RECURSE);
L_AnnSetBitmapDpiY(hAutomation, dDpiY, ANNFLAG_RECURSE);
}


L_AnnChangeUserHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnChangeUserHandle( hObject, nIndex, pAnnHandle)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT32 nIndex; | /* index of the user handle to change */
pANNHANDLE pAnnHandle; | /* pointer to a structure that defines how to change the user handle */

Changes properties of an existing user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object for which to change the user handle.
nIndex | Index of the user handle to change. This index is zero-based.
pAnnHandle | Pointer to a structure that defines how to change the user handle.

Returns

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

Comments

Use this function to change the properties of an existing user-defined annotation handle.

This function is used in conjunction with the L_AnnAddUserHandle and L_AnnEnumerateHandles and L_AnnChangeUserHandle functions.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example changes the first user handle of an object by
// * Moving handle ten pixels to the left
// * Changing color of handle to blue
// * Changing shape of handle to square
// * Displays the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(HANNOBJECT hObject)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
L_AnnGetUserHandles(hObject, NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
L_AnnGetUserHandle(hObject, 0, &AnnHandle);

AnnHandle.aptContainer.x +=10;
AnnHandle.crFill = RGB(0,0,255);
AnnHandle.nShape = ANNHANDLE_SHAPE_SQUARE;
AnnHandle.hCursor = LoadCursor(NULL,IDC_APPSTARTING);
AnnHandle.uFlags = ANNHANDLE_FILL_COLOR | ANNHANDLE_SHAPE | ANNHANDLE_LOCATION | ANNHANDLE_CONTAINER_COORDINATES;
L_AnnChangeUserHandle(hObject, 0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


L_AnnClearTextTokenTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnClearTextTokenTable(hAutomation)

HANNOBJECT hAutomation;

/* handle of the automation object */

Removes all tokens from the text token table. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle of the automation object.

Returns

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

Comments

Call this function to delete ALL the tokens from the text token table. This function is used with the text annotation objects that support tokens, namely the following:

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeleteTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnGetTextExpandTokens, L_AnnInsertTextTokenTable, L_AnnSetTextExpandTokens
Topics: | The Annotation Text Token Table
 | Annotation Functions (Document/Medical only): Text Properties

Example

// This example removes all of the tokens from the current text token table
L_VOID SampleAnnClearTextTokenTable(HANNOBJECT hAutomation)
{

L_AnnClearTextTokenTable(hAutomation);
}


L_AnnClipboardReady

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnClipboardReady(pfReady)

L_BOOL, L_FAR * pfReady;

/* address of the variable to be updated */

Determines whether the Windows clipboard contains an annotation object that can be pasted using the L_AnnCopyFromClipboard function. This function is available in the Document/Medical Toolkits.

Parameter | Description
pfReady | Address of the variable to be updated with a value indicating whether the clipboard contains an annotation object. Possible values are:
 | Value | Meaning
 | TRUE | The clipboard contains an annotation that can be copied.
 | FALSE | The clipboard does not contain an annotation that can be copied.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfReady parameter. This function will update the variable with the result of the test.

You can use L_AnnCopyToClipboard or L_AnnCutToClipboard to put valid annotation data on the clipboard. L_AnnCopyFromClipboard can be used to copy valid annotation data from the clipboard to a container.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCopy, L_AnnCopyFromClipboard,
 | L_AnnCopyToClipboard, L_AnnCutToClipboard
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects

Example

For complete sample code, refer to the ANNOTATE example.

/* This example checks the clipboard for valid annotation data, and if valid data is present, copies and inserts the annotations, and displays the results. */

HANNOBJECT hContainer; /* Container annotation object */
void TestAnnCopyFrom(HWND hWnd)
{
L_BOOL GoodData; /* TRUE if there is annotation data on the clipboard */
HDC hdc;
RECT rAnnBounds;
RECT rcAnnNameBounds;
HANNOBJECT TmpContainer;

/* See if we have annotations on the clipboard */
L_AnnClipboardReady(&GoodData);
/* Copy the annotations, if they exist */
if (GoodData)
{
L_AnnCopyFromClipboard(hWnd, &TmpContainer);
/* The following code inserts the copied annotations and allows you to see the results. */
L_AnnInsert(hContainer, TmpContainer, TRUE);
hdc = GetDC(hWnd);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rcAnnNameBounds);
L_AnnDraw(hdc, &rAnnBounds, hContainer);
}

return;
}


L_AnnConvert

#include "l_bitmap.h"

L_INT L_EXPORT L_AnnConvert(hContainer, pPoints, pAnnPoints, nCount, nConvert)

HANNOBJECT hContainer; | /* handle to the annotation container */
LPPOINT pPoints; | /* array of points in client coordinates */
pANNPOINT pAnnPoints; | /* array of points in container coordinates */
L_INT nCount; | /* number of points in the arrays (pPoints, pAnnPoints) */
L_INT nConvert; | /* direction of conversion */

Use this function to convert back and forth between container coordinates and client coordinates. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the annotation container
pPoints | Array of points in client coordinates. Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling
pAnnPoints | Array of points in container coordinates. Container coordinates are typically the same dimensions of the underlying bitmap, and are independent of zooming and scrolling.
nCount | Number of points in the arrays (pPoints, pAnnPoints)
nConvert | A value that specifies the direction of the conversion. Possible values are:
 | Value | Meaning
 | ANNCONVERT_TO_CONTAINER | [1] Convert to container coordinates
 | ANNCONVERT_TO_CLIENT | [2] Convert to client coordinates

Returns

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

Comments

Use this function to convert back and forth between container coordinates and client coordinates.

The number of elements in both the pPoints and pAnnPoints arrays must be AT LEAST equal to nCount.

When nConvert is ANNCONVERT_TO_CONTAINER, the pPoints array must contain valid entries. If successful, pAnnPoints will contain the converted points.

When nConvert is ANNCONVERT_TO_CLIENT, the pAnnPoints array must contain valid entries. If successful, pPoints will contain the converted points.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnRestrictCursor.


L_AnnCopy

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCopy(hSource, phDest)

HANNOBJECT hSource; | /* handle to the annotation object to be copied */
pHANNOBJECT phDest; | /* address of the HANNOBJECT variable to be updated */

Makes a copy of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hSource | Handle to the annotation object to be copied.
phDest | Address of the HANNOBJECT variable to be updated with the handle of the new annotation object.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phDest parameter. This function will update the variable with the handle of the annotation object created by the copy.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCopyFromClipboard, L_AnnCopyToClipboard, L_AnnCutToClipboard, L_AnnClipboardReady
Topics: | Annotation Functions: Creating and Deleting Annotations Implementing Annotations Implementing an Automated Annotation Program Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects

Example

/* This example copies an object and moves the copy so that it can be seen */
void TestAnnCopy(HANNOBJECT hContainer, HANNOBJECT hAnnObject)
{
HANNOBJECT NewObject; /* New object created by copying */
ANNRECT ContainerRect;/* Rectangle for positioning the new object */
/* Copy the incoming object and insert it into the container */
L_AnnCopy(hAnnObject, &NewObject);
L_AnnInsert(hContainer, NewObject, FALSE);
/* Move the new object down and to the right */
L_AnnGetRect(hContainer, &ContainerRect, NULL);
L_AnnMove(NewObject,
(ContainerRect.right - ContainerRect.left) / 20,
(ContainerRect.bottom - ContainerRect.top) / 20,
0);
return;
}


L_AnnCopyFromClipboard

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCopyFromClipboard(hWnd, phContainer)

HWND hWnd; | /* handle to the window for the container */
pHANNOBJECT phContainer; | /* handle to the annotation container object */

Copies an annotation object from the clipboard to a specified annotation container. The data on the clipboard must be a LEAD annotation in native format. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the window for the container.
phContainer | Handle to the annotation container object.

Returns

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

Comments

(Document/Medical) Before calling this function, you can use the L_AnnClipboardReady function to test the validity of data on the clipboard.

You can use L_AnnCopyToClipboard or L_AnnCutToClipboard to place valid annotation data on the clipboard.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCopy, L_AnnCopyToClipboard,
 | L_AnnCutToClipboard, L_AnnClipboardReady
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects

Example

For an example, refer to L_AnnClipboardReady.

For complete sample code, refer to the ANNOTATE example.


L_AnnCopyToClipboard

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCopyToClipboard(hObject, uFormat, fSelected, fEmpty, fCheckMenu)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFormat; | /* constant for the clipboard format */
L_BOOL fSelected; | /* flag that indicates which objects to copy */
L_BOOL fEmpty; | /* flag that indicates whether to empty the clipboard prior to copying data to it */
L_BOOL fCheckMenu; | /* flag that indicates whether to check the automation menu */

Copies the specified annotation objects to the Windows clipboard in either the native format or WMF format. This function is available in both the ( Document/Medical ) toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFormat | Format for the annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | Use LEAD's own format for annotations.
 | ANNFMT_WMF | Use the Windows WMF format.
 | ANNFMT_ENCODED | Copy as a binary format.
 | ANNFMT_XML | Use the XML text format. This is LEAD’s new text-based format which is upward-compatible.
fSelected | Flag that indicates whether to copy all selected objects, or just the specified object. Possible values are:
 | Value | Meaning
 | TRUE | Copy all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | FALSE | Copy only the specified object.
fEmpty | Flag that indicates whether to empty the clipboard prior to copying the annotation data to it. Possible values are:
 | Value | Meaning
 | TRUE | Empty the clipboard before copying data to it.
 | FALSE | Add to the existing data on the clipboard.
fCheckMenu | Flag that indicates whether check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked. Possible values are:
 | Value | Meaning
 | TRUE | Check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked for the specified object. Only those objects with ANNAUTOTEXT_MENU_COPY checked will be copied.
 | FALSE | Do not check the automation menu to see if ANNAUTOTEXT_MENU_COPY has been checked for the specified object. The copied objects are determined by fSelected only.

Returns

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

Comments

(Document/Medical) Use the WMF format only for copying for use in another application.

To retain scaling and positioning information, this function always copies the root container, along with the specified object or selected objects. 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCopy, L_AnnCopyFromClipboard,
 | L_AnnCutToClipboard, L_AnnClipboardReady
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects

Example

/* This example copies all annotations to the clipboard */
void TestAnnCopyTo(HANNOBJECT hAnnObject)
{
HANNOBJECT TopContainer; /* Root container */
int nRet;
/* Get the root container */
L_AnnGetTopContainer(hAnnObject, &TopContainer);
/* Copy all annotations to the clipboard */
nRet = L_AnnCopyToClipboard(TopContainer, ANNFMT_NATIVE, FALSE, TRUE, FALSE);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("Annotations copied."), TEXT("Notice"), MB_OK);
return;
}


L_AnnCreate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCreate(uObjectType, phObject)

L_UINT uObjectType; | /* type of annotation object to create */
pHANNOBJECT phObject; | /* address of the variable to be updated */

Creates an annotation object of the specified type. This function is available in the Document/Medical Toolkits.

Parameter | Description
uObjectType | The type of annotation object to create. For descriptions of object types, refer to Types of Annotations.
phObject | Address of the variable to be updated with the handle to the new annotation object.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the new annotation object.

You must use the L_AnnSet... functions to initialize the object after it is created.

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT, or during the ANNENUMCALLBACK callback function

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateContainer, L_AnnCreateItem,
 | L_AnnDefine, L_AnnInsert, L_AnnRemove,
 | L_AnnDestroy, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Types of Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

For complete sample code, refer to the ANNOTATE example.

/* This example creates a line object, inserts it into the existing container, and displays the line */
/*This function must be called AFTER a container has been created. For example, after TestCreateAnn in Implementing a Non-automated Annotation Program. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT MyLine; /* Line annotation object */

void TestCreateLineAnn(HWND hWnd)
{
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect;
ANNRECT ContainerRectName;
ANNPOINT MyLinePts[2];
pANNPOINT pMyLinePts = MyLinePts;
RECT rAnnBounds;
RECT rAnnBoundsName;

/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Create the Line Annotation and insert it into the container */
L_AnnCreate(ANNOBJECT_LINE, &MyLine);
L_AnnInsert(hContainer, MyLine, FALSE);
L_AnnSetVisible(MyLine, TRUE, 0, NULL);
/* Get the container rectangle to use for positioning the line */
L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
/* Position the line */
pMyLinePts[0].x = 0;
pMyLinePts[0].y = 0;
pMyLinePts[1].x = ContainerRect.right / 2;
pMyLinePts[1].y = ContainerRect.bottom / 2;
L_AnnSetPoints(MyLine, pMyLinePts, 2);
/* Display the line */
L_AnnGetBoundingRect(MyLine, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hWindowDC, &rAnnBounds, MyLine);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
ReleaseDC(hWnd, hWindowDC);
return;
}


L_AnnCreateContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCreateContainer(hWnd, pRect, fVisible, phObject)

HWND hWnd; | /* handle to the window for the container */
pANNRECT pRect; | /* pointer to the structure that specifies the container */
L_BOOL fVisible; | /* flag that indicates whether the container will be visible */
pHANNOBJECT phObject; | /* address of the variable to be updated */

Creates and initializes an annotation object that is a container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the window for the container.
pRect | Pointer to the LEADTOOLS ANNRECT structure that specifies the container. The ANNRECT structure is like a Windows RECT structure, except that it uses double-precision floating point values.
 | Coordinates of an object's rectangle 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.
fVisible | Flag that indicates whether the container will be visible. Possible values are:
 | Value | Meaning
 | TRUE | The container is visible.
 | FALSE | The container is not visible.
phObject | Address of the variable to be updated with the handle to the annotation object.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the new annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnCreateItem, L_AnnDefine,
 | L_AnnInsert, L_AnnRemove, L_AnnDestroy, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations,
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program,
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

For an example, refer to Implementing a Non-automatic Annotation Program or Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnCreateItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCreateItem(hContainer, uObjectType, fVisible, phObject)

HANNOBJECT hContainer; | /* handle to the container object */
L_UINT uObjectType; | /* type of annotation object to create */
L_BOOL fVisible; | /* flag that indicates whether the object will be visible */
pHANNOBJECT phObject; | /* address of the variable to be updated */

Creates an annotation object in a container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the annotation object that is the container for the object to be created.
uObjectType | The type of annotation object to create. For descriptions of object types, refer to Types of Annotations.
fVisible | 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.
phObject | Address of the variable to be updated with the handle to the annotation object.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the new annotation object.

You must use the L_AnnSet... functions to initialize the object after it is created.

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT, or during the ANNENUMCALLBACK callback function

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnCreateContainer, L_AnnDefine,
 | L_AnnInsert, L_AnnRemove, L_AnnDestroy, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

For an example, refer to Implementing a Non-automated Annotation Program.


L_AnnCreateToolBar

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCreateToolBar(hwndParent, pPoint, uAlign, fVisible, phWnd, uButtons, pButtons)

HWND hwndParent; | /* handle to the parent window */
LPPOINT pPoint; | /* pointer to the POINT structure that positions the window */
L_UINT uAlign; | /* constant for the toolbar alignment */
L_BOOL fVisible; | /* flag that indicates whether the toolbar will be visible */
HWND, L_FAR * phWnd; | /* address of the HWND variable to be updated */
L_UINT uButtons; | /* number of buttons the toolbar will have */
pANNBUTTON pButtons; | /* array of ANNBUTTON structures that contain toolbar button information */

Creates an annotation toolbar in the specified window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndParent | Handle to the parent window.
pPoint | Pointer to the POINT structure that specifies the position of the new window in the parent window. Coordinates are relative to the parent window.
uAlign | Value indicating which corner of the toolbar is located at pPoint. One of the following values:
 | ANNTOOLALIGN_LEFT [0x0000]
 | ANNTOOLALIGN_RIGHT [0x0001] must be combined using the bitwise OR with one of these values:
 | ANNTOOLALIGN_TOP [0x0000]
 | ANNTOOLALIGN_BOTTOM [0x0002]
 | For example, ANNTOOLALIGN_LEFT|ANNTOOLALIGN_TOP indicates that pPoint is the top left point of the toolbar.
fVisible | Flag that indicates whether the toolbar will be visible. Possible values are:
 | Value | Meaning
 | TRUE | Toolbar will be visible.
 | FALSE | Toolbar will not be visible.
phWnd | Address of the HWND variable to be updated with the handle to the toolbar window.
uButtons | Number of buttons that will be in the annotation toolbar. This value is valid only if pButtons is not NULL.
pButtons | Array of ANNBUTTON structures that contain information about the tool buttons to include in the annotation toolbar. If this is NULL, the default annotation toolbar will be created.

Returns

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

Comments

(Document/Medical) Before calling this function, you must declare a variable of data type HWND. Then, pass the address of the variable in the phWnd parameter. This function will update the variable with the window handle for the toolbar.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetToolBarChecked, L_AnnSetToolBarChecked,
 | L_AnnGetToolBarButtonVisible,
 | L_AnnSetToolBarButtonVisible
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnCutToClipboard

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnCutToClipboard(hObject, uFormat, fSelected, fEmpty, fCheckMenu)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFormat; | /* constant for the clipboard format */
L_BOOL fSelected; | /* flag that indicates which objects to cut */
L_BOOL fEmpty; | /* flag that indicates whether to empty the clipboard prior to copying data to it */
L_BOOL fCheckMenu; | /* flag that indicates whether to check the automation menu */

Cuts the specified annotation objects to the Windows clipboard in either the native format or WMF format. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFormat | Format for the annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | Use LEAD's own format for annotations.
 | ANNFMT_WMF | Use the Windows WMF format.
 | ANNFMT_ENCODED | Copy as a binary format.
 | ANNFMT_XML | Use the XML text format. This is LEAD’s new text-based format which is upward-compatible.
fSelected | Flag that indicates whether to copy all selected objects, or just the specified object. Possible values are:
 | Value | Meaning
 | TRUE | Cut all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | FALSE | Cut only the specified object.
fEmpty | Flag that indicates whether to empty the clipboard prior to copying the annotation data to it. Possible values are:
 | Value | Meaning
 | TRUE | Empty the clipboard before copying data to it.
 | FALSE | Add to the existing data on the clipboard.
fCheckMenu | Flag that indicates whether check the automation menu to see if ANNAUTOTEXT_MENU_CUT has been checked. Possible values are:
 | Value | Meaning
 | TRUE | Check the automation menu to see if ANNAUTOTEXT_MENU_CUT has been checked for the specified object. Only those objects with ANNAUTOTEXT_MENU_CUT checked will be copied.
 | FALSE | Do not check the automation menu to see if ANNAUTOTEXT_MENU_CUT has been checked for the specified object. The copied objects are determined by fSelected only.

Returns

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

Comments

(Document/Medical) Use the WMF format only for copying for use in another application.

To retain scaling and positioning information, this function always copies the root container, along with the specified object or selected objects. 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.

You can copy data from the clipboard to a container using L_AnnCopyFromClipboard.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCopy, L_AnnCopyFromClipboard,
 | L_AnnCopyToClipboard, L_AnnClipboardReady
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects

Example

/* This example deletes all annotations as it copies them to the clipboard */
void TestAnnCutToClipboard(HANNOBJECT hAnnObject)
{
HANNOBJECT TopContainer; /* Root container */
int nRet;
/* Get the root container */
L_AnnGetTopContainer(hAnnObject, &TopContainer);
/* Cut all annotations to the clipboard */
nRet = L_AnnCutToClipboard(TopContainer, ANNFMT_NATIVE, FALSE, TRUE, FALSE);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("Annotations cut."), TEXT("Notice"), MB_OK);
return;
}


L_AnnDefine

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDefine(hObject, pPoint, uState)

HANNOBJECT hObject; | /* handle to the annotation object */
LPPOINT pPoint; | /* pointer to a POINT structure */
L_UINT uState; | /* state of the process of modifying the annotation object */

Specifies the shape when creating or transforming an annotation object. This function specifies one point in the current window each time it is called. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPoint | Pointer to a POINT structure. The points in the array 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. To define a rectangle, the last point is the opposite vertex of the first point.
uState | State of the process of modifying the annotation object.
 | Value | Meaning
 | ANNDEFINE_BEGINSET | [0] This is the first point to define a new object.
 | ANNDEFINE_BEGINMOVE | [1] This is the point from which to move the object.
 | ANNDEFINE_BEGINROTATE | [2] This is the starting point for calculating the angle of rotation.
 | ANNDEFINE_BEGINRESIZE | [3] This is the starting point for calculating how to resize the object.
 | ANNDEFINE_BEGINSELECT | [4] This is the first corner of the rectangle used to select objects.
 | ANNDEFINE_APPEND | [5] This is the next point when defining an object that requires more than two points.
 | ANNDEFINE_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.
 | ANNDEFINE_END | [7] This is the last point.
 | ANNDEFINE_BEGINMOVESELECTED | [8] This is the point from which to move all selected objects.
 | ANNDEFINE_BEGINROTATESELECTED | [9] This is the starting point for calculating the angle of rotation for all selected objects.
 | ANNDEFINE_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: ANNOBJECT_LINE ANNOBJECT_POLYLINE ANNOBJECT_POLYGON ANNOBJECT_POINTER ANNOBJECT_FREEHAND ANNOBJECT_FREEHANDHOTSPOT ANNOBJECT_RULER ANNOBJECT_CROSSPRODUCT ANNOBJECT_PROTRACTOR ANNOBJECT_CURVE ANNOBJECT_CURVECLOSED You can use ANNDEFINE_BEGINMOVEPOINT to perform a simultaneous rotate and resize for the following objects: When doing this, call L_AnnDefine with the ANNDEFINE_SETANCHORPOINT flag prior to calling L_AnnDefine with the ANNDEFINE_BEGINMOVEPOINT flag. (Note that you must set an anchor point prior to using ANNDEFINE_BEGINMOVEPOINT) ANNOBJECT_RECT ANNOBJECT_ELLIPSE ANNOBJECT_HILITE ANNOBJECT_REDACT ANNOBJECT_TEXT ANNOBJECT_NOTE ANNOBJECT_STAMP ANNOBJECT_HOTSPOT
 | ANNDEFINE_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 L_AnnDefine with this flag prior to calling L_AnnDefine with the ANNDEFINE_BEGINROTATE flag.

Returns

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

Comments

(Document/Medical) Before calling this function, you must create the object, and the object must have a window handle (which can be inherited from the container).

To specify the shape of an object that is defined by a polygon, you call this function repeatedly to create an array of points, 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.

To specify the shape of an object that is defined by a rectangle, you call this function for each of two opposite corners.

You can also call this function on mouse move events during the definition of an object to update the current view of the object being defined. Thus, this function can handle the display of the object during and after its creation.

When rotating or resizing an object, you call this function for the first point and last point, and this function determines the angle of rotation or resize parameters based on the difference in the points.

When rotating an annotation object around a point other than its center, call L_AnnDefine with the ANNDEFINE_SETANCHORPOINT flag set, prior to calling L_AnnDefine with the ANNDEFINE_BEGINROTATE flag set. For example, to rotate an object around the point (10,20) in client coordinates, do the following:

(Assume that pMousePos->pt is the current mouse location in client coordinates)

POINT ptLocation;
ptLocation.x = 10;
ptLocation.y = 20;
L_AnnDefine(hObject, &ptLocation, ANNDEFINE_SETANCHORPOINT);
L_AnnDefine(hObject, &pMousePos->pt, ANNDEFINE_BEGINROTATE);

// One or more ANNDEFINE_APPEND
L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_APPEND);

L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_END);

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnCreateContainer,
 | L_AnnCreateItem, L_AnnInsert, L_AnnRemove,
 | L_AnnDestroy, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Objects - Default Values
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

/* This example uses static variables to simulate user input to create
a rectangular annotation object. */
/* You must call this function twice. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnDefine(HWND hWnd)
{
POINT ThisPoint; /* Simulates the mouse position in the current window */
static RECT rClientRect; /* Rectangle for the window's client area */
static HANNOBJECT MyObj; /* Annotation object being created */
static int CallCount = 0;/* Counter for simulating user input */
/* Update the call count */
++CallCount;
switch (CallCount)
{
case 1:
/* Create the rectangle annotation */
L_AnnCreateItem(hContainer, ANNOBJECT_RECT, TRUE, &MyObj);
/* Get the rectangle for the window's client area */
GetClientRect(hWnd,&rClientRect);
/* Set the point for one corner (Use lower right to show flexibility) */
ThisPoint.x = rClientRect.right * 4/5;
ThisPoint.y = rClientRect.bottom * 4/5;
/* Begin defining the rectangular annotation object */
L_AnnDefine(MyObj, &ThisPoint, ANNDEFINE_BEGINSET);
break;
case 2:
/* Set the point for the opposite corner of the rectangle */
ThisPoint.x = rClientRect.right / 2;
ThisPoint.y = rClientRect.bottom / 2;
/* Finish defining the rectangular annotation object */
L_AnnDefine(MyObj, &ThisPoint, ANNDEFINE_END);
break;
default:
CallCount = 0;
}
return;
}


L_AnnDefine2

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDefine2(hObject, apt, uState)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINT apt; | /* pointer to an ANNPOINT structure */
L_UINT uState; | /* state of the process of modifying the annotation object */

Specifies the shape when creating or transforming an annotation object. This function specifies one point in the current window each time it is called. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
apt | Pointer to an ANNPOINT structure. The specified point is in container coordinates.
uState | State of the process of modifying the annotation object. Possible values are:
 | Value | Meaning
 | 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 L_AnnDefine2 with this flag set prior to calling L_AnnDefine2 with the ANNDEFINE_BEGINROTATE flag set.
 | ANNDEFINE_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:
 |  | ANNOBJECT_LINE
 |  | ANNOBJECT_POLYLINE
 |  | ANNOBJECT_POLYGON
 |  | ANNOBJECT_POINTER
 |  | ANNOBJECT_FREEHAND
 |  | ANNOBJECT_FREEHANDHOTSPOT
 |  | ANNOBJECT_RULER
 |  | ANNOBJECT_CROSSPRODUCT
 |  | ANNOBJECT_PROTRACTOR
 |  | ANNOBJECT_CURVE
 |  | ANNOBJECT_CURVECLOSED
 |  | You can use ANNDEFINE_BEGINMOVEPOINT to perform a simultaneous rotate and resize for the following objects:
 |  | (Note that you must set an anchor point prior to using ANNDEFINE_BEGINMOVEPOINT)
 |  | ANNOBJECT_RECT
 |  | ANNOBJECT_ELLIPSE
 |  | ANNOBJECT_HILITE
 |  | ANNOBJECT_REDACT
 |  | ANNOBJECT_TEXT
 |  | ANNOBJECT_NOTE
 |  | ANNOBJECT_STAMP
 |  | ANNOBJECT_HOTSPOT
 |  | When doing this, call L_AnnDefine2 with the ANNDEFINE_SETANCHORPOINT flag set prior to calling L_AnnDefine2 with the ANNDEFINE_BEGINMOVEPOINT flag set.

Returns

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

Comments

This function is used only with the following states:

ANNDEFINE_SETANCHORPOINT

ANNDEFINE_BEGINMOVEPOINT

If you try to use a uState value other than ANNDEFINE_SETANCHORPOINT or ANNDEFINE_BEGINMOVEPOINT, the function returns ERROR_INV_PARAMETER.

This function is similar to L_AnnDefine, except that L_AnnDefine2 takes a point in container coordinates, whereas L_AnnDefine takes a point in client coordinates.

Use this function when additional accuracy is required when setting an anchor point, or doing a simultaneous rotate and resize. This function should be used in conjunction with L_AnnDefine.

As an example, suppose you want to rotate and resize the rectangle around the anchor point aptAnchor by moving the point aptMove, as shown in the following figure:

This can be done by using only L_AnnDefine, but because L_AnnDefine takes integral arguments and aptAnchor and aptMove are not integral, the rotate and resize will not be exact.

To solve this and accurately perform simultaneous rotation and resizing, use L_AnnDefine2 and L_AnnDefine as follows:

ANNPOINT aptAnchor;
ANNPOINT aptMove;
aptMove.x = 10.2;
aptMove.y = 10.5
aptAnchor.x = 10.2;
aptAnchor.y = 50.5
ptLocation.x = 10;
ptLocation.y = 20;
L_AnnDefine2(hObject, &aptAnchor, ANNDEFINE_SETANCHORPOINT);
L_AnnDefine2(hObject, &aptMove, ANNDEFINE_BEGINROTATE);
// One or more ANNDEFINE_APPEND
L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_APPEND);
L_AnnDefine(pData->hObjectChange, &pMousePos->pt, ANNDEFINE_END);

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Types of Annotations
 | Annotation Objects - Default Values

Example

// 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 ExampleAnnDefine2(HANNOBJECT hRect)
{
// Counter for simulating user input
static int nCallCount = 0;
L_UINT uType;
ANNRECT arcRect;
ANNPOINT aptAnchor; // Anchor point in container coordinates
ANNPOINT aptMove; // Move point in container coordinates
POINT ptMove; // Move point in client coordinates
L_DOUBLE dAngle;
HANNOBJECT hContainer;

L_AnnGetType(hRect, &uType);
if (uType != ANNOBJECT_RECT)
{
MessageBox(NULL, TEXT("Object must be a rectangle."), TEXT("Error"), MB_OK);
return;
}

L_AnnGetRotateAngle(hRect, &dAngle);
if (dAngle != 0)
{
MessageBox(NULL, TEXT("Object must not be rotated."), TEXT("Error"), MB_OK);
return;
}
++nCallCount;
switch (nCallCount)
{
case 1:
L_AnnGetRect(hRect, &arcRect, NULL);
aptAnchor.x = (arcRect.left + arcRect.right) / 2;
aptAnchor.y = arcRect.bottom;

aptMove.x = (arcRect.left + arcRect.right) / 2;
aptMove.y = arcRect.top;

L_AnnDefine2(hRect, &aptAnchor, ANNDEFINE_SETANCHORPOINT);
L_AnnDefine2(hRect, &aptMove, ANNDEFINE_BEGINMOVEPOINT);
MessageBox(NULL, TEXT("Call ExampleAnnDefine2 to complete the rotate/resize."), TEXT(""), MB_OK);
break;

case 2:
L_AnnGetRect(hRect, &arcRect, NULL);
aptMove.x = arcRect.right;
aptMove.y = arcRect.top;

L_AnnGetTopContainer(hRect, &hContainer);
L_AnnConvert(hContainer, &ptMove, &aptMove, 1, ANNCONVERT_TO_CLIENT);

L_AnnDefine(hRect, &ptMove, ANNDEFINE_END);
nCallCount = 0;
MessageBox(NULL, TEXT("Rotate/resize finished!"), TEXT(""), MB_OK);
break;
}
return;
}


L_AnnDeletePage

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDeletePage(pszFile, nPage)

L_TCHAR L_FAR * pszFile; | /* file name */
L_INT32 nPage; | /* page to delete */

Deletes a page from an annotation file containing multiple pages.

Parameter | Description
pszFile | Character string containing the name of the annotation file.
nPage | 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.

Returns

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

Comments

This function can be used to remove annotation pages 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 function can be used for LEAD annotation files (ANNFMT_NATIVE, ANNFMT_ENCODED, or ANNFMT_XML). To determine the format for a particular LEAD annotation file, use L_AnnFileInfo.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnFileInfo.


L_AnnDeletePageMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDeletePageMemory(phMem, puMemSize, nPage)

HGLOBAL L_FAR phMem; | /* address of the memory handle */
L_UINT32 * puMemSize; | /* pointer to a variable */
L_INT32 nPage; | /* page to delete */

Deletes a page from a multi-page annotation file that is embedded in another file.

Parameter | Description
phMem | Address of a variable to be updated with the memory handle.
puMemSize | Pointer to a variable to be updated with the size of the file.
nPage | 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.

Returns

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

Comments

This function can be used to remove annotation pages from a multi-page annotation file that is stored in memory. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, and so on. This function can be used for LEAD annotation files (ANNFMT_NATIVE, ANNFMT_ENCODED, or ANNFMT_XML). To determine the format for a particular LEAD annotation file, use L_AnnFileInfoMemory.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageOffset, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnFileInfoMemory.


L_AnnDeletePageOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDeletePageOffset(fd, nOffset, nPage)

L_INT fd; | /* windows handle of the file */
L_INT32 nOffset; | /* position of the first byte */
L_INT32 nPage; | /* page to delete */

Deletes a page from a multi-page annotation file that is embedded in another file.

Parameter | Description
fd | Windows handle of the annotation file.
nOffset | Position of the first byte of the annotation file.
nPage | 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.

Returns

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

Comments

This function can be used to remove annotation pages from a multi-page annotation file that is embedded in another file. The page number is 1-based. Therefore, the first page is page 1, the second page is page 2, and so on. This function can be used for LEAD annotation files (ANNFMT_NATIVE, ANNFMT_ENCODED, or ANNFMT_XML). To determine the format for a particular LEAD annotation file, use L_AnnFileInfoOffset.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnFileInfoOffset.


L_AnnDeleteTextTokenTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDeleteTextTokenTable(hAutomation, cToken)

HANNOBJECT hAutomation; | /* handle of the automation object */
L_TCHAR cToken; | /* character representing the token to delete from the text token table */

Call this function to delete a text token from the annotation text token table. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle of the automation object.
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.

Returns

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

Comments

Call this function to delete the token #<cToken> from the text token table.

This function returns SUCCESS if cToken is successfully deleted, or if cToken was not already in the text token table. This function is used with the text annotation objects that support tokens, namely the following:

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnGetTextExpandTokens, L_AnnInsertTextTokenTable, L_AnnSetTextExpandTokens
Topics: | The Annotation Text Token Table
 | Annotation Functions (Document/Medical only): Text Properties

Example

// The predefined Text Token Table has 'Y' defined to be the four digit year
// This sample deletes this token from the token table
L_VOID SampleAnnDeleteTextTokenTable(HANNOBJECT hAutomation)
{
L_AnnDeleteTextTokenTable(hAutomation, 'Y');
}


L_AnnDeleteUserHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDeleteUserHandle(hObject, nIndex)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT32 nIndex; | /* index of the user handle to delete */

Deletes an existing user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object from which to delete the user handle.
nIndex | Index of the user-defined handle to delete. The index is zero based. Pass -1 to delete all user-defined handles. Passing a negative value other than –1 makes the function return ERROR_INV_PARAMETER.

Returns

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

Comments

Call this function to delete a user-defined handle from an annotation object.

Set uIndex to -1 to delete all the user-defined handles for annotation object hObject;

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Types of Annotations
 | Annotation Objects - Default Values

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(HANNOBJECT hObject)
{
L_UINT uCount;

// Get the total count of user handles
L_AnnGetUserHandles(hObject, NULL, &uCount);
if (uCount > 0)
L_AnnDeleteUserHandle(hObject, 0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


L_AnnDestroy

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDestroy(hObject, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFlags; | /* flags that determine which objects to process */

Deletes an annotation object and frees the memory that was used to store the object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_DELETE menu item has been selected.

Returns

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

Comments

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT, or during the ANNENUMCALLBACK callback function

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnCreateContainer,
 | L_AnnCreateItem, L_AnnDefine, L_AnnInsert,
 | L_AnnRemove, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

For complete sample code, refer to the ANNOTATE example.

/* This example destroys the objects within a container, but not the container */
void TestAnnDestroy(HANNOBJECT hAnnObject)
{
L_AnnDestroy(hAnnObject, ANNFLAG_NOTCONTAINER|ANNFLAG_RECURSE);
return;
}


L_AnnDraw

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnDraw(hDC, prcInvalid, hObject)

HDC hDC; | /* handle to the device context for display */
LPRECT prcInvalid; | /* pointer to the clipping rectangle */
HANNOBJECT hObject; | /* handle to the annotation object */

Displays the annotation object in the specified device context.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hDC | Handle to the device context where the annotation object is to be displayed.
prcInvalid | Pointer to the Windows RECT structure that specifies the display clipping rectangle. This can be the bounding rectangle of the annotation object, the root container, or the entire device context, or it could be smaller if only part of the object is to be displayed. Coordinates are relative to the device context.
hObject | Handle to the annotation object.

Returns

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

Comments

If the object is a container, the objects within the container are displayed in their enumeration order. You can use the L_AnnBringToFront and L_AnnSendToBack functions to change the enumeration order.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack,
 | L_AnnGetBoundingRect
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to Implementing a Non-automated Annotation Program or Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnEncryptApply

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnEncryptApply(hObject, uEncryptFlags, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uEncryptFlags; | /* flags that determine which objects to apply */
L_UINT uFlags; | /* flags that determine which objects to process */

Applies an encryptor annotation object to the underlying bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
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
 | ANNENCRYPTAPPLY_ENCRYPTOR | [0x001] Apply encryptor objects
 | ANNENCRYPTAPPLY_DECRYPTOR | [0x002] Apply decryptor objects
 | ANNAPPLYENCRYPT_BOTH | [0x003] Apply both encryptor and decryptor objects
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

An encrypt object can have two states: it can be an encryptor or it can be a decryptor.

Use this function 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 be encryptors). 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 L_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.

L_AnnEncryptApply calls L_ScrambleBitmap internally to shuffle the pixels. For more information, refer to L_ScrambleBitmap.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnGetPredefinedBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example takes a handle to an encrypt 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
L_VOID ExampleEncryptor(HANNOBJECT hObject)
{
L_UINT uObjectType;
ANNENCRYPTOPTIONS EncryptOptions;
L_INT nRet;

L_AnnGetType(hObject, &uObjectType);
if (uObjectType != ANNOBJECT_ENCRYPT)
{
MessageBox(NULL, TEXT("This object is not an encryptor"), TEXT("Error"), MB_OK);
return;
}

memset(&EncryptOptions, 0, sizeof(ANNENCRYPTOPTIONS));
EncryptOptions.uStructSize = sizeof(ANNENCRYPTOPTIONS);
EncryptOptions.uFlags = ANNENCRYPT_ALL;
L_AnnGetEncryptOptions(hObject, &EncryptOptions);

if (EncryptOptions.pEncryptBitmap == NULL)
{
MessageBox(NULL, TEXT("The encrypt object is not associated with a bitmap"), TEXT("Error"), MB_OK);
return;
}
if (EncryptOptions.bEncryptor == FALSE)
{
MessageBox(NULL, TEXT("This object is a decryptor"), TEXT("Error"), MB_OK);
return;
}

// Change the key to '123'
EncryptOptions.uKey = 123;
EncryptOptions.uFlags = ANNENCRYPT_KEY;
L_AnnSetEncryptOptions(hObject, &EncryptOptions, 0);

// Apply the encryptor
L_AnnEncryptApply(hObject, ANNENCRYPTAPPLY_ENCRYPTOR, 0);

nRet = MessageBox(NULL, TEXT("Encryptor has been applied. Would you like to remove the encryption?"), TEXT(""), MB_YESNO);
if (nRet == IDYES)
{
L_AnnEncryptApply(hObject, ANNENCRYPTAPPLY_DECRYPTOR, 0);
}
}


L_AnnEnumerate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnEnumerate(hObject, pfnCallback, pUserData, uFlags, pUserList)

HANNOBJECT hObject; | /* handle of the container object */
ANNENUMCALLBACK pfnCallback; | /* callback function for each object */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR, L_FAR *pUserList; | /* character string that contains the user list */

Lets you process all of the annotation objects in a container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the container object.
pfnCallback | Callback function for processing each enumerated object. Use the function pointer as the value of this parameter.
 | L_AnnEnumerate calls this callback function as it gets the handle of each annotation object. The callback function must adhere to the function prototype described in ANNENUMCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_NOTTHIS | [0x0004] Process only one level of objects within the specified container, not the container itself.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_USER | [] Process only those objects that have a user included in pUserList. If pUserList is NULL, process only those objects that do not have an associated user.
pUserList | Character string that contains the list of users associated with the specified object. pUserList 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 ANNFLAG_USER is set in uFlags.

Returns

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

Comments

You pass the handle of the container object in the hObject parameter, and you specify your callback function that is to process each object in the container. The L_AnnEnumerate function calls your callback function as it gets the handle of each annotation object.

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT, or during the ANNENUMCALLBACK callback function

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnInsert, L_AnnRemove, L_AnnGetContainer,
 | L_AnnGetTopContainer, L_AnnGetItem
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

/* This ANNENUMCALLBACK function updates a count of the number
of rectangles, ellipses, and polygons, as it processes each annotation object. */

L_INT L_EXPORT EXT_CALLBACK TestAnnCallback (HANNOBJECT hObject, L_INT L_FAR * pUserData)
{
L_UINT ObjectType; /* The type of annotation object */
L_INT ObjectCount; /* The number of objects */

/* Initialize the object count */
ObjectCount = (L_INT) *pUserData;

/* Get the current object type */
L_AnnGetType (hObject, &ObjectType);

/* Update the counter if the object is a rectangle, ellipse, or polygon */
if ((ObjectType == ANNOBJECT_RECT) ||
(ObjectType == ANNOBJECT_ELLIPSE) ||
(ObjectType == ANNOBJECT_POLYGON))
{
++ObjectCount;
}

/* Update the caller's variable */
*pUserData = ObjectCount;

return SUCCESS;
}

/* This example uses a callback function to count the number of rectangles, ellipses, and polygons. */

HANNOBJECT hContainer; /* Container annotation object */
HINSTANCE hInst; /* Current instance, set by the InitInstance function */

void TestAnnEnumerate(HWND hWnd)
{
L_TCHAR szMessage[80];
ANNENUMCALLBACK pfnCallback; /* Proc pointer for WIN16 compatibility */
L_INT ObjectCount; /* Counter for annotation objects */
L_INT L_FAR *pCount = &ObjectCount; /* Pointer to the object counter */

/* Set the callback function */
pfnCallback = (ANNENUMCALLBACK) MakeProcInstance(
(FARPROC) TestAnnCallback, hInst );

/* Initialize the object count */
ObjectCount = 0;

/* Process every object in the root container */
/* Refer to the callback function below to see how the count is updated */
L_AnnEnumerate(hContainer, pfnCallback, pCount, ANNFLAG_RECURSE, NULL);

/* Display a message box with the result */
wsprintf (szMessage, TEXT("%d rectangles, ellipses, and polygons"), ObjectCount);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);

/* Free the callback function */
FreeProcInstance((FARPROC) TestAnnCallback);

return;
}


L_AnnEnumerateHandles

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnEnumerateHandles(hObject, pfnCallback, *pUserData)

HANNOBJECT hObject; | /* handle to the annotation object */
ANNENUMCALLBACK pfnCallback; | /* callback function for each handle */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Calls the function pfnCallback for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfnCallback | Callback function for processing each enumerated object. Use the function pointer as the value of this parameter.
 | L_AnnEnumerateHandles calls this callback function for each handle (user-defined or default) for annotation object hObject. The callback function must adhere to the function prototype described in ANNENUMHANDLECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

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

Comments

Use this function to get information about all annotation handles for an annotation object.

Note that this function returns information about both default annotation handles and user-defined annotation handles.

This function can also be used to change some of the properties of an annotation handle.

For more information, refer to the ANNENUMHANDLECALLBACK function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example enumerates through all handles of an object,
// changing the predefined handles to blue squares
// and the user handles to red circles
L_INT L_EXPORT EXT_CALLBACK ColorNodesCallback(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo, L_VOID L_FAR * pUserData)
{
pHandleInfo->bVisible = TRUE;
if (pHandleInfo->nType == ANNHANDLETYPE_DEFAULT_HANDLE)
{
pHandleInfo->nShape = ANNHANDLE_SHAPE_SQUARE;
pHandleInfo->crFill = RGB(0,0,255);
}
else
{
pHandleInfo->nShape = ANNHANDLE_SHAPE_CIRCLE;
pHandleInfo->crFill = RGB(0,255,0);
}
return SUCCESS_CHANGE;
}

L_VOID ExampleAnnEnumerateHandles(HANNOBJECT hObject)
{
L_AnnEnumerateHandles(hObject, ColorNodesCallback, NULL);

}


L_AnnEnumerateTextTokenTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnEnumerateTextTokenTable(hAutomation, pfnCallback, pUserData)

HANNOBJECT hAutomation; | /* handle of the automation object */
ANNENUMTEXTTOKENTABLECALLBACK pfnCallback; | /* callback function for each entry in the text token table */
L_VOID * pUserData; | /* pointer to more parameters for the callback */

Lets you examine the contents of the annotation text token table. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle of the automation object.
pfnCallback | Callback function for processing each entry in the text token table. Use the function pointer as the value of this parameter.
 | L_AnnEnumerateTextTokenTable calls the pfnCallback callback function for each entry in the annotation text token table. The callback function must adhere to the function prototype described in the ANNENUMTEXTTOKENTABLECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

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

Comments

Use this function to examine the contents of the annotation text token table. This function is used with the text annotation objects that support tokens, namely the following:

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

The pfnCallback is called for each token. Note that the tokens cannot be changed with this function. To modify the text token table, use one of the following functions:

L_AnnInsertTextTokenTable

L_AnnDeleteTextTokenTable

L_AnnClearTextTokenTable

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnDeleteTextTokenTable, L_AnnGetTextExpandTokens, L_AnnInsertTextTokenTable, L_AnnSetTextExpandTokens, ANNENUMTEXTTOKENTABLECALLBACK
Topics: | The Annotation Text Token Table
 | Annotation Functions (Document/Medical only): Text Properties

Example

// This sample enumerates all of the tokens in the text token table,
// and displays the result
L_INT L_EXPORT EXT_CALLBACK annTextTokenTableCallback(L_INT nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken, L_VOID L_FAR * pUserData)
{
L_TCHAR *pszMsg;
L_TCHAR szTemp[100];
L_TCHAR *pszType;

pszMsg = (L_TCHAR *)pUserData;

if (nIndex == 0)
wsprintf(pszMsg, TEXT("Total Tokens: %d\n"), nTextTokenCount);
pszType = TEXT("Unknown");
switch(pTextToken->nTokenType)
{
case ANNTOKEN_NONE:
pszType = TEXT("ANNTOKEN_NONE");
break;

case ANNTOKEN_SEPARATOR:
pszType = TEXT("ANNTOKEN_SEPARATOR");
break;

case ANNTOKEN_TEXT:
pszType = TEXT("ANNTOKEN_TEXT");
break;

case ANNTOKEN_DATE_YYYY:
pszType = TEXT("ANNTOKEN_DATE_YYYY");
break;

case ANNTOKEN_DATE_YY:
pszType = TEXT("ANNTOKEN_DATE_YY");
break;

case ANNTOKEN_DATE_MM:
pszType = TEXT("ANNTOKEN_DATE_MM");
break;

case ANNTOKEN_DATE_DD:
pszType = TEXT("ANNTOKEN_DATE_DD");
break;

case ANNTOKEN_DATE_MONTH_NAME:
pszType = TEXT("ANNTOKEN_DATE_MONTH_NAME");
break;

case ANNTOKEN_DATE_DAY_OF_WEEK:
pszType = TEXT("ANNTOKEN_DATE_DAY_OF_WEEK");
break;

case ANNTOKEN_TIME_HH_12:
pszType = TEXT("ANNTOKEN_TIME_HH_12");
break;

case ANNTOKEN_TIME_HH_24:
pszType = TEXT("ANNTOKEN_TIME_HH_24");
break;

case ANNTOKEN_TIME_MM:
pszType = TEXT("ANNTOKEN_TIME_MM");
break;

case ANNTOKEN_TIME_SS:
pszType = TEXT("ANNTOKEN_TIME_SS");
break;

case ANNTOKEN_TIME_MILLISECONDS:
pszType = TEXT("ANNTOKEN_TIME_MILLISECONDS");
break;

case ANNTOKEN_AM_PM:
pszType = TEXT("ANNTOKEN_AM_PM");
break;
}

wsprintf(szTemp, TEXT("[%d]#%c\t%s\t%s\t%s\n"),
nIndex,
pTextToken->cToken ? pTextToken->cToken : ' ',
pTextToken->pszDesc ? pTextToken->pszDesc : TEXT(""),
pTextToken->pszTokenString ? pTextToken->pszTokenString : TEXT(""),
pszType);

lstrcat(pszMsg, szTemp);
return SUCCESS;
}

L_VOID SampleAnnEnumeratTextTokenTable(HANNOBJECT hAutomation)
{
L_TCHAR szMsg[1000];

lstrcpy(szMsg, TEXT(""));
L_AnnEnumerateTextTokenTable(hAutomation, annTextTokenTableCallback, szMsg);
MessageBox(NULL, szMsg, TEXT("Text Token Table"), MB_OK);
}


L_AnnFileInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnFileInfo(pszFile, pAnnFileInfo, uStructSize)

L_TCHAR L_FAR * pszFile; | /* input file name to query */
pANNFILEINFO pAnnFileInfo; | /* pointer to a structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pAnnFileInfo */

Gets information about the specified annotation file and fills the specified ANNFILEINFO structure with the information.

Parameter | Description
pszFile | Character string containing the name of the annotation input file.
pAnnFileInfo | Pointer to the ANNFILEINFO structure to be filled. For more information, refer to the ANNFILEINFO structure.
uStructSize | Size in bytes, of the structure pointed to by pAnnFileInfo, for versioning. Use sizeof(ANNFILEINFO).

Returns

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

Comments

This function can be used to find information about a LEAD annotation file.

To use this function, do the following:

1. | Declare a variable with the datatype of ANNFILEINFO.
2. | Fill in the nSize and nOffset fields of the ANNFILEINFO variable. The field nSize should contain the size of the ANNFILEINFO structure in bytes. The nOffset field should contain the byte location of the first byte of the annotation file.
3. | Declare and assign a character string variable for the annotation file name.
4. | Call the L_AnnFileInfo function, passing the file name and the address of the ANNFILEINFO variable as parameters.
5. | Get the image information from the fields described in the ANNFILEINFO structure.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

//This sample saves the annotation container as the first page of a multi-page annotation file
//The format is specified by the 'uFormat' parameter (either ANNFMT_NATIVE or ANNFMT_ENCODED)
//The container is flipped, and saved as the second page
//The container is 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
L_INT SampleAnnSave(L_TCHAR *pszFileName, L_INT32 uFormat, HANNOBJECT hContainer)
{
int nRet;
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMsg[200];
L_TCHAR *pszFormat;

//Save as the first page of the annotation file in memory
nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, NULL);
if (nRet != SUCCESS)
return nRet;

//Flip the container, and save as the second page (insert before page 2)
SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;

nRet = L_AnnFlip(hContainer, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;

nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Rotate the container, and save as the third page
nRet = L_AnnRotate(hContainer, 45.0, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;
SaveFileOption.PageNumber = 3;
nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
nRet = L_AnnFileInfo(pszFileName, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;

switch(AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
pszFormat = TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
pszFormat = TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
pszFormat = TEXT("ANNFMT_ENCODED");
break;

default:
pszFormat = TEXT("Unknown");
break;
}

wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

//Now delete the second page, and display information
nRet = L_AnnDeletePage(pszFileName, 2);
if (nRet != SUCCESS)
return nRet;

//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
nRet = L_AnnFileInfo(pszFileName, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;

wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

return nRet;
}


L_AnnFileInfoMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnFileInfoMemory(pMem, uMemSize, pAnnFileInfo, uStructSize)

L_UCHAR L_FAR * pMem; | /* pointer to the file location in memory */
L_UINT32 uMemSize; | /* file size, in bytes */
pANNFILEINFO pAnnFileInfo; | /* pointer to an ANNFILEINFO structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pAnnFileInfo */

Loads information about the annotation file located in memory into the specified ANNFILEINFO structure.

Parameter | Description
pMem | Pointer to the location in memory of the image file.
uMemSize | The size, in bytes, of the file referenced by pMem.
pAnnFileInfo | Pointer to the ANNFILEINFO structure to be filled with data from the image file.

Returns

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

Comments

This function can be used to get information about a LEAD annotation file that is stored in memory.

To use this function, do the following:

1. | Load the file into memory and assign variables for the file's location in memory and for the file size.
2. | Declare a variable with the datatype of ANNFILEINFO.
3. | Fill in the nSize and nOffset fields of the ANNFILEINFO variable. The field nSize should contain the size of the ANNFILEINFO structure in bytes. The nOffset field should contain the byte location of the first byte of the annotation file.
4. | Call the L_AnnFileInfoMemory function, passing the pointer to the file in memory, the address of the ANNFILEINFO variable, and the file size as parameters.
5. | Get the image information from the fields described in ANNFILEINFO structure.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnFileInfo, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

//This sample saves the annotation container as the first page of a multi-page annotation file in memory
//The format is specified by the 'uFormat' parameter (either ANNFMT_NATIVE or ANNFMT_ENCODED)
//The container is flipped, and saved as the second page
//The container is 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
L_INT SampleAnnSaveMemory(L_TCHAR *pszFileName, L_INT32 uFormat, HANNOBJECT hContainer)
{
int nRet;
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMsg[200];
L_TCHAR *pszFormat;
HGLOBAL hMem;
L_UINT32 uMemSize;
L_UCHAR *pMem;

hMem = NULL;

//Save as the first page of the annotation file in memory
nRet = L_AnnSaveMemory(hContainer, uFormat, FALSE, &hMem, &uMemSize, NULL);
if (nRet != SUCCESS)
return nRet;

//Flip the container, and save as the second page (insert before page 2)
SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;

nRet = L_AnnFlip(hContainer, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;

nRet = L_AnnSaveMemory(hContainer, uFormat, FALSE, &hMem, &uMemSize, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Rotate the container, and save as the third page
nRet = L_AnnRotate(hContainer, 45.0, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;
SaveFileOption.PageNumber = 3;
nRet = L_AnnSaveMemory(hContainer, uFormat, FALSE, &hMem, &uMemSize, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
pMem = (L_UCHAR *)GlobalLock(hMem);
nRet = L_AnnFileInfoMemory(pMem, uMemSize, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;

GlobalUnlock(hMem);

switch(AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
pszFormat = TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
pszFormat = TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
pszFormat = TEXT("ANNFMT_ENCODED");
break;

default:
pszFormat = TEXT("Unknown");
break;
}

wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

//Now delete the second page, and display informtion
nRet = L_AnnDeletePageMemory(hMem, &uMemSize, 2);
if (nRet != SUCCESS)
return nRet;

AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
pMem = (L_UCHAR *)GlobalLock(hMem);
nRet = L_AnnFileInfoMemory(pMem, uMemSize, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;
GlobalUnlock(hMem);

switch(AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
pszFormat = TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
pszFormat = TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
pszFormat = TEXT("ANNFMT_ENCODED");
break;

default:
pszFormat = TEXT("Unknown");
break;
}

wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

GlobalFree(hMem);

return nRet;
}


L_AnnFileInfoOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnFileInfoOffset(fd, pAnnFileInfo, uStructSize)

L_INT fd; | /* Windows file handle of the file to load */
pANNFILEINFO pAnnFileInfo; | /* pointer to a structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pAnnFileInfo */

Loads information about the annotation file embedded in another file, into the specified ANNFILEINFO structure. This function is available in the Document/Medical Toolkits.

Parameter | Description
fd | The Windows file handle of the file.
pAnnFileInfo | Pointer to the ANNFILEINFO structure to be updated with the annotation file information.
uStructSize | Size in bytes, of the structure pointed to by pAnnFileInfo, for versioning. Use sizeof(ANNFILEINFO).

Returns

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

Comments

This function can be used to get information about a LEAD annotation file that is embedded in another file.

To use this function, do the following:

1. | Open the annotation file to get a Windows file handle.
2. | Declare a variable with the datatype of ANNFILEINFO.
3. | Fill in the nSize and nOffset fields of the ANNFILEINFO variable. The field nSize should contain the size of the ANNFILEINFO structure in bytes. The nOffset field should contain the byte location of the first byte of the annotation file.
4. | Call the L_AnnFileInfoOffset function, passing the Windows file handle, and the address of the ANNFILEINFO variable as parameters.
5. | Get the image information from the fields described in ANNFILEINFO structure.

Required DLLs and Libraries

LTDIS

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnLoad, L_AnnLoadMemory, L_AnnLoadOffset, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

//This sample saves the annotation container as the first page of a multi-page annotation file
//The format is specified by the 'uFormat' parameter (either ANNFMT_NATIVE or ANNFMT_ENCODED)
//The file is saved starting at 30 bytes into the file
//The container is flipped, and saved as the second page
//The container is 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
L_INT SampleAnnSaveOffset(L_TCHAR *pszFileName, L_UINT32 uFormat, HANNOBJECT hContainer)
{
HFILE hFile;
int nRet;
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMsg[200];
L_TCHAR *pszFormat;
L_UINT32 uSizeWritten;
L_UINT32 uOffset = 30;

#ifdef UNICODE

hFile = _wcreat(pszFileName, 0);

#else

hFile = _lcreat(pszFileName, 0);

#endif

_lwrite(hFile, "This is a 29-character string", uOffset);

//Save as the first page of the annotation file
nRet = L_AnnSaveOffset(hFile, uOffset, &uSizeWritten, hContainer, uFormat, FALSE, NULL);
if (nRet != SUCCESS)
return nRet;

//Flip the container, and save as the second page (insert before page 2)
SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;

nRet = L_AnnFlip(hContainer, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;

nRet = L_AnnSaveOffset(hFile, uOffset, &uSizeWritten, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Rotate the container, and save as the third page
nRet = L_AnnRotate(hContainer, 45.0, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;
SaveFileOption.PageNumber = 3;
nRet = L_AnnSaveOffset(hFile, uOffset, &uSizeWritten, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;

//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = uOffset;
nRet = L_AnnFileInfoOffset(hFile, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;

switch(AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
pszFormat = TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
pszFormat = TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
pszFormat = TEXT("ANNFMT_ENCODED");
break;

default:
pszFormat = TEXT("Unknown");
break;
}

wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

//Now delete the second page, and display information
nRet = L_AnnDeletePageOffset(hFile, uOffset, 2);

AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
nRet = L_AnnFileInfoOffset(hFile, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;
wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);

MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);

_lclose(hFile);

return nRet;
}


L_AnnFlip

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnFlip(hObject, pCenter, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINT pCenter; | /* specifies the center of rotation */
L_UINT uFlags; | /* flags that determine which objects to process */

Flips one or more annotation objects, top to bottom.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pCenter | Pointer to the LEADTOOLS ANNPOINT structure that specifies the center of rotation.
 | Pass NULL in this parameter to use the default for each affected object. With the default, if a container is flipped, all objects in it are flipped as a unit, using the container's center as the axis. If an individual object is flipped, it is flipped on its own center.
 | The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
 | 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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

You cannot flip or reverse an object that contains text. If you flip or reverse a container that includes text, the text will move to the new position, but will retain its orientation.

L_AnnFlip does not change the bitmap of a Point annotation object. It only changes the position of the point. To change the bitmap you must get the bitmap using L_AnnGetBitmap, change the bitmap, and then set the bitmap using L_AnnSetBitmap.

The center of a protractor object is the angle point (vertex). The center of a cross-product is the intersection of the two rulers. If you pass NULL for pCenter, these center points will be used instead of the center of the bounding rectangle when flipping the object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRotate, L_AnnMove, L_AnnReverse,
 | L_AnnResize
Topics: | Annotation Functions: Doing Geometric Transformations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Flipping, Reversing and Rotating Annotation Objects

Example

/* This example flips an object on its own center. */
void TestAnnFlip(HANNOBJECT hAnnObject)
{
ANNPOINT RotationPt; /* Point of rotation */
ANNRECT ObjectRect; /* Defining rectangle of this object */
ANNRECT ObjectRectName;
/* Get the object's rectangle to use for calculating rotation */
L_AnnGetRect(hAnnObject, &ObjectRect, &ObjectRectName);
/* Specify the vertical point of rotation (the object's own center ) */
RotationPt.y = ObjectRect.top + ((ObjectRect.bottom - ObjectRect.top) / 2);
/* Flip the object */
L_AnnFlip(hAnnObject, &RotationPt, 0);
return;
}


L_AnnFreeToolBarButtons

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnFreeToolBarButtons(pButtons, uButtons)

pANNBUTTON pButtons; | /* array of buttons to include in the toolbar */
L_UINT uButtons; | /* number of buttons in the toolbar */

Frees the memory allocated by L_AnnGetToolBarButtons for the pButtons array. This function is available in the Document/Medical Toolkits.

Parameter | Description
pButtons | An array of ANNBUTTON structures that contain information about the buttons in the annotation toolbar.
uButtons | Number of buttons in the toolbar. (Number of entries in the pButtons array.)

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked,
 | L_AnnSetToolBarChecked,
 | L_AnnGetToolBarButtonVisible,
 | L_AnnSetToolBarButtonVisible,
 | L_AnnGetToolBarButtons, L_AnnSetToolBarButtons,
 | L_AnnGetToolBarInfo, L_AnnSetToolBarColumns,
 | L_AnnSetToolBarRows, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | New Annotation Features of Version 14.5

Example

#define ANNTOOL_USER2 0x0101
#include "windowsx.h"
void TestFunction2(HWND ToolbarWnd)
{
BITMAPHANDLE LBitmap;
L_UINT uButtons;
pANNBUTTON pButtons;
L_INT nRet;
L_UINT x;

L_LoadBitmap(TEXT("ATest.bmp"), &LBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, 0, NULL);
L_SizeBitmap(&LBitmap, TOOLBARIMAGECX, TOOLBARIMAGECY, 0);

/* get the number of buttons in the toolbar */
nRet = L_AnnGetToolBarButtons(ToolbarWnd, NULL, sizeof(ANNBUTTON), &uButtons);
if (nRet == SUCCESS)
{
/* allocate an array big enough to hold the number of existing buttons + 1 */
pButtons = (pANNBUTTON) GlobalAllocPtr(GMEM_MOVEABLE, (uButtons+1)*sizeof(ANNBUTTON));
if (pButtons)
{
/* get the existing buttons */
for(x=0;x<uButtons;x++)
{
pButtons[x].uStructSize = sizeof(ANNBUTTON);
pButtons[x].uBitmapStructSize = sizeof(BITMAPHANDLE);
}

nRet = L_AnnGetToolBarButtons(ToolbarWnd, pButtons, sizeof(ANNBUTTON), &uButtons);
if (nRet == SUCCESS)
{
/* add a new user defined tool button */
pButtons[uButtons].uFlags = 0;
pButtons[uButtons].uTool = ANNTOOL_USER2;
pButtons[uButtons].pBitmapUp = &LBitmap;
pButtons[uButtons].pBitmapDown = pButtons[uButtons].pBitmapUp;
pButtons[uButtons].nToolTipTextID = -1;
pButtons[uButtons].pToolTipText = TEXT("D Tool");

L_AnnSetToolBarButtons(ToolbarWnd, pButtons, uButtons+1);
L_FreeBitmap(&LBitmap);
/* free uButtons /
L_AnnFreeToolBarButtons(pButtons, uButtons);
/* free pButtons */
GlobalFreePtr(pButtons);
ShowWindow(ToolbarWnd, SW_SHOW);
}
else
MessageBox(NULL, TEXT("Error getting toolbar buttons."), TEXT(""), MB_OK);
}
else
MessageBox(NULL, TEXT("Not enough memory to allocate pButtons."), TEXT(""), MB_OK);
}
else
MessageBox(NULL, TEXT("Error getting uButtons."), TEXT(""), MB_OK);
}


L_AnnGetActiveState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetActiveState(hObject, puState)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puState; | /* address of the variable to be updated */

Gets the activation state of the specified object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puState | Address of the variable to be updated with the object's activation state constant. Possible activation state values are:
 | Value | Meaning
 | ANNACTIVE_DISABLED | [0] The object is disabled. It will not respond to activation events.
 | ANNACTIVE_ENABLED | [1] The object is enabled. It will respond to activation events.

Returns

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

Comments

The following types of objects respond to activation events:

Automation object

Audio clip

Button

Hot spot

Freehand Hot spot

Push pin

Video

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puState parameter. This function will update the variable with the annotation object's activation state constant.

Please note that Video objects can have an active state of ANNACTIVE_ENABLED only if the LEADTOOLS video DLL is present. ERROR_FEATURE_NOT_SUPPORTED is returned if the video DLL is missing.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetActiveState, L_AnnGetUserMode,
 | L_AnnSetUserMode
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetTag.


L_AnnGetAngle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAngle(hObject, pdAngle)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE, L_FAR * pdAngle; | /* address of a variable to be updated */

Gets the angle of the Protractor object in the object's unit of measurement, set by L_AnnSetProtractorOptions. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdAngle | Address of a variable to be updated with the angle of the protractor object specified in hObject.

Returns

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

Comments

This function is only valid for Protractor annotation objects (ANNOBJECT_PROTRACTOR).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetProtractorOptions,
 | L_AnnGetProtractorOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

void TestFunction2(void)
{
HANNOBJECT hContainer; /* Container annotation object */

ANNENUMCALLBACK annAngleCallback;
L_AnnEnumerate(hContainer, annAngleCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER, NULL);
}
L_INT EXT_CALLBACK annAngleCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_INT nRet;
L_DOUBLE dAngle;
L_UINT Type;
L_TCHAR Abbrev[80];
L_TCHAR cs[256];

nRet = L_AnnGetType(hObject, &Type);
if (nRet == SUCCESS)
{
switch (Type)
{
case ANNOBJECT_PROTRACTOR:
L_AnnGetAngle(hObject, &dAngle);
L_AnnGetProtractorOptions(hObject, NULL, NULL, NULL, Abbrev, NULL, NULL);
wsprintf(cs, TEXT("The angle is %f %s.\n"), dAngle, Abbrev);
MessageBox(NULL, cs, TEXT("Results"), MB_OK);
break;
default:
MessageBox(NULL, TEXT("This object is not a protractor."), TEXT(""), MB_OK);
}
}

return SUCCESS;
}


L_AnnGetArea

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetArea(hObject, puCount)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT32 L_FAR * puCount; | /* address of a variable to be updated */

Gets the pixel count of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object from which to get the pixel count.
puCount | Address of the variable to be updated with the pixel count.

Returns

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

Comments

The pixel count is the number of pixels contained in a region extracted from the annotation object, without resizing. It is equivalent to calling L_AnnGetRgnHandle with pRgnXForm set to NULL and then getting a pixel count of the resulting region.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetRgnHandle
Topics: | Annotation Functions: Object Information
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

void TestFunction2(void)
{
HANNOBJECT hContainer;
ANNENUMCALLBACK annEnumCallback;
L_AnnEnumerate(hContainer, annEnumCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL);
}

L_INT EXT_CALLBACK annEnumCallback(HANNOBJECT hObject, L_INT L_FAR * pUserData)
{
L_INT nRet;
L_UINT32 Count;
L_TCHAR cs[80];

nRet = L_AnnGetArea(hObject, &Count);
if (nRet == SUCCESS)
{
wsprintf(cs, TEXT("Pixel count = %ld\n"), Count);
MessageBox(NULL, cs, TEXT("Notice"), MB_OK);
}
else
{
wsprintf(cs, TEXT("Error # %d\n"), nRet);
MessageBox(NULL, cs, TEXT("Error"), MB_OK);
}
return SUCCESS;
}


L_AnnGetAutoBackColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoBackColor(hObject, uObjectType, pcrBack)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uObjectType; | /* object type */
COLORREF *pcrBack; | /* pointer to a variable to be updated */

Gets the background color of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uObjectType | Type of object for which to get the background color. For a list of possible values, refer to Types of Annotations.
pcrBack | Pointer to a COLORREF variable to be updated with the background color of the specified object type.

Returns

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

Comments

Please note the following:

if uObjectType is: | then the background color retrieved is:
ANNOBJECT_NOTE or ANNOBJECT_PUSHPIN | the background color used for Note objects and push pin objects created by the automation object
ANNOBJECT_HILITE | the background color used for Hilite objects created by the automation object.
ANNOBJECT_REDACT | the background color used for Redact objects created by the automation object.
any other object such as ANNOBJECT_TEXT, ANNOBJECT_RECT, etc. | the background color used for all other objects, created by the automation object, which have a background color property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoBackColor, L_AnnGetBackColor, L_AnnSetBackColor, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Changing the Annotation Automation Background Colors
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties
 | Using Color Values in LEADTOOLS

Example

// This example will rotate the colors through all the object types.
COLORREF crColor1, crColor2;
HANNOBJECT hAutomation;

L_AnnGetAutoBackColor(hAutomation, ANNOBJECT_NOTE, &crColor2);

L_AnnGetAutoBackColor(hAutomation, ANNOBJECT_HILITE, &crColor1);
L_AnnSetAutoBackColor(hAutomation, ANNOBJECT_NOTE, crColor1);

L_AnnGetAutoBackColor(hAutomation, ANNOBJECT_REDACT, &crColor1);
L_AnnSetAutoBackColor(hAutomation, ANNOBJECT_HILITE, crColor1);

L_AnnGetAutoBackColor(hAutomation, ANNOBJECT_TEXT, &crColor1);
L_AnnSetAutoBackColor(hAutomation, ANNOBJECT_REDACT, crColor1);

L_AnnSetAutoBackColor(hAutomation, ANNOBJECT_TEXT, crColor2);


L_AnnGetAutoContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoContainer(hObject, phContainer)

HANNOBJECT hObject; | /* handle to an annotation automation object */
HANNOBJECT L_FAR * phContainer; | /* address of the variable to be updated */

Gets the handle of the container for the automation object. The automation object is used to implement default properties. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an annotation automation object.
phContainer | Address of the HANNOBJECT variable to be updated with the handle of the automation object’s container. If the object does not have a container, the updated value is NULL.

Returns

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

Comments

The automation object is associated with a root container but is not in the container.

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phContainer parameter. This function will update the variable with the handle of the annotation object's container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnSetDpiX,
 | L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY,
 | L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode,
 | L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

/* This example gets the automation object’s container and assigns it to a global variable. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnAutoContainer(HANNOBJECT hAutoObject)
{
HANNOBJECT ThisContainer; /* Automation object's container */
L_INT nRet; /* Return value */
/* Get the automation object's container */
nRet = L_AnnGetAutoContainer(hAutoObject, &ThisContainer);
/* Assign the object to the global Container variable */
if (nRet == SUCCESS)
hContainer = ThisContainer;
else
MessageBox (NULL, TEXT("Automation object has no container"), TEXT("Error"), MB_OK);
return;
}


L_AnnGetAutoCursor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoCursor(hAutomation uItem, phCursor)

HANNOBJECT hAutomation; | /* handle to an automation object */
L_UINT uItem; | /* value that specifies the cursor */
HCURSOR *phCursor; | /* address of an HCURSOR variable */

Gets one of the cursors associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the annotation automation object.
uItem | Value that specifies the cursor to be displayed on various actions. Possible values are:
 | Value | Meaning
 | ANNAUTOCURSOR_DEFAULT | [0] Displayed when cursor is over the annotation container, and other action is occurring. The default is the windows predefined cursor IDC_ARROW.
 | ANNAUTOCURSOR_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).
 | ANNAUTOCURSOR_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:
 |  | ANNOBJECT_BUTTON
 |  | ANNOBJECT_HOTSPOT
 |  | ANNOBJECT_FREEHANDHOTSPOT
 |  | ANNOBJECT_AUDIO
 |  | ANNOBJECT_VIDEO
 |  | ANNOBJECT_PUSHPIN
 | ANNAUTOCURSOR_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).
 | ANNAUTOCURSOR_SELECT | [5] Displayed in design mode, when hovering over an unselected annotation. The default is the windows predefined cursor IDC_IBEAM.
 | ANNAUTOCURSOR_TEXT | [6] Displayed in design mode, when entering text into one of the following text annotations:
 |  | ANNOBJECT_TEXT
 |  | ANNOBJECT_TEXTPOINTER
 |  | ANNOBJECT_RTF
 |  | ANNOBJECT_NOTE
 | The default is the windows predefined cursor IDC_IBEAM.
 | ANNAUTOCURSOR_WAIT | [7] Displayed during any wait operation. The default is the windows predefined cursor IDC_WAIT.
 | ANNAUTOCURSOR_ROTATE_GRIPPER | [8] Displayed when hovering over a gripper rotate handle. The rotate handles are displayed only after calling L_AnnSetOptions.
 | ANNAUTOCURSOR_ROTATE_CENTER | [9] Displayed when hovering over rotate center handle. The rotate handles are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_ROTATE).
 | The following cursors are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_CURSORS).
 | ANNAUTOCURSOR_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 L_AnnSetOptions (hAutomation, OPTIONS_NEW_SIDE_HANDLES).
 | ANNAUTOCURSOR_SIZENESW | [11] Displayed when hovering over the North-east or South-west select handles in a rectangular object.
 | ANNAUTOCURSOR_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 L_AnnSetOptions (hAutomation, OPTIONS_NEW_SIDE_HANDLES).
 | ANNAUTOCURSOR_SIZENWSE | [13] Displayed when hovering over the North-west or South-east select handles in a rectangular object.
 | ANNAUTOCURSOR_SELECT_OUTLINE | [14] Displayed when doing a drag type select in automation mode.
 | The following cursors are displayed when the corresponding tool is active. For example, when the PolyLine tool is active in automation mode, the ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR will be shown.
 | ANNAUTOCURSOR_TOOL_LINE_CURSOR | [15] Displayed when the line tool is active.
 | ANNAUTOCURSOR_TOOL_RECT_CURSOR | [16] Displayed when the rectangle tool is active.
 | ANNAUTOCURSOR_TOOL_ELLIPSE_CURSOR | [17] Displayed when the ellipse tool is active.
 | ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR | [18] Displayed when the polyline tool is active.
 | ANNAUTOCURSOR_TOOL_POLYGON_CURSOR | [19] Displayed when the polygon tool is active.
 | ANNAUTOCURSOR_TOOL_POINTER_CURSOR | [20] Displayed when the pointer is active.
 | ANNAUTOCURSOR_TOOL_FREEHAND_CURSOR | [21] Displayed when the free hand is active.
 | ANNAUTOCURSOR_TOOL_HILITE_CURSOR | [22] Displayed when the highlight is active.
 | ANNAUTOCURSOR_TOOL_REDACT_CURSOR | [23] Displayed when the redact tool is active.
 | ANNAUTOCURSOR_TOOL_TEXT_CURSOR | [24] Displayed when the text tool is active.
 | ANNAUTOCURSOR_TOOL_NOTE_CURSOR | [25] Displayed when the note tool is active.
 | ANNAUTOCURSOR_TOOL_STAMP_CURSOR | [26] Displayed when the stamp tool is active.
 | ANNAUTOCURSOR_TOOL_BUTTON_CURSOR | [27] Displayed when the button tool is active.
 | ANNAUTOCURSOR_TOOL_HOTSPOT_CURSOR | [28] Displayed when the hotspot tool is active.
 | ANNAUTOCURSOR_TOOL_AUDIO_CURSOR | [29] Displayed when the audio tool is active.
 | ANNAUTOCURSOR_TOOL_RULER_CURSOR | [30] Displayed when the ruler tool is active.
 | ANNAUTOCURSOR_TOOL_CROSSPRODUCT_CURSOR | [31] Displayed when the cross product tool is active.
 | ANNAUTOCURSOR_TOOL_POINT_CURSOR | [32] Displayed when the point tool is active.
 | ANNAUTOCURSOR_TOOL_PROTRACTOR_CURSOR | [33] Displayed when the protractor tool is active.
 | ANNAUTOCURSOR_TOOL_VIDEO_CURSOR | [34] Displayed when the video tool is active.
 | ANNAUTOCURSOR_TOOL_PUSHPIN_CURSOR | [35] Displayed when the pushpin tool is active.
 | ANNAUTOCURSOR_TOOL_FREEHANDHOTSPOT_CURSOR | [36] Displayed when the freehand hotspot tool is active.
 | ANNAUTOCURSOR_TOOL_CURVE_CURSOR | [37] Displayed when the curve tool is active.
 | ANNAUTOCURSOR_TOOL_CURVECLOSED_CURSOR | [38] Displayed when the closed curve tool is active.
 | ANNAUTOCURSOR_TOOL_ENCRYPT_CURSOR | [39] Displayed when the encrypt tool is active.
 | ANNAUTOCURSOR_TOOL_TEXTPOINTER_CURSOR | [40] Displayed when the text pointer tool is active.
 | ANNAUTOCURSOR_TOOL_POLYRULER_CURSOR | [41] Displayed when the polyruler tool is active.
 | ANNAUTOCURSOR_TOOL_RTF_CURSOR | [42] Displayed when the RTF tool is active.
 | ANNAUTOCURSOR_TOOL_RUBBERSTAMP_CURSOR | [43] Displayed when the rubber stamp tool is active.
phCursor | Address of an HCURSOR variable to be updated with the requested annotation cursor.

Returns

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

Comments

Call this function to retrieve a copy of one of the annotation cursors. It is the caller’s responsibility to call DestroyCursor() on the retrieved cursor when finished using the cursor. To customize the annotation cursors, call L_AnnSetAutoCursor.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoCursor, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoHilightPen, L_AnnSetOptions, L_AnnGetOptions, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Annotation Functions (Document/Medical only): Automation Properties
 | Annotation Functions: Implementing Annotations
 | Annotation Functions: Displaying and Manipulating Annotation Objects
 | New Annotation Features of Version 14.5

Example

// This sample swaps the Default and Move annotation cursors
L_VOID SampleAnnGetCursors(HANNOBJECT hAutomation)
{
HCURSOR hCursorMove, hCursorDefault;

// Get copy of original cursors
L_AnnGetAutoCursor(hAutomation, ANNAUTOCURSOR_DEFAULT, &hCursorDefault);
L_AnnGetAutoCursor(hAutomation, ANNAUTOCURSOR_MOVE, &hCursorMove);

// Change
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_DEFAULT, hCursorMove);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_MOVE, hCursorDefault);

// Cleanup
DestroyCursor(hCursorMove);
DestroyCursor(hCursorDefault);
}


L_AnnGetAutoDialogFontSize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoDialogFontSize(hObject, pnFontSize)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_INT L_FAR * pnFontSize; | /* address of the variable to update */

Gets the size, in points, of the font used to display the automation dialog boxes. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an automation object.
pnFontSize | Address of the L_INT variable to be updated with the font size.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_INT. Then, pass the address of the variable in the pnFontSize parameter. This function will update the variable with the automation object's current font size.

To set the font size for an annotation automation object, use the L_AnnSetAutoDialogFontSize.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoDialogFontSize, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Converting Automation Dialogs to Other Languages
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnSetAutoDialogFontSize.


L_AnnGetAutoDrawEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoDrawEnable(hObject, pfEnable)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_BOOL L_FAR * pfEnable; | /* address of the variable to be updated */

Gets a value that indicates whether the left mouse button is enabled for automated drawing in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an automation object.
pfEnable | Address of the variable to be updated with the value that indicates whether the left mouse button is enabled for automated drawing in design mode. Possible values are:
 | Value | Meaning
 | TRUE | The left mouse button is enabled for automated drawing in design mode.
 | FALSE | The left mouse button is disabled for automated drawing in design mode.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfEnable parameter. This function will update the variable with the automation object's current drawing status.

For enabling or disabling the automated drawing, refer to L_AnnSetAutoDrawEnable.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoMenuEnable,
 | L_AnnGetAutoMenuEnable,
 | L_AnnSetAutoDrawEnable, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnSetAutoDrawEnable.


L_AnnGetAutoMenuEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoMenuEnable(hObject, pfEnable)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_BOOL L_FAR * pfEnable; | /* address of the variable to be updated */

Gets a value that indicates whether the automated menus for annotation are enabled. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an annotation automation object.
pfEnable | Address of the variable to be updated with a value indicating whether the annotation automated menus are enabled. Possible values are:
 | Value | Meaning
 | TRUE | Menus are enabled
 | FALSE | Menus are disabled.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then pass the address of the variable in the pfEnable parameter. This function will update the variable with the automation object's current menu status.

For enabling or disabling the menus, refer to L_AnnSetAutoMenuEnable.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoMenuEnable,
 | L_AnnSetAutoDrawEnable,
 | L_AnnGetAutoDrawEnable, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

Refer to L_AnnSetAutoMenuEnable.


L_AnnGetAutoMenuItemEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoMenuItemEnable(hObject, nObjectType, uItem, puEnable)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT nObjectType; | /* type of annotation object */
L_UINT uItem; | /* constant for the specified item */
L_UINT L_FAR * puEnable; | /* address of a variable to be updated */

Retrieves a value that indicates whether the specified menu item is enabled or disabled. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
nObjectType | 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.
uItem | 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 Video 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 Play Video Dialog Strings
 | Annotation Automation Stamp Metafile Dialog Strings
 | Annotation Automation ToolTip Dialog Strings
 | Annotation Automation Transparent Color Dialog Strings
 | Annotation Automation Capture Dialog Strings
puEnable | Address of a variable to be updated with a value that indicates whether the specified menu item has been enabled or disabled for the object. Possible values are:
 | Value | Meaning
 | ANNMENU_ENABLED | Enable the menu item.
 | ANNMENU_DISABLED | Disable the menu item.
 | ANNMENU_DEFAULT | Enable or disable the menu item, based on the setting for the object type.

Returns

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

Comments

If for the specified object, the menu item’s enable state is ANNMENU_DEFAULT, the function 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 ANNMENU_DEFAULT, the function determines whether the enable state has been set for ANNOBJECT_ALL. If this is also ANNMENU_DEFAULT, the function determines whether the menu item text is NULL or not NULL. If it is NULL, the function updates puEnable with ANNMENU_DISABLE. If the menu item is not NULL, the function updates puEnable with ANNMENU_ENABLE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoMenuItemEnable, L_AnnSetAutoText,
 | L_AnnGetAutoText, L_AnnGetAutoMenuState,
 | L_AnnSetAutoMenuState, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnSetAutoMenuItemEnable.


L_AnnGetAutoMenuState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoMenuState(hObject, nObjectType, pEnable, pEnableFlags, uBits)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT nObjectType; | /* type of annotation object */
L_UCHAR L_FAR * pEnable; | /* an array of bit flags */
L_UCHAR L_FAR * pEnableFlags; | /* an array of bit flags */
L_UINT uBits; | /* number of bits in pEnable and pEnableFlags */

Retrieves the automation menu state. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation object.

nObjectType

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.

pEnable

An array of bit flags that is updated with values that specify whether the corresponding menu item specified in pEnableFlags is enabled or disabled. The bits in the pEnable array are ordered just like the bits in the pEnableFlags array. Therefore, if pEnableFlags[0] & 0x40 == 1 is true, and pEnable[0] & 0x40 == 1 is also true, then the ANNAUTOTEXT_MENU_CUT menu item will be displayed, based on the values of hObject and uFlags.

pEnableFlags

An array of bit flags that is updated with values that indicate which menu items have been changed from their default behavior. The bits are ordered from most significant to least significant. Therefore, pEnableFlags[0] contains flags for menu items 0, 1, 2, 3, 4,5, 6, 7. This corresponds to ANNAUTOTEXT_MENU_UNDO,

ANNAUTOTEXT_MENU_CUT,

ANNAUTOTEXT_MENU_COPY,

ANNAUTOTEXT_MENU_PASTE,

ANNAUTOTEXT_MENU_DELETE,

ANNAUTOTEXT_MENU_SELECTALL,

ANNAUTOTEXT_MENU_BRINGTOFRONT, and

ANNAUTOTEXT_MENU_SENDTOBACK.

For example, if pEnableFlags[0] & 0x40 == 1 is true, the ANNAUTOTEXT_MENU_CUT menu item has been changed from its default behavior. To determine whether the menu item is enabled or disabled, check the corresponding bit flag in pEnable.

uBits

Number of bits in the pEnableFlags and pEnable arrays. The number of bytes pointed to by pEnable and pEnableFlags can be determined using the following equation: Bytes = (uBits + 7) / 8.

Returns

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

Comments

If a bit in the pEnableFlags array is set to 1, then the corresponding bit in the pEnable array determines whether the corresponding menu item will be displayed or not. If the corresponding bit in pEnable is one, the menu item will be displayed, provided the menu item string is not NULL. If the corresponding bit in pEnable is 0, the corresponding menu item will not be displayed.

If a bit in pEnableFlags is 0, the corresponding bit in pEnable is ignored, and the menu item is displayed or not displayed based on the default behavior.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoMenuState,
 | L_AnnGetAutoMenuItemEnable,
 | L_AnnSetAutoMenuItemEnable,
 | L_AnnSetAutoText, L_AnnGetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnSetAutoMenuState.


L_AnnGetAutoOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoOptions(hObject, puFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puFlags; | /* address of a variable to be updated */

Retrieves the last value set by L_AnnSetAutoOptions.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
puFlags | Address of a variable to be updated with the flag values set by L_AnnSetAutoOptions. Possible flag values are:
 | Value | Meaning
 | ANNAUTO_TABBEDDIALOG | Combine the dialog boxes that describe most of the object properties into one tabbed dialog box. Only dialog boxes that are not system dependent can be tabbed. The dialog boxes that are not tabbed are Font, Color, and File. If this flag is not set, the dialogs are displayed as in previous versions of LEADTOOLS.

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoOptions, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnSetAutoOptions.


L_AnnGetAutoSnapCursor

#include "l_bitmap.h"

EXT_FUNCTION L_AnnGetAutoSnapCursor(hAutomation, L_BOOL *pbSnap)

HANNOBJECT hAutomation; | /* handle to the automation annotation object */
L_BOOL *pbSnap; | /* pointer to a variable */

Gets the behavior of the cursor location when creating annotations using automation in design mode.

Parameter | Description
hAutomation | Handle to the automation annotation object.
pbSnap | Pointer to a variable to be updated with a value that indicates whether to restrict the cursor location during annotation creation 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.

Returns

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

Comments

This function gets 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoSnapCursor, L_AnnGetAutoCursor, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoCursor, L_AnnRestrictCursor, L_AnnGetRestrictToContainer, L_AnnSetRestrictToContainer, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoCursor, L_AnnRestrictCursor, L_AnnGetRestrictToContainer, L_AnnSetRestrictToContainer, L_AnnGetAutoBackColor, L_AnnGetAutoContainer, L_AnnGetAutoDialogFontSize, L_AnnGetAutoDrawEnable, L_AnnGetAutoMenuEnable, L_AnnGetAutoMenuItemEnable, L_AnnGetAutoMenuState, L_AnnGetAutoOptions, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnGetAutoUndoEnable, L_AnnSetAutoBackColor, L_AnnSetAutoContainer, L_AnnSetAutoDefaults, L_AnnSetAutoDialogFontSize, L_AnnSetAutoDrawEnable, L_AnnSetAutoMenuEnable, L_AnnSetAutoMenuItemEnable, L_AnnSetAutoMenuState, L_AnnSetAutoOptions, L_AnnSetAutoText, L_AnnSetAutoUndoEnable
Topics: | Displaying and Manipulating Annotation Objects
 | Altering Annotation Object Settings
 | Obtaining Annotation Object Information
 | Annotation Functions: Implementing Automation

Example

For an example, refer to L_AnnSetAutoSnapCursor.


L_AnnGetAutoText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoText(hObject, uItem, pText)

HANNOBJECT hObject; | /* annotation automation object */
L_UINT uItem; | /* constant for the specified item */
L_TCHAR L_FAR * pText; | /* pointer to the variable to be updated */

Gets the character string for a menu or dialog box item associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
uItem | 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 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 Video 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 Play Video 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 Dialog Strings
pText | Pointer to the buffer to be updated with the item's character string.

Returns

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

Comments

Before calling this function, call L_AnnGetAutoTextLen to get the length of the text you want to retrieve.

Use L_AnnSetAutoText to modify the automated menu item.

Before calling this function, you must declare a variable as a pointer to a character string. Then, pass the variable in the pText parameter. This function will update the variable with the automation item's character string.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoTextLen, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

/* This example adds " - New" to the current "&Undo" menu item. */
HANNOBJECT hAutoObject; /* Automation object */
void TestAnnAutoText(void)
{
L_TCHAR L_FAR * pText; /* The object’s text */
HGLOBAL hText; /* Handle for memory management */
L_UINT TextLength; /* Length of the object’s text */
/* Get the length of the current text */
L_AnnGetAutoTextLen(hAutoObject, ANNAUTOTEXT_MENU_UNDO, &TextLength);
/* Add six characters to the length for our new text */
TextLength = TextLength + 6;
/* Allocate and lock a zero-filled buffer for the text */
hText = GlobalAlloc(GPTR, TextLength * sizeof (L_TCHAR));
pText = (L_TCHAR L_FAR *)GlobalLock( hText );
/* Get the current text */
L_AnnGetAutoText(hAutoObject, ANNAUTOTEXT_MENU_UNDO, pText);
/* Add " - New" to the end of the current text */
lstrcat(pText, TEXT(" - New"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_MENU_UNDO, pText);
/* Free memory that we no longer need */
GlobalFree(hText);
return;
}


L_AnnGetAutoTextLen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoTextLen(hObject, uItem, puLen)

HANNOBJECT hObject; | /* automation object */
L_UINT uItem; | /* constant for the specified item */
L_UINT L_FAR * puLen; | /* pointer to the variable to be updated */

Gets the length of the current character string for a menu or dialog box item associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
uItem | 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 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 Video 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 Play Video 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 Dialog Strings
puLen | Pointer to unsigned integer variable that this function will update with the length of the item's current character string.

Returns

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

Comments

Once you know the length of the automated menu item, retrieve the text by calling L_AnnGetAutoText.

Use L_AnnSetAutoText to modify the text.

Before calling this function, you must declare an unsigned integer variable. Then, pass the address of the variable in the puLen parameter. This function will update the variable with the length of the automation item's character string.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoText, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnGetAutoText.


L_AnnGetAutoUndoEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetAutoUndoEnable(hObject, pbEnable);

HANNOBJECT hObject; | /* handle to the automation object */
L_BOOL L_FAR *pbEnable; | /* pointer to a variable to be updated */

Retrieves the state of the undo mechanism for an automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.
pbEnable | Pointer to a variable to be updated with a value that indicates whether the undo mechanism for the automation object is enabled or disabled.

Returns

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

Comments

To enable or disable a particular automation object, call L_AnnSetAutoUndoEnable.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnAddUndoNode, L_AnnSetAutoUndoEnable, L_AnnGetUndoDepth, L_AnnSetUndoDepth, L_AnnUndo, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Undoing Automation Operations
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Automation Properties

Example

For an example, refer to L_AnnGetAutoUndoEnable.


L_AnnGetBackColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBackColor(hObject, pcrBack)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF L_FAR * pcrBack; | /* address of the variable to be updated */

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pcrBack | Address of the COLORREF variable to be updated with the background color.

Returns

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

Comments

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

Before calling this function, you must declare a variable of data type COLORREF. Then, pass the address of the variable in the pcrBack parameter. This function will update the variable with the annotation object's background color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetForeColor, L_AnnGetForeColor,
 | L_AnnSetBackColor, L_AnnGetAutoBackColor, L_AnnSetAutoBackColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_AnnSetBackColor.


L_AnnGetBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBitmap(hObject, pBitmap, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
pBITMAPHANDLE pBitmap; | /* address of the variable to be updated */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Gets the bitmap handle of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pBitmap | Address of the variable to be updated with the handle to the annotation object's bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

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

Comments

The L_AnnGetBitmap function is valid only for the following object types:

ANNOBJECT_POINT

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

Only the Stamp object uses this property. The specified bitmap is a LEAD bitmap. For a description of the Stamp object, refer to Stamp Annotation Object.

Before calling this function, you must declare a variable of data type BITMAPHANDLE. Then, pass the address of the variable in the pBitmap parameter. This function will update the variable with the handle to the annotation object's bitmap.

The ANNOBJECT_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 ANNOBJECT_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 L_AnnGetPredefinedBitmap function to retrieve the bitmap displayed by the ANNOBJECT_POINT object, and the L_AnnSetPredefinedBitmap function to set the bitmap displayed by the ANNOBJECT_POINT object.

Call the L_AnnSetBitmap function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

Create a stamp object using the example for L_AnnSetBitmap, then call this function to retrieve the bitmap from the global stamp object and assign it to a local stamp object.

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT MyStamp;
void TestAnnGetBitmap(HWND hWnd)
{
HDC hWindowDC; /* Device context of the current window */
HANNOBJECT MyLocalStamp; /* Stamp annotation object */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT ContainerRectName;
ANNRECT MyLocalStampRect; /* Rectangle for the stamp object */
RECT rAnnBounds; /* Bounding rectangle used to draw the object */
RECT rAnnBoundsName;
BITMAPHANDLE TmpBitmap; /* Bitmap for the stamp */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);

/* Get the bitmap for the global MyStamp object. */
L_AnnGetBitmap(MyStamp, &TmpBitmap, sizeof(BITMAPHANDLE));

/* Get the container's rectangle */
L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
/* Create a local stamp annotation */
L_AnnCreateItem(hContainer, ANNOBJECT_STAMP, TRUE, &MyLocalStamp);
/* Size and position the stamp, adjusting the height to keep the bitmap's aspect ratio */
MyLocalStampRect.left = ContainerRect.right * 3/5;
MyLocalStampRect.top = ContainerRect.bottom / 2;
MyLocalStampRect.right = ContainerRect.right ;
MyLocalStampRect.bottom = MyLocalStampRect.top +
(((MyLocalStampRect.right - MyLocalStampRect.left) * BITMAPHEIGHT(&TmpBitmap)) / BITMAPWIDTH(&TmpBitmap));
L_AnnSetRect(MyLocalStamp,&MyLocalStampRect);
/* Assign the bitmap retrieved from the global stamp object to the local stamp object and free the temporary bitmap. */
L_AnnSetBitmap(MyLocalStamp, &TmpBitmap, 0);
L_FreeBitmap(&TmpBitmap);
/* Display the stamp */
L_AnnGetBoundingRect(MyLocalStamp, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hWindowDC, &rAnnBounds, MyLocalStamp);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return;
}


L_AnnGetBitmapDpiX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBitmapDpiX(hObject, pdDpiX)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR *pdDpiX; | /* address of the variable to be updated with the horizontal DPI value */

Gets the horizontal Bitmap DPI (dots per inch) that is used to translate the horizontal distance for the Ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdDpiX | Address of the variable to be updated with the current horizontal Bitmap DPI value.

Returns

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

Comments

The Bitmap DPI properties apply only to Automation and Ruler objects. Refer to Annotation Automation Object.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdDpiX parameter. This function will update the variable with the current Bitmap DPI setting.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnSetBitmapDpiY,
 | L_AnnGetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetBitmapDpiX.


L_AnnGetBitmapDpiY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBitmapDpiY(hObject, pdDpiY)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR *pdDpiY; | /* address of the variable to be updated with the vertical DPI value */

Gets the vertical Bitmap DPI (dots per inch) that is used to translate the vertical distance for the Ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdDpiY | Address of the variable to be updated with the current vertical Bitmap DPI value.

Returns

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

Comments

The Bitmap DPI properties apply only to Automation and Ruler objects. Refer to Annotation Automation Object.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdDpiY parameter. This function will update the variable with the current Bitmap DPI setting.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX,
 | L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit,
 | L_AnnGetDistance, L_AnnSetGaugeLength,
 | L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetBitmapDpiX.


L_AnnGetBoundingRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetBoundingRect(hObject, pRect, pRectName)

HANNOBJECT hObject; | /* handle to the annotation object */
LPRECT pRect; | /* address of the variable to be updated */
LPRECT pRectName; | /* address of the variable to be updated */

Gets the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRect | Address of the variable to be updated with the annotation object's bounding rectangle. Pass NULL if you do not wish to retrieve this information.
pRectName | Address of the variable to be updated with the bounding rectangle of the name of the annotation object. Pass NULL if you do not wish to retrieve this information.

Returns

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

Comments

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 L_AnnGetRect function.

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:

If the annotation object name is being displayed (see L_AnnSetNameOptions and L_AnnGetNameOptions for more information on annotation object names), it can appear far away from the annotation object itself. For this reason, a separate bounding rectangle for the annotation object name can be obtained by passing the address of a variable of data type RECT for the argument pRectName.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack,
 | L_AnnSetRect, L_AnnGetRect, L_AnnSetPoints, L_AnnGetPointCount, L_AnnGetPoints
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

//This example displays the bounding rectangle for an annotation object,
//and the bounding rectangle for the annotation object name
void SampleAnnGetBoundingRect(HANNOBJECT hObject )
{
RECT rcAnnObjectBounds;
RECT rcAnnNameBounds;
L_TCHAR szMsg[200];

L_AnnGetBoundingRect(hObject, &rcAnnObjectBounds, &rcAnnNameBounds);
wsprintf(szMsg, TEXT("L_AnnGetBoundingRect\n\tObject Bounds[%d, %d, %d, %d]\n\tName Bounds[%d,%d,%d,%d]"),
rcAnnObjectBounds.left, rcAnnObjectBounds.top, rcAnnObjectBounds.right, rcAnnObjectBounds.bottom,
rcAnnNameBounds.left, rcAnnNameBounds.top, rcAnnNameBounds.right, rcAnnNameBounds.bottom);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


L_AnnGetContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetContainer(hObject, phContainer)

HANNOBJECT hObject; | /* handle to the annotation object */
pHANNOBJECT phContainer; | /* address of the variable to be updated */

Gets the handle of the container of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
phContainer | Address of the HANNOBJECT variable to be updated with the handle of the container. If the object does not have a container, the updated value is NULL.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phContainer parameter. This function will update the variable with the handle of the annotation object's container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnInsert, L_AnnRemove, L_AnnGetTopContainer, L_AnnEnumerate, L_AnnGetItem
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects

Example

/* This example compares the immediate container to the root container */
void TestAnnGetContainer(HANNOBJECT hAnnObject)
{
HANNOBJECT ThisContainer; /* Container for this object */
HANNOBJECT TopContainer; /* Root container for the whole window */
/* Get both the immediate container and the root container */
L_AnnGetContainer(hAnnObject, &ThisContainer);
L_AnnGetTopContainer(hAnnObject, &TopContainer);
/* Compare the container handles */
if (ThisContainer == TopContainer)
MessageBox (NULL, TEXT("Top-level object"), TEXT("Notice"), MB_OK);
else
MessageBox (NULL, TEXT("Object in a sub-container"), TEXT("Notice"), MB_OK);
return;
}


L_AnnGetDistance

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetDistance(hObject, pdDistance, pdDistance2)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR *pdDistance; | /* address of the variable that will be updated with the distance of a ruler object */
L_DOUBLE L_FAR *pdDistance2; | /* address of the variable that will be updated with the distance of a ruler object */

Gets the distance of the Ruler object in the object's unit of measurement, set by L_AnnSetUnit. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdDistance | Address of the variable to be updated with the distance of the ruler object. For objects having only one ruler, this variable will be updated with the length. For cross products, which have two rulers, this variable will be updated with the length of the primary ruler.
pdDistance2 | Address of the variable to be updated with the distance of the ruler object. For cross products and protractors, which have two rulers, this variable will be updated with the length of the secondary ruler.

Comments

Either pdDistance or pdDistance2 can be NULL, but not both. If either of these pointers is NULL, the distance for that ruler will not be retrieved.

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnitLen, L_AnnGetUnit, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetUnit.


L_AnnGetDistance2

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetDistance2(hObject, puCount, pDistance, pTotalDistance, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT puCount; | /* address of variable to be updated */
pANNSMARTDISTANCE pDistance; | /* address of an array of ANNSMARTDISTANCE structures */
pANNSMARTDISTANCE pTotalDistance; | /* address of an ANNSMARTDISTANCE variable */
L_UINT uStructSize; | /* size of the structure initialize with sizeof(ANNSMARTDISTANCE) */

Gets the length of each ruler that makes up an object, and the total length of all rulers. It works for ANNOBJECT_RULER, ANNOBJECT_PROTRACTOR, ANNOBJECT_CROSSPRODUCT, and ANNOBJECT_POLYRULER annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puCount | Address of an unsigned integer to be updated with the total number of rulers that make up the object. This indicates the size of the pDistance array (number of total rulers).
pDistance | Pointer to array of ANNSMARTDISTANCE elements. You must allocate an array that is (*puCount) elements in length. Pass NULL if you do not want this information.
pTotalDistance | Address of an ANNSMARTDISTANCE variable. Returns the total length of all rulers that make up the annotation object. Pass NULL if you do not want this information.
uStructSize | Size of the ANNSMARTDISTANCE structure. Use sizeof(ANNSMARTDISTANCE).

Comments

This function works only for the following objects:

ANNOBJECT_RULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_POLYRULER

The ANNOBJECT_POLYRULER object is composed of a variable number of rulers. The other ruler objects are composed of a predetermined number of rulers, as follows:

ANNOBJECT_RULER always has one distance

ANNOBJECT_PROTRACTOR and ANNOBJECT_CROSSPRODUCT always have two distances

ANNOBJECT_POLYRULER can have from one to any number of distances

To use this function with the ANNOBJECT_POLYRULER, call it twice, as shown in the following code excerpt. For the first call, pass NULL for pDistance and pTotalDistance. This Returns the total number of rulers that make up the object. Allocate the appropriately sized array, and then call the function again.

L_UINT uCount;
pANNSMARTDISTANCE pDistance;
ANNSMARTDISTANCE TotalDistance;

L_AnnGetDistance2(hObject, &uCount, NULL, NULL, sizeof(ANNSMARTDISTANCE));
pDistance = (pANNSMARTDISTANCE)malloc(uCount * sizeof(ANNSMARTDISTANCE));
L_AnnGetDistance2(hObject, &uCount, pDistance, &TotalDistance, sizeof(ANNSMARTDISTANCE));

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnSetUnit, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Annotation Functions (Document/Medical only): Ruler Properties
 | Annotation Functions (Document/Medical only): Protractor Properties
 | Annotation Functions (Document/Medical only): Polyruler Properties
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This sample calls L_AnnDistance2 on the object
// It displays the number of rulers and the length of each ruler

L_TCHAR *annGetObjectString(L_UINT uObjectType)
{
L_TCHAR *pszType = TEXT("Unknown");
switch(uObjectType)
{
case ANNOBJECT_CONTAINER:
pszType = TEXT("ANNOBJECT_CONTAINER");
break;

case ANNOBJECT_POINTER:
pszType = TEXT("ANNOBJECT_POINTER");
break;

case ANNOBJECT_AUDIO:
pszType = TEXT("ANNOBJECT_AUDIO");
break;

case ANNOBJECT_BUTTON:
pszType = TEXT("ANNOBJECT_BUTTON");
break;

case ANNOBJECT_ELLIPSE:
pszType = TEXT("ANNOBJECT_ELLIPSE");
break;

case ANNOBJECT_FREEHAND:
pszType = TEXT("ANNOBJECT_FREEHAND");
break;

case ANNOBJECT_HILITE:
pszType = TEXT("ANNOBJECT_HILITE");
break;

case ANNOBJECT_HOTSPOT:
pszType = TEXT("ANNOBJECT_HOTSPOT");
break;

case ANNOBJECT_LINE:
pszType = TEXT("ANNOBJECT_LINE");
break;

case ANNOBJECT_NOTE:
pszType = TEXT("ANNOBJECT_NOTE");
break;

case ANNOBJECT_POLYGON:
pszType = TEXT("ANNOBJECT_POLYGON");
break;

case ANNOBJECT_POLYLINE:
pszType = TEXT("ANNOBJECT_POLYLINE");
break;

case ANNOBJECT_RECT:
pszType = TEXT("ANNOBJECT_RECT");
break;

case ANNOBJECT_REDACT:
pszType = TEXT("ANNOBJECT_REDACT");
break;

case ANNOBJECT_STAMP:
pszType = TEXT("ANNOBJECT_STAMP");
break;

case ANNOBJECT_TEXT:
pszType = TEXT("ANNOBJECT_TEXT");
break;

case ANNOBJECT_AUTOMATION:
pszType = TEXT("ANNOBJECT_AUTOMATION");
break;

case ANNOBJECT_RULER:
pszType = TEXT("ANNOBJECT_RULER");
break;

case ANNOBJECT_CROSSPRODUCT:
pszType = TEXT("ANNOBJECT_CROSSPRODUCT");
break;

case ANNOBJECT_POINT:
pszType = TEXT("ANNOBJECT_POINT");
break;

case ANNOBJECT_PROTRACTOR:
pszType = TEXT("ANNOBJECT_PROTRACTOR");
break;

case ANNOBJECT_VIDEO:
pszType = TEXT("ANNOBJECT_VIDEO");
break;

case ANNOBJECT_PUSHPIN:
pszType = TEXT("ANNOBJECT_PUSHPIN");
break;

case ANNOBJECT_FREEHANDHOTSPOT:
pszType = TEXT("ANNOBJECT_FREEHANDHOTSPOT");
break;

case ANNOBJECT_CURVE:
pszType = TEXT("ANNOBJECT_CURVE");
break;

case ANNOBJECT_CURVECLOSED:
pszType = TEXT("ANNOBJECT_CURVECLOSED");
break;

case ANNOBJECT_ENCRYPT:
pszType = TEXT("ANNOBJECT_ENCRYPT");
break;

case ANNOBJECT_TEXTPOINTER:
pszType = TEXT("ANNOBJECT_TEXTPOINTER");
break;

case ANNOBJECT_POLYRULER:
pszType = TEXT("ANNOBJECT_POLYRULER");
break;
}
return pszType;
}

L_TCHAR *annGetRulerUnitString(L_UINT uRulerUnit)
{
L_TCHAR *pszRulerUnit = TEXT("Unknown");

switch(uRulerUnit)
{
case ANNUNIT_INCHES:
pszRulerUnit = TEXT("ANNUNIT_INCHES");
break;

case ANNUNIT_FEET:
pszRulerUnit = TEXT("ANNUNIT_FEET");
break;

case ANNUNIT_YARDS:
pszRulerUnit = TEXT("ANNUNIT_YARDS");
break;

case ANNUNIT_MICROMETERS:
pszRulerUnit = TEXT("ANNUNIT_MICROMETERS");
break;

case ANNUNIT_MILLIMETERS:
pszRulerUnit = TEXT("ANNUNIT_MILLIMETERS");
break;

case ANNUNIT_CENTIMETERS:
pszRulerUnit = TEXT("ANNUNIT_CENTIMETERS");
break;

case ANNUNIT_METERS:
pszRulerUnit = TEXT("ANNUNIT_METERS");
break;

case ANNUNIT_TWIPS:
pszRulerUnit = TEXT("ANNUNIT_TWIPS");
break;

case ANNUNIT_POINTS:
pszRulerUnit = TEXT("ANNUNIT_POINTS");
break;

case ANNUNIT_PIXELS:
pszRulerUnit = TEXT("ANNUNIT_PIXELS");
break;

case ANNUNIT_SMART_METRIC:
pszRulerUnit = TEXT("ANNUNIT_SMART_METRIC");
break;

case ANNUNIT_SMART_ENGLISH:
pszRulerUnit = TEXT("ANNUNIT_SMART_ENGLISH");
break;
}
return pszRulerUnit;
}

// Formats a string with smart distance information
// uLength is the length of the input string
L_VOID annDumpSmartDistance(ANNSMARTDISTANCE sdSmartDistance, L_TCHAR *pszSmartDistance, L_UINT *puLength)
{
L_TCHAR *pszRulerUnit;
L_TCHAR *pszSmartUnit;
L_TCHAR szMsg[200];
L_UINT uLength;

pszRulerUnit = annGetRulerUnitString(sdSmartDistance.uRulerUnit);
pszSmartUnit = annGetRulerUnitString(sdSmartDistance.uSmartUnit);

wsprintf(szMsg, TEXT("[%-10f] uRulerUnit[%-15s] uSmartUnit[%-15s]\n"),
sdSmartDistance.dDistance,
pszRulerUnit,
pszSmartUnit);

uLength = lstrlen(szMsg) * sizeof (L_TCHAR);

if (pszSmartDistance)
{
lstrcpy(pszSmartDistance, szMsg);
}

if (puLength)
{
*puLength = uLength;
}
}

L_VOID SampleAnnGetDistance(HANNOBJECT hObject)
{
L_UINT uCount;
L_TCHAR *pszObject;
L_UINT uType;
L_INT nRet;
L_TCHAR szMsg[500];
ANNSMARTDISTANCE sdTotalDistance;
pANNSMARTDISTANCE pDistance = NULL;

L_AnnGetType(hObject, &uType);
pszObject = annGetObjectString(uType);
nRet= L_AnnGetDistance2(hObject, &uCount, NULL, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("L_AnnGetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}
// We know the number of rulers
pDistance = malloc(uCount * sizeof(ANNSMARTDISTANCE));
if (!pDistance)
MessageBox(NULL, TEXT("Not enough memory"), TEXT("Error"), MB_OK);

nRet = L_AnnGetDistance2(hObject, &uCount, pDistance, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("L_AnnGetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}

free(pDistance);
}


L_AnnGetDpiX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetDpiX(hObject, pdDpiX)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR * pdDpiX; | /* address of the variable to be updated */

Gets the current horizontal DPI (dots per inch) value that is used to translate user input, such as font size, that is expressed in physical measurements. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdDpiX | Address of the variable to be updated with the current DPI value.

Returns

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

Comments

The DPI properties apply only to the annotation automation object. Refer to Annotation Automation Object.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdDpiX parameter. This function will update the variable with the current DPI setting.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This function gets the current dots per inch of the automation object */
HANNOBJECT hAutoObject; /* Automation object */
void TestAnnDpi(void)
{
L_DOUBLE DPIx, DPIy; /* Dots per inch, horizontal and vertical */
L_TCHAR szMessage[80]; /* Message buffer */
/* Get the dots per inch */
L_AnnGetDpiX(hAutoObject, &DPIx);
L_AnnGetDpiY(hAutoObject, &DPIy);
/* Display a message box with the result */
wsprintf (szMessage, TEXT("%d horizontal, %d vertical"), (int)DPIx, (int)DPIy);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
return;
}


L_AnnGetDpiY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetDpiY(hObject, pdDpiY)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR * pdDpiY; | /* address of the variable to be updated */

Gets the current vertical DPI (dots per inch) value that is used to translate user input, such as font size, that is expressed in physical measurements. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdDpiY | Address of the variable to be updated with the current DPI value.

Returns

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

Comments

The DPI properties apply only to the annotation automation object. Refer to Annotation Automation Object.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdDpiY parameter. This function will update the variable with the current DPI setting.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetDpiX.


L_AnnGetEncryptOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetEncryptOptions(hObject, pEncryptOptions)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNENCRYPTOPTIONS pEncryptOptions; | /* pointer to a structure that specifies various encryption options */

Gets the options for the specified Encrypt annotation object. This annotation object may be in the encryptor or decryptor state. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pEncryptOptions | Pointer to an ANNENCRYPTOPTIONS structure to be updated with the encryption options for the specified encrypt object.

Returns

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

Comments

Use this function to get the encrypt options of an encrypt object. To use this function, declare a variable a type ANNENCRYPTOPTIONS, and pass the address of this variable as the second argument.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetPredefinedBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Encryption and Decrytion Annotation Objects
 | Annotation Functions (Document/Medical only): Getting and Setting Encrypt Properties

Example

For an example, refer to L_AnnEncryptApply.


L_AnnGetFillMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFillMode(hObject, puFillMode)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puFillMode; | /* address of the variable to be updated */

Gets the fill mode of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puFillMode | Address of the variable to be updated with the object's fill mode constant. Possible fill mode values are:
Value | Meaning
ANNMODE_TRANSPARENT | [0] Transparent
ANNMODE_TRANSLUCENT | [1] Translucent
ANNMODE_OPAQUE | [2] Opaque

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puFillMode parameter. This function will update the variable with the annotation object's fill mode constant.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnSetFillMode, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetROP2, L_AnnSetROP2, L_AnnSetBackColor, L_AnnSetForeColor, L_AnnGetSelected, L_AnnSetSelected, L_AnnGetTransparent, L_AnnSetTransparent, L_AnnGetTransparentColor, L_AnnSetTransparentColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFillMode.


L_AnnGetFillModeExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFillModeExt(hObject, puFillMode, pnAlpha)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puFillMode; | /* pointer to a variable to be updated with the fill mode */
L_INT L_FAR * pnAlpha; | /* pointer to a variable to be updated with the alpha value */

Gets the fill mode and alpha of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puFillMode | Pointer to a variable to be updated with the object's fill mode constant. Possible fill mode values are:
 | Value | Meaning
 | ANNMODE_TRANSPARENT | [0] Transparent.
 | ANNMODE_TRANSLUCENT | [1] Translucent.
 | ANNMODE_OPAQUE | [2] Opaque.
 | ANNMODE_ALPHA | [3] Alpha.

pnAlpha | Pointer to a variable to be updated with the object’s alpha value. This is only valid if the fill mode puFillMode is updated with is ANNMODE_ALPHA. Possible values range from 0 – 255 where:
 | Value | Meaning
 | 0 | Transparent background
 | 255 | Opaque background.

Returns

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

Comments

Like L_AnnGetFillMode, you can use this function to get the fill mode settings for annotation objects. This function extends the L_AnnGetFillMode function to support the new fill mode ANNMODE_ALPHA.

Before calling L_AnnGetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions( hAutomation);
L_AnnSetOptions( hAutomation, uOptions | OPTIONS_NEW_ALPHA);
}

The following figure displays rectangle annotation objects using different alpha values:

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puFillMode parameter. This function will update the variable with the annotation object's fill mode constant. If the returned fill mode is ANNMODE_ALPHA, then there is also a corresponding alpha value (0..255). To get the alpha value, declare a variable of type L_INT and pass the address for the puAlpha value. If you do not want the alpha value, pass NULL for the puAlpha value. Note that if the returned fill mode is anything other than ANNMODE_ALPHA, then there is no corresponding alpha value.

The ANNMODE_ALPHA parameter 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 L_AnnSetROP2 function and the L_AnnSetFillModeExt function affect each other. If you set uFillMode to ANNFILLMODE_OPAQUE, then uROP2 cannot be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSLUCENT, then uROP2 has to be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSPARENT, uROP2 can be anything.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillMode, L_AnnGetFillMode, L_AnnSetFillModeExt, L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetROP2, L_AnnSetROP2, L_AnnSetBackColor, L_AnnSetForeColor, L_AnnSetOptions, L_AnnGetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Obtaining Annotation Object Information
 | Altering Annotation Object Settings
 | Illustration of Fill Options for Annotations
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Container Annotation Object
 | Annotation Automation Object
 | Annotation Functions (Document/Medical only): Getting and Setting Color Properties
 | Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Example

For an example, refer to L_AnnSetFillModeExt.


L_AnnGetFillPattern

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFillPattern(hObject, puFillPattern)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puFillPattern; | /* address of the variable to be updated */

Gets the fill pattern of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puFillPattern | Address of the variable to be updated with the object's fill pattern constant. Possible fill pattern values are:
 | Value | Meaning
 | ANNPATTERN_SOLID | [0] Solid
 | ANNPATTERN_BDIAGONAL | [1] Backward diagonal
 | ANNPATTERN_CROSS | [2] Cross
 | ANNPATTERN_DIAGCROSS | [3] Diagonal cross
 | ANNPATTERN_FDIAGONAL | [4] Forward diagonal
 | ANNPATTERN_HORIZONTAL | [5] Horizontal
 | ANNPATTERN_VERTICAL | [6] Vertical

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puFillPattern parameter. This function will update the variable with the annotation object's fill pattern constant.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillPattern, L_AnnSetFillMode, L_AnnGetFillMode, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFillPattern.


L_AnnGetFixed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFixed(hObject, pbFixed)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL *pbFixed; | /* address of a variable to be updated */

Gets a value that indicates whether the annotation is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object
pbFixed | Address of the variable to be updated with a value that indicates whether the annotation is fixed. Possible values are:
 | Value | Meaning
 | TRUE | The annotation object is fixed.
 | FALSE | The annotation object is not fixed.

Returns

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

Comments

A fixed annotation does not move or change size when the annotation container's scalars and offsets are changed. The effect is that the annotation does not move or change size when the underlying image is scrolled or zoomed.

The following annotations cannot be fixed:

ANNOBJECT_CONTAINER

ANNOBJECT_REDACT

ANNOBJECT_ENCRYPT

For more information, refer to Fixed Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnIsFixedInRect, L_AnnPopFixedState, L_AnnPushFixedState, L_AnnSetFixed
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Example

For an example, refer to L_AnnSetFixed.


L_AnnGetFontBold

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontBold(hObject, pfFontBold)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfFontBold; | /* address of the variable to be updated */

Gets a value that indicates whether the font of the specified annotation object is bold. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfFontBold | Address of the variable to be updated with the value indicating whether the font is bold. Possible values are:
 | Value | Meaning
 | TRUE | The font is bold
 | FALSE | The font is not bold.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfFontBold parameter. This function will update the variable with the annotation object's current value of the bold font property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontBold, L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontBold.


L_AnnGetFontItalic

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontItalic(hObject, pfFontItalic)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfFontItalic; | /* address of the variable to be updated */

Gets a value that indicates whether the font of the specified annotation object is italic. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfFontItalic | Address of the variable to be updated with the value indicating whether the font is italic. Possible values are:
 | Value | Meaning
 | TRUE | The font is italic
 | FALSE | The font is not italic.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfFontItalic parameter. This function will update the variable with the annotation object's current value of the italic font property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontItalic.


L_AnnGetFontName

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontName(hObject, pFontName)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pFontName; | /* pointer to the variable to be updated */

Gets the font name (character string) for the text in the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pFontName | Pointer to a character string to be updated with the name of the font used by the annotation object.

Returns

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

Comments

Before calling this function, you must declare a variable as a pointer to a character string. Then use the L_AnnGetFontNameLen function to get the length of the string. Next, pass the variable in the pFontName parameter. This function will update the variable with the name of the font used by the annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontName.


L_AnnGetFontNameLen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontNameLen(hObject, puLen)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puLen; | /* address of the variable to be updated */

Gets the length of the character string that holds the font name of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puLen | Address of the variable to be updated with the string length of the annotation object's font name.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puLen parameter. This function will update the variable with the string length of the annotation object's font name.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontName.

For complete annotation code, refer to the Annotate example.


L_AnnGetFontSize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontSize(hObject, pdFontSize)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdFontSize; | /* address of the variable to be updated */

Gets the current unscaled value of the font size of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdFontSize | Address of the variable to be updated with the current unscaled font size of the annotation object.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdFontSize parameter. This function will update the variable with the font size of the annotation object.

The font size is scaled using the scaling factors of the container object. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontSize.


L_AnnGetFontStrikeThrough

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontStrikeThrough(hObject, pfFontStrikeThrough)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfFontStrikeThrough; | /* address of the variable to be updated */

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). This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfFontStrikeThrough | Address of the variable to be updated with the 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.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfFontStrikeThrough parameter. This function will update the variable with the annotation object's current value of the strike-through property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontStrikeThrough.


L_AnnGetFontUnderline

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetFontUnderline(hObject, pfFontUnderline)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfFontUnderline; | /* address of the variable to be updated */

Gets a value that indicates whether the font of the specified annotation object has an underline. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfFontUnderline | Address of the variable to be updated with the 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.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfFontUnderline parameter. This function will update the variable with the annotation object's current value of the underline property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetFontUnderline.


L_AnnGetForeColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetForeColor(hObject, pcrFore)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF HWND L_FAR * pcrFore; | /* address of the variable to be updated */

Gets the current value of the specified annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pcrFore | Address of the COLORREF variable to be updated with the annotation object's current foreground color.

Returns

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

Comments

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

Before calling this function, you must declare a variable of data type COLORREF. Then, pass the address of the variable in the pcrFore parameter. This function will update the variable with the annotation object's current foreground color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetForeColor, L_AnnSetBackColor, L_AnnGetBackColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_AnnSetForeColor.


L_AnnGetGaugeLength

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetGaugeLength(hObject, pdLength)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR *pdLength; | /* address of the variable to be updated */

Gets the length of the gauge (the perpendicular lines at the ends of the Ruler object). This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdLength | Address of the variable to be updated with the object's gauge length.

Returns

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

Comments

The gauge length applies only to Automation and Ruler objects. Refer to Annotation Automation Object.

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetGaugeLength, L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetGaugeLength.


L_AnnGetGrouping

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetGrouping(hObject, pbAutoGroup)

HANNOBJECT hObject; | /* handle to the container object */
L_BOOL L_FAR *pbAutoGroup; | /* flags that indicates how objects are grouped */

Gets the grouping property of the objects within the specified container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the container object.
pbAutoGroup | Pointer to a variable to be updated with a value that indicates whether or not the objects within the specified container are grouped. Possible values are:
Value | Meaning
TRUE | All objects within the container are treated as a group.
FALSE | Each object within the container can be selected and modified independently.

Returns

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

Comments

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetGrouping, L_AnnGroup, L_AnnUngroup
Topics: | Grouping and Ungrouping Annotation Objects
 | Obtaining Annotation Object Information

Example

// this example will toggle grouping for a particular sub-container.
// the parameter for this function should be a sub-container
void ToggleGrouping(HANNOBJECT hContainer)
{
L_BOOL bGrouping;
L_AnnGetGrouping(hContainer, &bGrouping);
L_AnnSetGrouping(hContainer, !bGrouping, 0);
}


L_AnnGetHyperlink

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetHyperlink(hObject, puType, puMsg, pwParam, pLink)

HANNOBJECT hObject; | /* handle of the annotation object */
L_UINT L_FAR * puType; | /* address of the variable to be updated with the hyperlink type */
L_UINT L_FAR * puMsg; | /* address of the variable to be updated with the user defined message */
WPARAM L_FAR * pwParam; | /* address of the variable to be updated with the value of wParam */
L_TCHAR L_FAR * pLink; | /* Character string containing the hyperlink string */

Gets the hyperlink information of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object.
puType | Address of the variable to be updated with the value indicating the hyperlink type. Possible hyperlink types are:
 | Value | Meaning
 | ANNLINK_NONE | [0x0000] Object has no hyperlink.
 | ANNLINK_LTANNEVENT | [0x0001] WM_LTANNEVENT message will be sent with LTANNEVENT_HYPERLINK
 | ANNLINK_USERMSG | [0x0002] The user defined message will be sent with wParam as the wParam message of this function and lParam containing the handle of the object.
 | ANNLINK_RUN | [0x0003] The program specified in pLink will be run. Both the program and the command line parameters have to be specified in pLink.
 | ANNLINK_WEBPAGE | [0x0004] The web page with the URL specified in pLink will be opened in the current browser. Note that not all web browsers accept a page on the command line. Some will simply go to their default home page.
puMsg | Address of the variable to be updated with the value of the user defined message. This parameter is only valid if the value pointed to by puType is ANNLINK_USERMSG.
pwParam | Address of the variable to be updated with the value of wParam. This parameter is only valid if the value pointed to by puType is ANNLINK_USERMSG.
pLink | Character string containing the hyperlink string. This parameter is valid only if the value pointed to by puType is ANNLINK_RUN or ANNLINK_WEBPAGE. If puType points to ANNLINK_RUN, pLink contains the name of the program to run and all required command line parameters. If puType points to ANNLINK_WEBPAGE, pLink contains the URL of the Web page to access.

Returns

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

Comments

Objects with a hyperlink of type ANNLINK_RUN or ANNLINK_WEBPAGE have a hyperlink string associated with them. To see what the hyperlink string of an object is, you must first call L_AnnGetHyperlinkLen and get the string length, allocate a buffer large enough to store the string and the NULL at the end, and then call L_AnnGetHyperlink. Note that the length does NOT account for the null at the end of the string.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetHyperlink, L_AnnGetHyperlinkLen
Topics | Annotation Functions (Document/Medical only): Hyperlinks
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For complete sample code, refer to the Annotate example.

void TestAnnGetHyperlink(HWND hWnd, HANNOBJECT hAnnObject)
{
WPARAM wParam;
L_UINT uLen, uType, uMsg;
L_TCHAR Buffer[2048];

L_AnnGetHyperlinkLen(hAnnObject, &uLen);
uLen = uLen + 1;
L_AnnGetHyperlink(hAnnObject, &uType, &uMsg, &wParam, Buffer);

if (uType == ANNLINK_NONE)
MessageBox(hWnd, TEXT("Object has no hyperlink."), TEXT("Notice"), MB_OK);
else if ((uType == ANNLINK_WEBPAGE) || (uType == ANNLINK_RUN))
MessageBox(hWnd, Buffer, TEXT("Message"), MB_OK);
else
MessageBox(hWnd, TEXT("Hyperlink does not have a string.\n"), TEXT("Message"), MB_OK);
return;
}


L_AnnGetHyperlinkLen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetHyperlinkLen(hObject, puLen)

HANNOBJECT hObject; | /* handle of the annotation object */
L_UINT L_FAR * puLen; | /* address of the variable to be updated */

Gets the length of the specified annotation object's hyperlink string. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object from which to retrieve the length of the hyperlink sting
puLen | Address of the variable to be updated with the length of the hyperlink string.

Returns

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

Comments

Only objects with a hyperlink of type ANNLINK_RUN or ANNLINK_WEBPAGE have a hyperlink string associated with them. To see what the hyperlink string of an object is, you must first call this function and get the string length, allocate a buffer large enough to store the string and the NULL at the end, and then call L_AnnGetHyperlink. Note that the length does NOT account for the null at the end of the string.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetHyperlinkMenuEnable, L_AnnGetHyperlinkMenuEnable, L_AnnSetHyperlink, L_AnnGetHyperlink
Topics | Annotation Functions (Document/Medical only): Hyperlinks
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetHyperlink.

For complete sample code, refer to the Annotate example.


L_AnnGetHyperlinkMenuEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetHyperlinkMenuEnable (hObject, pfEnable)

HANNOBJECT hObject; | /* handle of the annotation automation object */
L_BOOL L_FAR * pfEnable; | /* address of the variable to be updated */

Gets a value that indicates whether the hyperlink menu item will be shown when you click the right mouse button in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pfEnable | Address of the variable to be updated with the value indicating whether the hyperlink menu item is enabled or disabled. Possible values are:
 | Value | Meaning
 | TRUE | The hyperlink menu item will be shown in design mode when you right click on one or more objects.
 | FALSE | The hyperlink menu item will not be shown.

Returns

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

Comments

The hyperlink menu item applies only when dealing with automation objects.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetHyperlinkMenuEnable, L_AnnSetHyperlink, L_AnnGetHyperlinkLen, L_AnnGetHyperlink
Topics | Annotation Functions (Document/Medical only): Hyperlinks
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For complete sample code, refer to the Annotate example.

For an example, refer to L_AnnSetHyperlinkMenuEnable.


L_AnnGetItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetItem(hContainer, phItem)

HANNOBJECT hContainer; | /* handle of the container object */
pHANNOBJECT phItem; | /* address of the variable to be updated */

Gets the handle to the first annotation object in the specified container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle of the container object.
phItem | Address of the HANNOBJECT variable to be updated with the object’s handle. If the container does not have any objects, the updated value is NULL.

Returns

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

Comments

You can use this function to see if a container is empty.

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phItem parameter. This function will update the variable with the handle of the first object in the container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetContainer, L_AnnInsert, L_AnnRemove, L_AnnGetTopContainer, L_AnnEnumerate
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This example deletes the object that is passed in, if it is an empty subcontainer. */
void TestAnnGetItem(HANNOBJECT hThisObject)
{
L_UINT ObjectType; /* Type of annotation object */
HANNOBJECT hTestObject;
HANNOBJECT hRootContainer; /* Root container for the whole window */
/* Get the root container */
L_AnnGetTopContainer(hThisObject, &hRootContainer);
/* Do nothing if this is the root container */
if (hThisObject == hRootContainer)
return;
/* See if this is a container */
L_AnnGetType(hThisObject, &ObjectType);
/* Do nothing if it is not a container */
if (ObjectType != ANNOBJECT_CONTAINER)
return;
/* See if there are any objects in the container */
L_AnnGetItem(hThisObject, &hTestObject);
/* If there are none, delete the container */
if (hTestObject == NULL)
{
L_AnnDestroy(hThisObject, 0);
MessageBox (NULL, TEXT("Deleted empty container"), TEXT("Notice"), MB_OK);
}
return;
}


L_AnnGetLineStyle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetLineStyle(hObject, puLineStyle)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puLineStyle; | /* address of the variable to be updated */

Gets the line style of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puLineStyle | Address of the variable to be updated with the annotation object's current line style. Possible line style values are:
 | Value | Meaning
 | ANNLINE_SOLID | [0] Solid line
 | ANNLINE_DASH | [1] Dashed line
 | ANNLINE_DOT | [2] Dotted line
 | ANNLINE_DASHDOT | [3] Dash dot line
 | ANNLINE_DASHDOTDOT | [4] Dash dot dot line
 | ANNLINE_NULL | [5] No line

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puLineStyle parameter. This function will update the variable with the annotation object's line style constant.

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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetLineWidth, L_AnnGetLineWidth, L_AnnSetLineStyle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetLineStyle.


L_AnnGetLineWidth

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetLineWidth(hObject, pdLineWidth)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdLineWidth; | /* address of the variable to be updated */

Gets the current unscaled value of the line width of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdLineWidth | Address of the variable to be updated with the annotation object's current line width.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdLineWidth parameter. This function will update the variable with the line width of the 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetLineWidth, L_AnnSetLineStyle, L_AnnGetLineStyle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetLineWidth.


L_AnnGetLocked

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetLocked(hObject, pfLocked)

HANNOBJECT hObject; | /* handle to the annotation object*/
L_BOOL L_FAR * pfLocked; | /* address of a variable to be updated */

Gets a value that indicates whether an object is locked. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfLocked | Address of a variable to be updated with a value indicating whether the object is locked or unlocked. Possible values are:
 | Value | Meaning
 | TRUE | The object is locked.
 | FALSE | The object is not locked.

Returns

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

Comments

Only unlocked objects can be locked. If an object is already locked, it will stay locked with its original key. You must pass the same key to L_AnnUnlock to unlock the object(s).

An object must be unlocked in order to change its key in the automated mode.

Redact objects must be unlocked to be restored (unrealized). Refer to L_AnnUnrealize.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnUnlock, L_AnnShowLockedIcon, L_AnnUnrealize, L_AnnRealize, L_AnnLock
Topics | Annotation Functions (Document/Medical): Security
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For complete sample code, refer to the Annotate example.

void TestAnnLocked(HANNOBJECT hAnnObject, HWND hWnd)
{
L_BOOL bLocked;
int nRet;
L_TCHAR L_FAR *MyKey;

L_AnnShowLockedIcon(hAnnObject, TRUE, 0);
L_AnnGetLocked(hAnnObject, &bLocked);
if (bLocked)
{
MessageBox(hWnd, TEXT("Object is locked. It will be unlocked.\n"), TEXT("Message"), MB_OK);
nRet = L_AnnUnlock(hAnnObject, MyKey, 0);
if (nRet == ERROR_ANN_LOCKED)
MessageBox(hWnd, TEXT("Object was not unlocked!"), TEXT("Warning"), MB_OK);
}
else
{
MessageBox(hWnd, TEXT("Object was not locked. It will be locked now."), TEXT("Message"), MB_OK);
nRet = L_AnnLock(hAnnObject, MyKey, 0);
if (nRet != SUCCESS)
MessageBox(hWnd, TEXT("Object could not be locked.\n"), TEXT("Warning"), MB_OK);
}
return;
}


L_AnnGetMetafile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetMetafile(hObject, phMetafile)

HANNOBJECT hObject; | /* handle to the annotation object */
HMETAFILE L_FAR * phMetafile; | /*pointer to a variable to be updated with the handle to a metafile */

Retrieves the metafile handle associated with a stamp object (including the Rubber Stamp tools), encrypt object, hotspot object, or freehand hotspot object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
phMetafile | Pointer to a variable to be updated with the handle to a metafile.

Returns

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

Comments

If this function is successful, the address pointed to by phMetafile will be updated with the metafile handle.

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 L_AnnGetMetafile function to retrieve a metafile for an object. Call the L_AnnSetMetafile function to change the metafile for an object. Any new objects will still get the default metafile.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetMetafile, L_AnnSetPredefinedMetafile, L_AnnGetPredefinedMetafile
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Example

//Sample for L_AnnGetMetafile
//This sample enumerates through all annotations in a container and retrieves
//the metafile for the stamp, hotspot, and freehand hotspot objects
L_INT EXT_CALLBACK annMetaCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_UINT Type;
HMETAFILE Metafile;
L_INT nRet;
L_TCHAR *pszType;
L_BOOL bRetrieve;
L_TCHAR szMsg[200];

L_AnnGetType(hObject, &Type);
pszType = TEXT("");
bRetrieve = FALSE;
switch(Type)
{
case ANNOBJECT_STAMP:
pszType = TEXT("ANNOBJECT_STAMP");
bRetrieve = TRUE;
break;

case ANNOBJECT_HOTSPOT:
pszType = TEXT("ANNOBJECT_HOTSPOT");
bRetrieve = TRUE;
break;

case ANNOBJECT_FREEHANDHOTSPOT:
pszType = TEXT("ANNOBJECT_FREEHANDHOTSPOT");
bRetrieve = TRUE;
break;
}

if (bRetrieve)
{
nRet = L_AnnGetMetafile(hObject, &Metafile);
if (nRet == SUCCESS)
{
if (Metafile != NULL)
wsprintf(szMsg, TEXT("%s Metafile retrieved"), pszType);
else
wsprintf(szMsg, TEXT("%s Metafile is NULL"), pszType);
}
else
{
wsprintf(szMsg, TEXT("%s Error Getting Metafile"), pszType);
}
}
else
wsprintf(szMsg, TEXT("Not a stamp and not a freehand object"));

MessageBox(NULL, szMsg, TEXT(""), MB_OK);
return SUCCESS;
}

void SampleAnnGetMetafile(HANNOBJECT hContainer)
{
ANNENUMCALLBACK annMetaCallback;
L_AnnEnumerate(hContainer, annMetaCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER, NULL);

}


L_AnnGetNameOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetNameOptions(hObject, pNameOptions, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNNAMEOPTIONS pNameOptions; | /* pointer to a structure that specifies the name options */
L_UINT uStructSize; | /* size of the ANNNAMEOPTIONS structure */

Gets the name options for the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pNameOptions | Pointer to an ANNNAMEOPTIONS structure to be updated with the name options.
uStructSize | Size in bytes, of the structure pointed to by pNameOptions, for versioning. Use sizeof(ANNNAMEOPTIONS).

Returns

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

Comments

Use this function to get the name options of any annotation object. To use this function, declare a variable a type ANNNAMEOPTIONS, and pass the address of this variable as the second argument. For more information, refer to the documentation for the structure ANNNAMEOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetPredefinedMetafile, L_AnnGetPredefinedMetafile, L_AnnSetMetafile, L_AnnSetNameOptions, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnEncryptApply, L_AnnGetSecondaryMetafile, L_AnnGetPredefinedBitmap, L_AnnSetPredefinedBitmap, L_AnnGetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetNameOptions.


L_AnnGetNodes

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetNodes(hObject, pbShowNodes, puGapNodes)

HANNOBJECT hObject; | /* handle to the annotation object*/
L_BOOL L_FAR * pbShowNodes; | /* address of the variable to be updated */
L_UINT L_FAR * puGapNodes; | /* address of the variable to be updated */

Gets information on how to display the nodes of the annotation object in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object.
pbShowNodes | Address of the variable to be updated with a value that indicates whether to show the nodes. Pass NULL if you do not wish to retrieve this information. Possible values are:
 | Value | Meaning
 | TRUE | Show the nodes.
 | FALSE | Do not show the nodes.
puGapNodes | Address of the variable to be updated with a value that represents the number of nodes to skip before displaying another node (Pass NULL if you do not wish to retrieve this information). 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, …

Returns

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

Comments

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetNodes.


L_AnnGetObjectFromTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetObjectFromTag(hContainer, uFlags, uTag, phTagObject)

HANNOBJECT hContainer; | /* handle to the container object */
L_UINT uFlags; | /* flags that determine which objects to process */
L_UINT32 uTag; | /* unsigned 32-bit integer used as the object's tag */
pHANNOBJECT phTagObject; | /* handle to the associated annotation object */

Retrieves a handle to the object that has the specified tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the container object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
uTag | The unsigned 32-bit integer used as the object's tag.
phTagObject | Address of a variable to be updated with the handle to the annotation object that has the tag specified in uTag. If an object with the specified tag is not found, the variable will be updated with NULL.

Returns

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

Comments

For more information on getting and setting tags, refer to L_AnnGetTag and L_AnnSetTag.

This function applies to multiple and selected objects based on values of the uFlags parameter.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTag, L_AnnSetTag
Topics: | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

static TagCount = 0;

void TestFunction1(void)
{
HANNOBJECT hContainer;
ANNENUMCALLBACK annTagCallback;
/* This function sets the tags for the selected objects. */
L_AnnEnumerate(hContainer, annTagCallback, NULL, ANNFLAG_SELECTED | ANNFLAG_NOTTHIS, 0);
}
L_INT EXT_CALLBACK annTagCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_INT nRet;

nRet = L_AnnSetTag(hObject, TagCount, 0);
if (nRet == SUCCESS)
{
++TagCount;
MessageBox(NULL, TEXT("Tag set."), TEXT(""), MB_OK);
}
else
MessageBox(NULL, TEXT("Tag not set."), TEXT(""), MB_OK);

return SUCCESS;
}

void TestFunction2(void)
{
/* This function finds the objetc with the specified tag. */
HANNOBJECT hContainer;
HANNOBJECT TagObject;
L_UINT32 TagNo = 2;
L_AnnGetObjectFromTag(hContainer, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, TagNo, &TagObject);
if (TagObject != NULL)
MessageBox(NULL, TEXT("Object retrieved."), TEXT(""), MB_OK);
else
MessageBox(NULL, TEXT("Object not found."), TEXT(""), MB_OK);
}


L_AnnGetOffsetX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetOffsetX(hObject, pdOffsetX)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdOffsetX; | /* address of the variable to be updated */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdOffsetX | Address of the variable to be updated with the specified object's X offset.

Returns

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

Comments

The offset values are applied after the scalar properties, which are set by the L_AnnSetScalarX and L_AnnSetScalarY functions. For more information, refer to Low-Level Coordinate System for Annotations.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdOffsetX parameter. This function will update the variable with the value of the specified object's X offset.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetOffsetX.


L_AnnGetOffsetY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetOffsetY(hObject, pdOffsetY)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdOffsetY; | /* address of the variable to be updated */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdOffsetY | Address of the variable to be updated with the specified object's Y offset.

Returns

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

Comments

The offset values are applied after the scalar properties, which are set by the L_AnnSetScalarX and L_AnnSetScalarY functions. For more information, refer to Low-Level Coordinate System for Annotations.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdOffsetY parameter. This function will update the variable with the value of the specified object's Y offset.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetOffsetX.


L_AnnGetOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetOption(hAutomation, puOptions)

HANNOBJECT hAutomation; | /* handle to the automation object */
L_UINT *puOptions; | /* address of the variable to be updated with annotation options */

Gets the currently set user interface and other annotation options introduced in version 14.5. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the automation object.
puOptions | Address of the variable to be updated with annotation options. Use a bitwise OR to specify more than one value. Possible values are:
 | Value | Meaning
 | OPTIONS_NEW_STAMP_METAFILES | [0x0001] Uses the new rubber stamp styles.
 | OPTIONS_NEW_TOOLBAR | [0x0002] Displays the new XP style annotation toolbar.
 | OPTIONS_NEW_ALPHA | [0x0004] Displays new "alpha" option in the Fill mode dialog.
 | OPTIONS_NEW_ROTATE | [0x0008] Displays rotate handles on objects in design mode.
 | OPTIONS_NEW_SIDE_HANDLES | [0x0010] Displays side handles on rectangular objects in design mode.
 | OPTIONS_NEW_MULTI_SELECT | [0x0020] Displays a multiselect outline of multiply selected objects, along with the new multi-select resize behavior.
 | OPTIONS_NEW_CURSORS | [0x0040] Displays different cursors for each of the annotation tools, and when hovering over handles in design mode.
 | OPTIONS_NEW_ESC_CANCEL | [0x0080] Allows the user to cancel current action by pressing ESC. Actions include annotation creation and manipulation.
 | OPTIONS_NEW_CALIBRATE_RULER | [0x0100] Enables the ruler calibration feature in design mode.
 | OPTIONS_NEW_DOT_DASH_LINES | [0x0200] Draws the dash and dot line styles with line widths greater than 1 pixel.
 | OPTIONS_NEW_TEXT_OPTIONS | [0x0400] Enables new text annotation options including show/hide text, show/hide border, and changing text color.
 | OPTIONS_NEW_ALL | Enables ALL the new options. The value for this constant is the logical "or" of all the above flags.

Returns

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

Comments

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 L_AnnSetOptions with the desired flags. To get the current v14.5 options, call L_AnnGetOptions. For a description of the changes, refer to New Annotation Features of Version 14.5.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | ANNBUTTON, L_AnnFreeToolBarButtons, L_AnnGetToolBarButtons, L_AnnSetToolBarButtons, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnSetAutoCursor, L_AnnGetAutoCursor, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSetTextOptions, L_AnnGetTextOptions, L_AnnSetOptions
Topics: | New Annotation Features of Version 14.5.
 | Calibrating Annotation Ruler Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Example

For an example, refer to L_AnnSetOptions.


L_AnnGetPointCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPointCount(hObject, puCount)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puCount; | /* address of the variable to be updated */

Gets the number of vertices (corner points) in an object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puCount | Address of the variable to be updated with the number of vertices.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puCount parameter. This function will update the variable with the number of vertices.

L_AnnGetPointCount works only with the following types of objects:

ANNOBJECT_POINTER
ANNOBJECT_FREEHAND
ANNOBJECT_LINE
ANNOBJECT_POLYGON
ANNOBJECT_POLYLINE
ANNOBJECT_TEXTPOINTER

For an ANNOBJECT_TEXTPOINTER object, puCount is updated with the value 5.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack, L_AnnGetRect, L_AnnSetRect, L_AnnSetPoints, L_AnnGetBoundingRect, L_AnnGetPoints
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing an Automated Annotation Program
 | Implementing a Non-Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetPoints .


L_AnnGetPointOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPointOptions(hObject, pPointOptions, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINTOPTIONS pPointOptions; | /* pointer to an ANNPOINTOPTIONS structure that specifies various point options */
L_UINT uStructSize; | /* size of the ANNPOINTOPTIONS structure */

Gets the options for the specified point annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPointOptions | Pointer to an ANNPOINTOPTIONS structure to be updated with the various point appearance options for the specified annotation object.
uStructSize | Size in bytes, of the structure pointed to by pPointOptions, for versioning. Use sizeof(ANNPOINTOPTIONS).

Returns

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

Comments

Use this function to get the point appearance options of an annotation point object. To use this function, declare a variable a type ANNPOINTOPTIONS, and pass the address of this variable as the second argument. For more information, see the documentation for the structure ANNPOINTOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetPredefinedBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example toggles the appearance of a point annotation object
// The appearance toggles between bitmap to circle
L_VOID SampleAnnSetPointOptions(HANNOBJECT hObject)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;
ANNPOINTOPTIONS PointOptions;

L_UINT uObjectType;

L_AnnGetType(hObject, &uObjectType);
if (uObjectType != ANNOBJECT_POINT)
{
MessageBox(NULL, TEXT("This object is not a point object"), TEXT("Error"), MB_OK);
return;
}

memset(&PointOptions, 0, sizeof(ANNPOINTOPTIONS));
PointOptions.uStructSize = sizeof(ANNPOINTOPTIONS);
PointOptions.uFlags = ANNPOINT_ALL;
L_AnnGetPointOptions(hObject, &PointOptions, sizeof(ANNPOINTOPTIONS));

if (PointOptions.bPointUseBitmap)
{
// Change point appearance to a circle
PointOptions.uStructSize = sizeof(ANNPOINTOPTIONS);
PointOptions.bPointUseBitmap = FALSE;
PointOptions.bPointFixedSize = FALSE;
PointOptions.bPointTransparentFill = FALSE;
PointOptions.crPointBorderColor = RGB(0,0,0);
PointOptions.crPointFillColor = RGB(255, 255, 0);
PointOptions.nPointRadius = 12;
PointOptions.nReserved = 0;
PointOptions.uFlags = ANNPOINT_USE_BITMAP |
ANNPOINT_RADIUS |
ANNPOINT_BORDER_COLOR |
ANNPOINT_FILL_COLOR |
ANNPOINT_TRANSPARENT_FILL |
ANNPOINT_FIXED_SIZE;
}
else
{
// Change point appearance to a bitmap
PointOptions.uStructSize = sizeof(ANNPOINTOPTIONS);
PointOptions.bPointUseBitmap = TRUE;
PointOptions.bPointBitmapTransparent = TRUE;
PointOptions.crPointBitmapTransparentColor = RGB(255,255,255);
PointOptions.nReserved = 0;
}

L_AnnSetPointOptions(hObject, &PointOptions, 0);
}


L_AnnGetPoints

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPoints(hObject, pPoints)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINT pPoints; | /* pointer to the array to be updated */

Fills the specified array of ANNPOINT structures with the vertices of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPoints | Pointer to the array that this function will fill with the vertices of the specified annotation object.

Returns

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

Comments

You can use the L_AnnGetPointCount function to determine the required size of the array before calling this function.

The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.

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.

L_AnnGetPoints works only with the following types of objects:

ANNOBJECT_AUDIO
ANNOBJECT_BUTTON
ANNOBJECT_CROSSPRODUCT
ANNOBJECT_CURVE
ANNOBJECT_CURVECLOSED
ANNOBJECT_ELLIPSE
ANNOBJECT_ENCRYPT
ANNOBJECT_FREEHAND
ANNOBJECT_FREEHANDHOTSPOT
ANNOBJECT_HILITE
ANNOBJECT_HOTSPOT
ANNOBJECT_LINE
ANNOBJECT_NOTE
ANNOBJECT_POINT
ANNOBJECT_POINTER
ANNOBJECT_POLYGON
ANNOBJECT_POLYLINE
ANNOBJECT_POLYRULER
ANNOBJECT_PROTRACTOR
ANNOBJECT_PUSHPIN
ANNOBJECT_RECT
ANNOBJECT_REDACT
ANNOBJECT_RTF
ANNOBJECT_RULER
ANNOBJECT_STAMP
ANNOBJECT_TEXT
ANNOBJECT_TEXTPOINTER
ANNOBJECT_VIDEO

For annotation objects that are defined by a rectangle, use the L_AnnGetRect function.

You can get the position of a Point object using the following:

ANNPOINT apt;
L_AnnGetPoints(hPoint, &apt);

where hPoint is the handle to the point object.

To retrieve the points of a cross-product object, do the following:

ANNPOINT apt[5];
L_AnnGetPoints(hPoint, apt);

hPoint is the handle to the cross-product object. apt[0] and apt[1] are the points for the primary ruler. apt[2] is the intersection point. apt[3] and apt[4] are the points for the secondary ruler.

To retrieve the points of a protractor object, do the following:

ANNPOINT apt [3];
L_AnnGetPoints(hPoint, apt);

hPoint is the handle to the cross-product object. apt[0] and apt[2] are the endpoints for the two rulers. apt[1] is the intersection point. This is shown below:

For an ANNOBJECT_TEXTPOINTER object, pPoints is updated with 5 points. The first four points are coordinates of a rectangle. The last two are the endpoints of the "pointer" segment.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack, L_AnnGetRect, L_AnnSetRect, L_AnnSetPoints, L_AnnGetBoundingRect, L_AnnGetPointCount
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing an Automated Annotation Program
 | Implementing a Non-Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
HANNOBJECT hContainer; /* Container annotation object */
static void TestAnnGetPoints(HWND hWnd, int x, int y)
{
HANNOBJECT hObject; /* Local variable for the annotation object */
POINT PointToTest; /* The point in the window's client area to test */
L_UINT TestResult; /* Result of the test */
pANNPOINT pPoints; /* Pointer to the points in the object */
HGLOBAL hPoints; /* Handle for memory management */
L_UINT uCount; /* Number of points in the object */
L_UINT i;
ANNRECT rcDefine; /* Defining rectangle for the object */
ANNRECT rcDefineName;
L_DOUBLE cx; /* Center point */
L_DOUBLE cy;
/* Did we hit an object? */
/* Use incoming coordinates to specify the point to test */
PointToTest.x = x;
PointToTest.y = y;
/* Get the object at the specified point */
L_AnnHitTest ( hContainer, &PointToTest, &TestResult, &hObject );
if ( TestResult == ANNHIT_BODY )
{
/* first, get the # of points in the object */
L_AnnGetPointCount ( hObject, &uCount );
/* Allocate and lock a storage for the points */
hPoints = GlobalAlloc(GPTR, sizeof(ANNPOINT) * uCount);
pPoints = (pANNPOINT)GlobalLock( hPoints );
/* Now, get the points */
L_AnnGetPoints ( hObject, pPoints );
/* Get the defining rect, and find the center point */
L_AnnGetRect ( hObject, &rcDefine, &rcDefineName);
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<uCount; i++)
{
pPoints[i].x += (cx - pPoints[i].x) / 2;
pPoints[i].y += (cy - pPoints[i].y) / 2;
}
/* Put the new points back into the object */
L_AnnSetPoints ( hObject, pPoints, uCount );
GlobalUnlock (hPoints);
GlobalFree (hPoints);
}
}


L_AnnGetPolyFillMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPolyFillMode(hObject, puPolyFillMode)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puPolyFillMode; | /* address of the variable to be updated */

Gets a value that indicates how a polygonal annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puPolyFillMode | Address of the variable to be updated with the value of the polygonal fill-mode constant. Possible fill mode values are:
 | Value | Meaning
 | ANNPOLYFILL_WINDING | [0] All pixels that are inside the resulting exterior lines are filled.
 | ANNPOLYFILL_ALTERNATE | [1] The filled area includes the area between odd-numbered and even-numbered polygon sides on each scan line.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puPolyFillMode parameter. This function will update the variable with the fill-mode constant.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnSetFillMode, L_AnnGetFillMode, L_AnnSetPolyFillMode, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetPolyFillMode.


L_AnnGetPredefinedBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPredefinedBitmap(uType, pBitmap, uStructSize)

L_UINT uType; | /* constant that indicates the bitmap to retrieve */
pBITMAPHANDLE pBitmap; | /* pointer to a variable to be updated with the bitmap handle */
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */

Retrieves a copy of the specified predefined bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
uType | Value that indicates the bitmap to retrieve. Possible values are:
 | Value | Meaning
 | ANNBITMAP_POINT | [0] Predefined metafile for annotation point object
pBitmap | Pointer to a variable to be updated with the bitmap handle.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

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

Comments

This function is valid only for the ANNOBJECT_POINT object. You must free the bitmap handle when you are finished, using L_FreeBitmap. Call the L_AnnSetPredefinedBitmap function to change or reset the predefined bitmap.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

// This example does the following:
// 1. Gets the current point bitmap
// 2. Inverts it
// 3. Sets the inverted bitmap as the default point bitmap
L_VOID SampleGetPredefinedBitmap()
{
BITMAPHANDLE PointBitmap;

// Get predefined point bitmap
L_AnnGetPredefinedBitmap(ANNBITMAP_POINT, &PointBitmap, sizeof(BITMAPHANDLE));

// Invert it
L_InvertBitmap(&PointBitmap);

// Set as new point bitmap
L_AnnSetPredefinedBitmap(ANNBITMAP_POINT, &PointBitmap);

MessageBox(NULL, TEXT("Now create a point annotation object. The bitmap is inverted"), TEXT(""), MB_OK);
}


L_AnnGetPredefinedMetafile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetPredefinedMetafile(uType, phMetafile, pbEnhanced)

L_UINT uType; | /* constant that indicates the metafile to retrieve */
HMETAFILE L_FAR * phMetafile; | /* pointer to a variable to be updated with the handle to the metafile */
L_BOOL L_FAR * pbEnhanced; | /* flag that indicates whether the retrieved metafile is enhanced */

Retrieves a copy of the specified predefined metafile. This function is available in the Document/Medical Toolkits.

Parameter | Description
uType | Constant that indicates the metafile to retrieve. Possible values are:
 | Value | Meaning
 | ANNMETAFILE_APPROVED | [0] predefined metafile - APPROVED
 | ANNMETAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
 | ANNMETAFILE_CHECKED | [2] predefined metafile -CHECKED
 | ANNMETAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
 | ANNMETAFILE_COPY | [4] predefined metafile - COPY
 | ANNMETAFILE_DRAFT | [5] predefined metafile - DRAFT
 | ANNMETAFILE_EXTENDED | [6] predefined metafile - EXTENDED
 | ANNMETAFILE_FAX | [7] predefined metafile - FAX
 | ANNMETAFILE_FAXED | [8] predefined metafile - FAXED
 | ANNMETAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
 | ANNMETAFILE_INVOICE | [10] predefined metafile - INVOICE
 | ANNMETAFILE_NOTICE | [11] predefined metafile - NOTICE
 | ANNMETAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
 | ANNMETAFILE_ONFILE | [13] predefined metafile - ON FILE
 | ANNMETAFILE_PAID | [14] predefined metafile - PAID
 | ANNMETAFILE_PASSED | [15] predefined metafile - PASSED
 | ANNMETAFILE_PENDING | [16] predefined metafile - PENDING
 | ANNMETAFILE_PROCESSED | [17] predefined metafile - PROCESSED
 | ANNMETAFILE_RECEIVED | [18] predefined metafile - RECEIVED
 | ANNMETAFILE_REJECTED | [19] predefined metafile - REJECTED
 | ANNMETAFILE_RELEASE | [20] predefined metafile - RELEASE
 | ANNMETAFILE_SENT | [21] predefined metafile - SENT
 | ANNMETAFILE_SHIPPED | [22] predefined metafile - SHIPPED
 | ANNMETAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
 | ANNMETAFILE_URGENT | [24] predefined metafile - URGENT
 | ANNMETAFILE_VOID | [25] predefined metafile - VOID
 | ANNMETAFILE_HOTSPOT | [26] predefined metafile for Hotspots and Freehand hotspots.
 | ANNMETAFILE_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
phMetafile | Pointer to a variable to be updated with the handle to the specified metafile.

pbEnhanced | Flag that indicates whether the retrieved metafile is enhanced or not. Possible values are:
 | Value | Meaning
 | TRUE | The retrieved metafile is an enhanced metafile.
 | FALSE | The retrieved metafile is a windows metafile.

Returns

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

Comments

The L_AnnGetPredefinedMetafile function is valid only for the following object types:

Encrypt

Freehand Hotspot

Hotspot

Stamp (including the Rubber Stamp tools)

Use the L_AnnGetPredefinedMetafile function to get the default metafiles for these objects. To reset a metafile to its original metafile, call the L_AnnSetMetafile function and pass NULL to hMetafile. When the metafile handle is no longer needed, make sure to free it using one of the Microsoft Windows API functions (DeleteMetaFile or DeleteEnhMetaFile).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetPredefinedMetafile, L_AnnGetMetafile, L_AnnSetMetafile, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnEncryptApply, L_AnnGetSecondaryMetafile, L_AnnGetPredefinedBitmap, L_AnnSetPredefinedBitmap, L_AnnGetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Example

//Sample for L_AnnGetPredefinedMetafile
//Replaces all stamp, hotspot, freehand hotspot object metafiles with
//with the predfined metafile for the hotspot
L_INT EXT_CALLBACK annMetaCallback2(HANNOBJECT hObject, HMETAFILE Metafile)
{
L_UINT Type;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_STAMP:
case ANNOBJECT_HOTSPOT:
case ANNOBJECT_FREEHANDHOTSPOT:
L_AnnSetMetafile(hObject, Metafile, ANNMETAFILE_USER, 0);
break;
default:
MessageBox(NULL, TEXT("Object must be a stamp, hotspot, or freehand hotspot."), TEXT(""), MB_OK);
}
return SUCCESS;
}

void SampleAnnGetPredefinedMetafile(HANNOBJECT hContainer)
{
HMETAFILE Metafile;
L_BOOL bEnhanced;

L_AnnGetPredefinedMetafile (ANNMETAFILE_HOTSPOT, &Metafile, &bEnhanced);

L_AnnEnumerate(hContainer, (ANNENUMCALLBACK) annMetaCallback2, Metafile, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, 0);
if (!bEnhanced)
DeleteMetaFile(Metafile);
else
DeleteEnhMetaFile((HENHMETAFILE)Metafile);
}


L_AnnGetProtractorOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetProtractorOptions(hObject, pbAcute, puUnit, puAbbrevLen, pszAbbrev, puPrecision, pdArcRadius)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pbAcute; | /* address of the variable to be updated */
L_UINT L_FAR * puUnit; | /* address of the variable to be updated */
L_UINT L_FAR * puAbbrevLen; | /* address of the variable to be updated */
L_TCHAR L_FAR * pszAbbrev; | /* address of the variable to be updated */
L_UINT L_FAR * puPrecision; | /* address of the variable to be updated */
L_DOUBLE L_FAR * pdArcRadius; | /* address of the variable to be updated */

Gets the options for the specified Protractor object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pbAcute | Address of the variable to be updated with a value that indicates whether the inside angle or the outside angle of the protractor is being drawn. Possible values are:
 | Value | Meaning
 | TRUE | The inside (acute) angle of the protractor is being drawn.
 | FALSE | The outside (obtuse) angle of the protractor is being drawn.
 | Pass NULL if you do not wish to retrieve this information.

puUnit | Address of the variable to be updated with a value that indicates whether the units of the angle are degrees or radians. Pass NULL if you do not wish to retrieve this information. The updated values are:
 | Value | Meaning
 | ANNANGLE_DEGREES | The angle is measured in degrees. The default abbreviation for this unit is the degree sign.
 | ANNANGLE_RADIANS | The angle is measured in radians. The default abbreviation for this unit is "rad".
puUnit | Address of the variable to be updated with a value that indicates whether the units of the angle are degrees or radians. Pass NULL if you do not wish to retrieve this information.
puAbbrevLen | Address of the variable to be updated with the length of the abbreviation string that follows the angle. Pass NULL if you do not wish to retrieve this information.
pszAbbrev | Address of the character string to be updated with the abbreviation string that follows the angle. Pass NULL if you do not wish to retrieve this information.
puPrecision | Addresss of the variable to be updated with the number of digits after the decimal. ("." ) Valid values are 0 – 200.
pdArcRadius | Address of the variable to be updated with the length of the arc radius.

Returns

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

Comments

You may wish to call this function once, with pszAbbrev set to NULL, and a pointer for puAbbrevLen. The variable pointed to by puAbbrevLen will contain the length of the abbreviation string. Allocate a buffer of this size and call this function again, passing the newly allocated buffer for pszAbbrev.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetProtractorOptions, L_AnnGetAngle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetProtractorOptions.


L_AnnGetRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRect(hObject, pRect, pRectNamet)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNRECT pRect; | /* address of the variable to be updated */
pANNRECT pRectName; | /* address of the variable to be updated */

Gets the current defining rectangle of the specified annotation object. Every object has a defining rectangle, which intersects the object's outermost points. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRect | Address of the variable to be updated with the annotation object's current rectangle. Pass NULL if you do not wish to retrieve this information.
pRectName | Address of the variable to be updated with the bounding rectangle of the name of the annotation object. Pass NULL if you do not wish to retrieve this information.

Returns

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

Comments

The defining rectangle, which is used to size and position objects, is different from the bounding 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.

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. Refer to the L_AnnGetBoundingRect function.

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:

If the annotation object name is being displayed (see L_AnnSetNameOptions and L_AnnGetNameOptions for more information on annotation object names), it can appear far away from the annotation object itself. For this reason, a separate defining rectangle for the annotation object name can be obtained by passing the address of a variable of data type RECT for the argument pRectName.

The ANNRECT structure is like a Windows RECT structure, except that it uses double-precision floating point values.

Coordinates of an object's rectangle 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack, L_AnnSetRect, L_AnnSetPoints, L_AnnGetBoundingRect, L_AnnGetPointCount, L_AnnGetPoints
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing a Non-Automated Annotation Program
 | Obtaining Annotation Object Information

Example

//This example displays the defining rectangle for an annotation object,
//and the defining rectangle for the annotation object name
void SampleAnnGetDefiningRect(HANNOBJECT hObject )
{
ANNRECT rcAnnObjectBounds;
ANNRECT rcAnnNameBounds;
L_TCHAR szMsg[200];

L_AnnGetRect(hObject, &rcAnnObjectBounds, &rcAnnNameBounds);
wsprintf(szMsg, TEXT("L_AnnGetRect\n\tObject Bounds[%lf, %lf, %lf, %lf]\n\tName Bounds[%lf,%lf,%lf,%lf]"),
rcAnnObjectBounds.left, rcAnnObjectBounds.top, rcAnnObjectBounds.right, rcAnnObjectBounds.bottom,
rcAnnNameBounds.left, rcAnnNameBounds.top, rcAnnNameBounds.right, rcAnnNameBounds.bottom);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


L_AnnGetRestrictToContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRestrictToContainer(hObject, pbRestrict)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL pbRestrict; | /* pointer to a variable */

Determines whether the annotation object is restricted to the container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pbRestrict | Pointer to a boolean value that specifies whether to restrict the object to the container. Possible values are:
 | Value | Meaning
 | TRUE | Restrict the object to the container.
 | FALSE | Do not restrict the object to the container.

Returns

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

Comments

Determines whether one or more annotation objects is restricted 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnSetRestrictToContainer.


L_AnnGetRgnHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRgnHandle(hObject, pXForm, phRgn)

HANNOBJECT hObject; | /* handle to the annotation object */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */
HRGN L_FAR * phRgn; | /* address of the variable to be updated */

Creates a region from the specified annotation object and retrieves a handle to that region. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object from which the region will be created.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to TOP_LEFT.
phRgn | Address of the variable to be updated with the handle to the region, if the function is successful.

Returns

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

Comments

You can create regions from the following annotation objects:

ANNOBJECT_FREEHAND

ANNOBJECT_POLYLINE

ANNOBJECT_POLYGON

ANNOBJECT_RECT

ANNOBJECT_ELLIPSE

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_STAMP

ANNOBJECT_NOTE

ANNOBJECT_TEXT

ANNOBJECT_HILITE

ANNOBJECT_BUTTON

ANNOBJECT_REDACT

When working with the RGNXFORM structure in this function, consider the following:

the annotations are always TOP_LEFT.

the bitmap is missing, so the bitmap rectangle is replaced by the object rectangle.

it is easier to work with this function using TOP_LEFT as the ViewPerspective.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Topics: | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Object Information

Example

L_INT EXT_CALLBACK annRegionCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
HRGN hRgn;
RGNXFORM XForm;
L_INT nRet;

XForm.uViewPerspective = BOTTOM_LEFT;
XForm.nXScalarNum = XForm.nXScalarDen = 1;
XForm.nYScalarNum = XForm.nYScalarDen = 1;
XForm.nXOffset = XForm.nYOffset = 0;

nRet = L_AnnGetRgnHandle(hObject, &XForm, &hRgn);
if (nRet == SUCCESS)
{
MessageBox(NULL, TEXT("Got region handle."), TEXT(""), MB_OK);

}
return SUCCESS;
}
void TestFunction2(void)
{
HANNOBJECT hContainer;

L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)annRegionCallback, NULL, ANNFLAG_SELECTED | ANNFLAG_NOTTHIS, 0);
}


L_AnnGetROP2

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetROP2(hObject, puRop2)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puRop2; | /* address of the variable to be updated */

Gets a constant that indicates which binary raster operation (ROP2) code is being used for one or more objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puRop2 | Address of the variable to be updated with the ROP2 code. Possible ROP2 code values are:
 | Value | Meaning
 | ANNROP2_COPY | [0x0000] Draw the object using the object's color
 | ANNROP2_AND | [0x0001] Draw the object, performing an AND operation between the object's color and the background color. This creates a highlight effect. White objects become transparent.
 | ANNROP2_XOR | [0x0002]Draw the object, performing an XOR operation between the object's color and the background color. This creates an inverted effect. Black objects become transparent.

Returns

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

Comments

The ROP2 code for the object is retrieved and stored in the memory location indicated by puROP2.

ROP2 codes specify how pen or brush colors are to be combined with the colors in the image.

The L_AnnGetROP2 function is valid only for the following object types:

Crossproduct

Curve

Closed Curve

Ellipse

Freehand

Freehand Hotspot

Line

Pointer

Point

Polygon

Polyline

Polyruler

Protractor

Rectangle

Ruler

Stamp (including the Rubber Stamp)

TextPointer

In addition, the Automation object stores ROP2 settings along with the other object default settings

If you try to use the L_AnnGetROP2 function with an object that does not support it, the function returns Error (-16), which is "Feature not supported".

Call the L_AnnSetROP2 function to set the ROP2 code being used for one or more annotation objects.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetROP2, L_AnnGetFillMode, L_AnnSetFillMode, L_AnnGetTransparent, L_AnnSetTransparent, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Getting and Setting the ROP2 Property

Example

For an example, refer to L_AnnSetROP2.


L_AnnGetRotateAngle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRotateAngle(hObject, *pdAngle)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE *pdAngle; | /* pointer to a double that returns the rotate angle */

Gets the rotation angle for an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdAngle | Pointer to a double variable to be updated with the rotation angle.

Returns

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

Comments

Call this function to get the rotation angle for a particular 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 function will get (-PI/2) for the rotation angle. If a rectangle is rotated 90 degrees in the clockwise direction, this function 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 function is only valid for the following annotation object types:

ANNOBJECT_POINTER:

ANNOBJECT_LINE:

ANNOBJECT_RULER:

ANNOBJECT_AUDIO:

ANNOBJECT_BUTTON:

ANNOBJECT_ELLIPSE:

ANNOBJECT_HILITE:

ANNOBJECT_HOTSPOT:

ANNOBJECT_NOTE:

ANNOBJECT_RECT:

ANNOBJECT_REDACT:

ANNOBJECT_STAMP:

ANNOBJECT_TEXT:

ANNOBJECT_VIDEO:

ANNOBJECT_PUSHPIN:

ANNOBJECT_ENCRYPT:

If the function is used with an object that is not listed, it returns SUCCESS with *pdAngle equal to 0.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// This examples displays the rotate angle of the annotation hObject in radians and degrees
L_VOID ExampleAnnGetRotateAngle(HANNOBJECT hObject)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = L_AnnGetRotateAngle(hObject, &dAngle);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Angle of rotation: Radians[%lf] Degrees[%f]\n"),
dAngle,
dAngle *180 / 3.1415926535
);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}
}


L_AnnGetRotateOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRotateOptions(hObject, pRotateOptions, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object*/
pANNROTATEOPTIONS pRotateOptions; | /* pointer to the ANNROTATEOPTIONS structure */
L_UINT uStructSize; | /* size of the ANNROTATEOPTIONS structure */

Gets the rotation options for the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRotateOptions | Pointer to an ANNROTATEOPTIONS structure that specifies the rotate options to set.
uStructSize | Size in bytes, of the structure pointed to by pRotateOptions, for versioning. Use sizeof(ANNROTATEOPTIONS).

Returns

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

Comments

Use this function to get the rotation options of any annotation object, including the automation object. To use this function, declare a variable a type ANNROTATEOPTIONS, and pass the address of this variable as the second argument. For more information, refer to the documentation for the structure ANNROTATEOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetRotateOptions
Topics: | Annotation Functions: Getting and Setting the Rotation Options
 | Obtaining Annotation Object Information

Example

// 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
L_INT ExampleAnnGetRotateOptions(HANNOBJECT hObject)
{
L_INT nRet;
L_CHAR szMsg[200];
ANNROTATEOPTIONS RotateOptions;
memset(&RotateOptions, 0, sizeof(ANNROTATEOPTIONS));

RotateOptions.uStructSize = sizeof(ANNROTATEOPTIONS);
RotateOptions.uFlags = ANNROTATE_SHOW_ROTATE_HANDLES;
RotateOptions.nReserved = 0;

nRet = L_AnnGetRotateOptions(hObject, &RotateOptions, sizeof(ANNROTATEOPTIONS));
if (nRet != SUCCESS)
return nRet;

wsprintf(szMsg, "Old State: bShowRotateHandles: %s", RotateOptions.bShowRotateHandles ? "TRUE" : "FALSE");
MessageBox(NULL, szMsg, "", MB_OK);

// Change the state
RotateOptions.bShowRotateHandles = !RotateOptions.bShowRotateHandles;
nRet = L_AnnSetRotateOptions(hObject, &RotateOptions, 0);
if (nRet != SUCCESS)
return nRet;

nRet = L_AnnGetRotateOptions(hObject, &RotateOptions, sizeof(ANNROTATEOPTIONS));
if (nRet != SUCCESS)
return nRet;

wsprintf(szMsg, "New State: bShowRotateHandles: %s", RotateOptions.bShowRotateHandles ? "TRUE" : "FALSE");
MessageBox(NULL, szMsg, "", MB_OK);
return SUCCESS;
}


L_AnnGetScalarX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetScalarX(hObject, pdScalarX)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdScalarX; | /* address of the variable to be updated */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdScalarX | Address of the variable to be updated with the horizontal scaling factor.

Returns

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

Comments

Offset values, which are set by the L_AnnSetOffsetX and L_AnnSetOffsetY functions, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdScalarX parameter. This function will update the variable with the horizontal scaling factor.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Obtaining Annotation Object Information

Example

/* This example displays the current annotation scalars as percentages */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnGetScalars(void)
{
int XPercent, YPercent; /* X and Y scale percentage */
L_DOUBLE XScalar, YScalar; /* X and Y floating point scalars */
L_TCHAR szMessage[80]; /* Message buffer */
/* Get the floating point scalars */
L_AnnGetScalarX(hContainer, &XScalar);
L_AnnGetScalarY(hContainer, &YScalar);
/* Convert the scalars to percentages */
XPercent = (int)(XScalar * 100);
YPercent = (int)(YScalar * 100);
/* Display the percentages in a message */
wsprintf (szMessage, TEXT("%d percent X and %d percent Y"), XPercent, YPercent);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
return;
}


L_AnnGetScalarY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetScalarY(hObject, pdScalarY)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE L_FAR * pdScalarY; | /* address of the variable to be updated */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pdScalarY | Address of the variable to be updated with the vertical scaling factor.

Returns

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

Comments

Offset values, which are set by the L_AnnSetOffsetX and L_AnnSetOffsetY functions, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

Before calling this function, you must declare a variable of data type L_DOUBLE. Then, pass the address of the variable in the pdScalarY parameter. This function will update the variable with the vertical scaling factor.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarX, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetScalarX.


L_AnnGetSecondaryBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSecondaryBitmap(hObject, pBitmap, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Retrieves the secondary bitmap of the specified object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pBitmap | Pointer to the bitmap handle that references the secondary bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

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

Comments

Only PushPin objects use a secondary bitmap.

A pushpin object has a primary bitmap, (manipulated using L_AnnSetBitmap/L_AnnGetBitmap) when the text is shown, and a secondary bitmap, changed using L_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 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetSecondaryBitmap
Topics: | Annotation Functions: Object Properties
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

For an example, refer to L_AnnSetSecondaryBitmap.


L_AnnGetSecondaryMetafile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSecondaryMetafile(hObject, phMetafile)

HANNOBJECT hObject; | /* handle to the annotation object */
HMETAFILE L_FAR * phMetafile; | /* pointer to a variable to be updated with the handle to a metafile */

Retrieves the metafile handle associated with an encryptor object when it is in the ‘decryptor’ state. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
phMetafile | Pointer to a variable to be updated with the handle to a metafile.

Returns

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

Comments

The encrypt object has two states:

Encryptor

Decryptor

Each state is displayed with its own metafile.

Use this function to retrieve the current metafile for an encrypt object in a ‘decryptor’ state. The default image is shown in the figure below:

If this function is successful, the address pointed to by phMetafile will be updated with the metafile handle.

Use the L_AnnGetMetafile function to retrieve the current metafile for an encrypt object in an ‘encryptor’ state.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Example

// This example swaps the metafiles for the 'encrypt' and 'decrypt' state of an encryptor
L_VOID SampleAnnGetSecondaryMetafile(HANNOBJECT hObject)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;
L_BOOL bEncryptorOriginal;
ANNENCRYPTOPTIONS EncryptOptions;

L_UINT uObjectType;

L_AnnGetType(hObject, &uObjectType);
if (uObjectType != ANNOBJECT_ENCRYPT)
{
MessageBox(NULL, TEXT("This object is not an encryptor."), TEXT("Error"), MB_OK);
return;
}

L_AnnGetMetafile(hObject, &hMetafile1);
L_AnnGetSecondaryMetafile(hObject, &hMetafile2);

memset(&EncryptOptions, 0, sizeof(ANNENCRYPTOPTIONS));
EncryptOptions.uStructSize = sizeof(ANNENCRYPTOPTIONS);
EncryptOptions.uFlags = ANNENCRYPT_ALL;
L_AnnGetEncryptOptions(hObject, &EncryptOptions);

bEncryptorOriginal = EncryptOptions.bEncryptor;

// Set state to encryptor, and set encryptor metafile
EncryptOptions.uFlags = ANNENCRYPT_TYPE;
EncryptOptions.bEncryptor = TRUE;
L_AnnSetEncryptOptions(hObject, &EncryptOptions, 0);
L_AnnSetMetafile(hObject, hMetafile2, ANNMETAFILE_USER, 0);

// Set state to decryptor, and set decryptor metafile
EncryptOptions.bEncryptor = FALSE;
L_AnnSetEncryptOptions(hObject, &EncryptOptions, 0);
L_AnnSetMetafile(hObject, hMetafile1, ANNMETAFILE_USER, 0);

// Set encryptor to oringal state
EncryptOptions.bEncryptor = bEncryptorOriginal;
L_AnnSetEncryptOptions(hObject, &EncryptOptions, 0);
}


L_AnnGetSelectCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSelectCount(hObject, puCount)

HANNOBJECT hObject; | /* handle to the annotation container object */
L_UINT L_FAR * puCount; | /* address of the variable to be updated */

Gets the number of selected items in the specified annotation container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation container object.
puCount | Address of the variable to be updated with the number of items.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puCount parameter. This function will update the variable with the number of items.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSelectRect.


L_AnnGetSelected

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSelected(hObject, pfSelected)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfSelected; | /* address of the variable to be updated */

Gets a value that indicates whether the specified annotation object is selected. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfSelected | Address of the variable to be updated with the value indicating whether the annotation object is selected. Possible values are:
 | Value | Meaning
 | TRUE | The object is selected.
 | FALSE | The object is not selected.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfSelected parameter. This function will update the variable with the annotation object's current value of the selected property.

You can use the L_AnnSet... functions to set the properties of all objects that have the selected property set to TRUE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelectItems, L_AnnGetROP2, L_AnnSetROP2, L_AnnShowLockedIcon, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetSelected.


L_AnnGetSelectItems

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSelectItems(hObject, pItems)

HANNOBJECT hObject; | /* handle to the container object */
pHANNOBJECT pItems; | /* pointer to the array to update */

Fills the specified array with the annotation object handles of all selected objects in the container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the container object.
pItems | Pointer to the array to be updated with the annotation object handles of all selected objects in the container.

Returns

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

Comments

You can use the L_AnnGetSelectCount function to determine the required size of the array.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectCount
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This example creates an array of selected items and rotates each one. */
/* Note that this can also be done simply by setting a flag in L_AnnRotate. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnSelectItems( HWND hWnd)
{
L_UINT uSelectCount; /* Number of objects selected */
pHANNOBJECT pAnnArray; /* Pointer to an array of annotation objects */
HGLOBAL hAnnArray; /* Handle for memory management */
L_UINT i; /* Loop counter */
/* Get the number of objects selected */
L_AnnGetSelectCount(hContainer, &uSelectCount);
/* Allocate and lock a storage for the object handles */
hAnnArray = GlobalAlloc(GPTR, sizeof(HANNOBJECT) * uSelectCount);
pAnnArray = (pHANNOBJECT)GlobalLock( hAnnArray );
/* Fill the array of selected objects */
L_AnnGetSelectItems(hContainer, pAnnArray);
/* Rotate each selected object */
for (i = 0; i < uSelectCount; i++)
{
L_AnnRotate(pAnnArray[i], 90, 0, 0);
}
/* Free the memory */
GlobalUnlock (hAnnArray);
GlobalFree (hAnnArray);
return;
}


L_AnnGetSelectRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetSelectRect(hObject, pRect)

HANNOBJECT hObject; | /* handle to the annotation container object */
LPRECT pRect; | /* address of the RECT variable to be updated */

Gets the rectangle in the current window that surrounds all selected annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation container object.
pRect | Address of the RECT variable to be updated with the window coordinates of the rectangle that includes all selected annotation objects.

Returns

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

Comments

Before calling this function, you must declare a variable of data type RECT. Then, pass the address of the variable in the pRECT parameter. This function will update the variable with the window coordinates of the rectangle that includes all selected annotation objects.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSelectPoint.


L_AnnGetShowFlags

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetShowFlags(hObject, puShowFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puShowFlags; | /* address of the variable to be updated */

Gets a value that indicates how the rulers, cross-products, and protractors will be displayed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puShowFlags | Address of the variable to be updated with the value that indicates how the rulers, cross-products, and protractors will be shown. Possible values contained in puShowFlags are:
 | Value | Meaning
 | 0 | Do not display the ruler length or the ruler gauge or the tic marks. In this case, the ruler looks like a line.
 | ANNSHOW_LENGTH | Display the ruler length.
 | ANNSHOW_GAUGE | Display the ruler gauge.
 | ANNSHOW_TICMARKS | Display the tic marks.

Returns

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

Comments

This function can only be used for the Ruler, Cross-Product, and Protractor objects. In addition, the Automation object stores show flag settings along with the other object default settings

For Protractor objects, the default value for uShowFlags is 0. For the Ruler, PolyRuler, and Cross-Product objects the default value for uShowFlags is ANNSHOW_LENGTH | ANNSHOW_TICMARKS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetShowFlags
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetShowFlags.


L_AnnGetTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTag(hObject, puTag)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT32 L_FAR * puTag; | /* address of the variable to be updated */

Gets the tag of the specified annotation object. You can use this tag to uniquely identify objects when they are saved in a file. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puTag | Address of the variable to be updated with the object's tag.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT32. Then, pass the address of the variable in the puTag parameter. This function will update the variable with the tag of the annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTag
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For complete sample code, refer to the ANNOTATE example.

/* This example shows how an active object’s tag can be used to invoke a particular action. */
void TestAnnGetTag(HANNOBJECT hAnnObject)
{
L_UINT32 ObjectTag; /* Tag used to identify an object */
L_UINT ActiveState; /* Specifies whether the object can be activated */
/* Get the tag and the active state */
L_AnnGetTag(hAnnObject, &ObjectTag);
L_AnnGetActiveState(hAnnObject, &ActiveState);
/* Take an action based on the tag and the active state */
if ((ObjectTag == 3) && (ActiveState == ANNACTIVE_ENABLED))
MessageBox (NULL, TEXT("This is what we do for No. 3"), TEXT("Notice"), MB_OK);
return;
}


L_AnnGetText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetText(hObject, pText)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pText; | /* address of the character string to be updated */

Gets the text (character string) of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pText | Pointer to a character string to be updated with the annotation object's character string.

Returns

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

Comments

Before calling this function, you must declare a variable as a pointer to a character string. Then, pass the variable in the pText parameter. This function will update the variable with the annotation object's character string.

Note: The text of the ruler object (which can be retrieved through L_AnnGetText and L_AnnGetTextLen is the length + unit abbrev. The distance is reset every time the object is changed.

L_AnnGetText can be used to retreive the text from a Rich Text annotation object (ANNOBJECT_RTF). However, no formatting information will be preserved. To retrieve the text with formatting, see L_AnnGetTextRTF.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetText, L_AnnGetTextLen, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetText.


L_AnnGetTextAlign

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextAlign(hObject, puTextAlign)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT * puTextAlign; | /* address of a variable to be updated with the object's text alignment */

Gets the text alignment of an annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puTextAlign | Address of the variable to be updated with the object's text alignment. Possible values are:
 | Value | Meaning
 | TEXTALIGN_LEFT | [1] Align text to left.
 | TEXTALIGN_CENTER | [2] Center the text.
 | TEXTALIGN_RIGHT | [3] Align text to the right.

Returns

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

Comments

This function gets the text alignment of certain annotation objects that display text.

The function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than those listed above will return ERROR_FEATURE_NOT_SUPPORTED.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTextExpandTokens
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// Sample for L_AnnSetTextAlign, L_AnnGetTextAlign
// This example changes the text alignment of a text, note, or text pointer annotation object
L_VOID SampleAnnSetTextAlign(HANNOBJECT hObject)
{
L_INT nRet;
L_UINT uTextAlign;
L_TCHAR szMsg[100];
L_UINT uType;

L_AnnGetTextAlign(hObject, &uTextAlign);
switch(uTextAlign)
{
case TEXTALIGN_LEFT:
uTextAlign = TEXTALIGN_CENTER;
break;

case TEXTALIGN_CENTER:
uTextAlign = TEXTALIGN_RIGHT;
break;

case TEXTALIGN_RIGHT:
uTextAlign = TEXTALIGN_LEFT;
break;

}
nRet= L_AnnSetTextAlign(hObject, uTextAlign, 0);
if (nRet != SUCCESS)
{
L_AnnGetType(hObject, &uType);
wsprintf(szMsg, TEXT("L_AnnSetTextAlign Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


L_AnnGetTextExpandTokens

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextExpandTokens(hObject, pbTextExpandTokens)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL * pbTextExpandTokens; | /* address of variable to be updated */

Gets a value that indicates whether the annotation object's text tokens will expand. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object
pbTextExpandTokens | Address of the variable to be updated with the object's text expand token property. Possible values are:
 | Value | Meaning
 | TRUE | Text tokens will be expanded for this object.
 | FALSE | Text tokens will not be expanded for this object.

Returns

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

Comments

This function gets a value that indicates whether the text tokens will be expanded for certain annotation objects that display text. The function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than one listed above will return ERROR_FEATURE_NOT_SUPPORTED.

If pbTextExpandTokens is updated with TRUE, then all tokens will be expanded.

For example, if you have an ANNOBJECT_BUTTON object that will expand text tokens, and #D is defined to be the current day of the week (ANNTOKEN_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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnDeleteTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnInsertTextTokenTable, L_AnnSetTextExpandTokens
Topics: | The Annotation Text Token Table
 | Annotation Functions (Document/Medical only): Text Properties

Example

//This sample toggles the 'text token expand' property of an annotation
L_VOID SampleAnnTextExpandTokens(HANNOBJECT hObject)
{
L_BOOL bTextExpandTokens;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = L_AnnGetTextExpandTokens(hObject, &bTextExpandTokens);
if (nRet == SUCCESS)
{
bTextExpandTokens = !bTextExpandTokens;
wsprintf(szMsg, TEXT("Changing text expand tokens property to %s"),
bTextExpandTokens ? TEXT("TRUE") : TEXT("FALSE"));
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
L_AnnSetTextExpandTokens(hObject, bTextExpandTokens, 0);
}
else
{
wsprintf(szMsg, TEXT("L_AnnGetTextExpandTokens Failed[%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


L_AnnGetTextLen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextLen(hObject, puLen)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puLen; | /* address of the variable to be updated */

Gets the length of the specified annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puLen | Address of the variable to be updated with the length of the object's character string.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puLen parameter. This function will update the variable with the length of the annotation object's text.

When hObject is of type ANNOBJECT_RTF, *puLen is updated with the length of the object's unformatted text. To get the length of the formatted text, see L_AnnGetTextRTF.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetText, L_AnnGetText, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText
Topics: | Annotation Functions: Object Properties
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetText.


L_AnnGetTextOptions

#include "l_bitmap.h"

EXT_FUNCTION L_AnnGetTextOptions(hObject, pTextOptions, uStructSize)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNTEXTOPTIONS pTextOptions; | /* pointer to a structure that specifies the text options */
L_UINT uStructSize; | /* size of the ANNTEXTOPTIONS structure */

Gets the text options for the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pTextOptions | Pointer to an ANNTEXTOPTIONS structure that specifies the text options to set.
uStructSize | Size in bytes, of the structure pointed to by pTextOptions, for versioning. Use sizeof(ANNTEXTOPTIONS).

Returns

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

Comments

Use this function to get the text options of a text annotation object. To use this function, declare a variable a type ANNTEXTOPTIONS, and pass the address of this variable as the second argument. For more information, refer to the documentation for the structure ANNTEXTOPTIONS.

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 first to enable this function by calling L_AnnSetOptions with the OPTIONS_NEW_TEXT_OPTIONS flag.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTextOptions, L_AnnSetText, L_AnnGetText, L_AnnGetTextLen, L_AnnSetTextAlign, L_AnnGetTextAlign, L_AnnSetTextRotate, L_AnnGetTextRotate, L_AnnSetOptions, L_AnnGetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only): Getting and Setting Text Properties
 | Altering Annotation Object Settings
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information
 | Container Annotation Object
 | Annotation Automation Object
 | Text Annotation Object
 | Text Pointer Annotation Object
 | Stamp Annotation Object
 | Note Annotation Object
 | PushPin Annotation Object
 | Button Annotation Object

Example

For an example, refer to L_AnnSetTextOptions


L_AnnGetTextPointerFixed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextPointerFixed(hObject, pbPointerFixed)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL *pbPointerFixed; | /* pointer to a variable to be updated */

Gets a value that indicates whether the pointer of an ANNOBJECT_TEXTPOINTER object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pbPointerFixed | Pointer to a variable to be updated with a value that specifies whether the pointer of an ANNOBJECT_TEXTPOINTER is fixed. Possible values are:
 | Value | Meaning
 | TRUE | The pointer of the ANNOBJECT_TEXTPOINTER object is fixed.
 | FALSE | The pointer of the ANNOBJECT_TEXTPOINTER moves with the object.

Returns

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

Comments

The function is valid only for the ANNOBJECT_TEXTPOINTER annotation object.

If pbPointerFixed is updated with 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 pbPointerFixed is updated with 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.

Calling this function on an object other the ANNOBJECT_TEXTPOINTER will return ERROR_FEATURE_NOT_SUPPORTED.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTextPointerFixed
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// Sample for L_AnnGetTextPointerFixed, L_AnnSetTextPointerFixed
// This Example toggles the text pointer fixed state of an ANNOBJECT_TEXTPOINTER
L_VOID SampleAnnSetTextPointerFixed(HANNOBJECT hObject)
{
L_INT nRet;
L_BOOL bTextPointerFixed;
L_TCHAR szMsg[100];
L_UINT uType;

L_AnnGetTextPointerFixed(hObject, &bTextPointerFixed);

bTextPointerFixed = !bTextPointerFixed;

nRet= L_AnnSetTextPointerFixed(hObject, bTextPointerFixed, 0);
if (nRet != SUCCESS)
{
L_AnnGetType(hObject, &uType);
wsprintf(szMsg, TEXT("L_AnnSetTextPointerFixed Error: %d on object type[%d]\n"), nRet,
uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


L_AnnGetTextRotate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextRotate(hObject, puTextRotate)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT *puTextRotate; | /* address of variable to be updated */

Gets a value that indicates whether the text of an annotation object is rotated. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puTextRotate | Address of the variable to be updated with a value that indicates whether the text is rotated, and if so, by how many degrees. Possible values are:
 | Value | Meaning
 | TEXTROTATE_0 | [0] Do not rotate the text.
 | TEXTROTATE_90 | [90] The text is rotated 90 degrees counter clockwise.
 | TEXTROTATE_180 | [180] The text is rotated 180 degrees counter clockwise.
 | TEXTROTATE_270 | [270] The text is rotated 270 degrees counter clockwise.

Returns

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

Comments

This function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than those listed above will return ERROR_FEATURE_NOT_SUPPORTED.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTextRotate
Topics: | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Text Properties

Example

// Sample for L_AnnSetTextRotate, L_AnnGetTextRotate
// This Example changes the text rotation of a note or text pointer annotation
L_VOID SampleAnnSetTextRotate(HANNOBJECT hObject)
{
L_INT nRet;
L_UINT uTextRotate;
L_TCHAR szMsg[100];
L_UINT uType;

L_AnnGetTextRotate(hObject, &uTextRotate);
switch(uTextRotate)
{
case TEXTROTATE_0:
uTextRotate = TEXTROTATE_90;
break;

case TEXTROTATE_90:
uTextRotate = TEXTROTATE_180;
break;

case TEXTROTATE_180:
uTextRotate = TEXTROTATE_270;
break;

case TEXTROTATE_270:
uTextRotate = TEXTROTATE_0;
break;

}
nRet= L_AnnSetTextRotate(hObject, uTextRotate, 0);
if (nRet != SUCCESS)
{
L_AnnGetType(hObject, &uType);
wsprintf(szMsg, TEXT("L_AnnSetTextRotate Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


L_AnnGetTextRTF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTextRTF(hObject, uFormat, pText, puLen)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFormat; | /* text format type */
L_TCHAR pText; | /* address of character string to be updated */
L_UINT puLen; | /* address of a variable to be updated */

Gets the text and text length (unformatted text or rich text) of an ANNOBJECT_RTF or ANNOBJECT_AUTOMATION annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the ANNOBJECT_RTF object.
uFormat | Value that specifies the text format type. Possible values are:
 | Value | Meaning
 | RTFFORMAT_TEXT | [0x0001] Retrieve the text as unformatted text.
 | RTFFORMAT_RTF | [0x0002] Retrieve the text as rich text.
pText | Pointer to a character string to be updated with the annotation object's character string. This value can be NULL.
puLen | Address of the variable to be updated with the length of the object's character string.

Returns

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

Comments

This function is used to retrieve the text from an ANNOBJECT_RTF or ANNOBJECT_AUTOMATION object. The text can be retrieved either as rich text, or unformatted text.

Call this function twice. On the first call, pass NULL for the pText argument to get length of the required input buffer. Then, allocate a buffer and call the function a second time to retreive the text. The following code snippet illustrates the process:

HANNOBJECT hObject; // assume this is a valid ANNOBJECT_RTF object
L_UINT uLength;
L_TCHAR *pText;

// Get the length
L_AnnGetTextRTF( hObject, RTFFORMAT_RTF, NULL, &uLength);

// Allocate a buffer
pText = (L_TCHAR *)malloc ( (uLength+1) * sizeof (L_TCHAR) );

// Retrieve the text
L_AnnGetTextRTF( hObject, RTFFORMAT_RTF, pText, &uLength);

To get or set the text of other text objects, see the documentation for L_AnnGetTextLen, L_AnnGetText and L_AnnSetText.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetText, L_AnnSetText, L_AnnGetTextLen, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText, L_AnnSetTextRTF
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// This sample gets the text from Rich Text annotation object in one of two formats (text, or rich text)
// hObject: the Rich Text annotation object
// uFormat: the format of the retrieved text--one of
// RTFFORMAT_TEXT
// RTFFORMAT_RTF
L_VOID SampleAnnGetTextRTF(HANNOBJECT hObject, L_UINT uFormat)
{
L_UINT uLength;
L_TCHAR *pText;
L_TCHAR szMsg[200];
L_TCHAR *pszFormat;
L_INT nRet;

switch(uFormat)
{
case RTFFORMAT_TEXT:
pszFormat = TEXT("RTFFORMAT_TEXT");
break;

case RTFFORMAT_RTF:
pszFormat = TEXT("RTFFORMAT_RTF");
break;

default:
return;
break;
}

// Get the length
nRet = L_AnnGetTextRTF( hObject, uFormat, NULL, &uLength);
if (nRet != SUCCESS)
return;

pText = (L_TCHAR *)malloc( (uLength+1) * sizeof(L_TCHAR) );
nRet = L_AnnGetTextRTF( hObject, uFormat, pText, &uLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Format: %s\nLength: %d"), pszFormat, uLength);
MessageBox(NULL, pText, szMsg, MB_OK);
}

free(pText);
}


L_AnnGetTicMarkLength

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTicMarkLength(hObject, pdLength)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE L_FAR *pdLength; | /* address of the variable to be updated */

Gets the length of the tic mark of an ANNOBJECT_RULER or ANNOBJECT_POLYRULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
pdLength | Address of the variable to be updated with the object's tic mark length.

Returns

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

Comments

The tic mark length applies only to the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_RULER

ANNOBJECT_POLYRULER

The dLength parameter 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, pdLength is updated with the length of the longest tic mark.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetGaugeLength, L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnSetTicMarkLength
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an Example, refer to L_AnnSetTicMarkLength.


L_AnnGetTool

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTool(hObject, puTool)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_UINT L_FAR * puTool; | /* address of the variable to be updated */

Gets the default tool, which is maintained by the automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
puTool | Address of the variable to be updated with the value of the constant for the selected tool. Possible values are:
 | Value | Meaning
 | ANNTOOL_SELECT | [0] Selection pointer
 | ANNTOOL_LINE | [1] Line
 | ANNTOOL_RECT | [2] Rectangle
 | ANNTOOL_ELLIPSE | [3] Ellipse
 | ANNTOOL_POLYLINE | [4] Polyline
 | ANNTOOL_POLYGON | [5] Polygon
 | ANNTOOL_POINTER | [6] Pointer
 | ANNTOOL_FREEHAND | [7] Freehand line
 | ANNTOOL_HILITE | [8] Highlight
 | ANNTOOL_REDACT | [9] Redaction
 | ANNTOOL_TEXT | [10] Text
 | ANNTOOL_NOTE | [11] Note
 | ANNTOOL_STAMP | [12] Stamp
 | ANNTOOL_BUTTON | [13] Button
 | ANNTOOL_HOTSPOT | [14] Hot spot
 | ANNTOOL_AUDIO | [15] Audio clip
 | ANNTOOL_RULER | [16] Ruler clip
 | ANNTOOL_CROSSPRODUCT | [17] Cross product
 | ANNTOOL_POINT | [18] Point
 | ANNTOOL_PROTRACTOR | [19] Protractor
 | ANNTOOL_VIDEO | [20] Video
 | ANNTOOL_PUSHPIN | [21] Pushpin
 | ANNTOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot
 | ANNTOOL_STAMP_FIRST | [23] First rubber stamp
 | ANNTOOL_STAMP_APPROVED | [23] Approved rubber stamp
 | ANNTOOL_STAMP_ASSIGNED | [24] Assigned rubber stamp
 | ANNTOOL_STAMP_CHECKED | [25] Checked rubber stamp
 | ANNTOOL_STAMP_CLATPRV | [26] Client Attorney Privilege rubber stamp
 | ANNTOOL_STAMP_COPY | [27] Copy rubber stamp
 | ANNTOOL_STAMP_DRAFT | [28] Draft rubber stamp
 | ANNTOOL_STAMP_EXTENDED | [29] Extended rubber stamp
 | ANNTOOL_STAMP_FAX | [30] Fax rubber stamp
 | ANNTOOL_STAMP_FAXED | [31] Faxed rubber stamp
 | ANNTOOL_STAMP_IMPORTANT | [32] Important rubber stamp
 | ANNTOOL_STAMP_INVOICE | [33] Invoice rubber stamp
 | ANNTOOL_STAMP_NOTICE | [34] Notice rubber stamp
 | ANNTOOL_STAMP_OFFICIAL | [35] Official rubber stamp
 | ANNTOOL_STAMP_ONFILE | [36] Onfile rubber stamp
 | ANNTOOL_STAMP_PAID | [37] Paid rubber stamp
 | ANNTOOL_STAMP_PASSED | [38] Passed rubber stamp
 | ANNTOOL_STAMP_PENDING | [39] Pending rubber stamp
 | ANNTOOL_STAMP_PROCESSED | [40] Processed rubber stamp
 | ANNTOOL_STAMP_RECEIVED | [41] Received rubber stamp
 | ANNTOOL_STAMP_REJECTED | [42] Rejected rubber stamp
 | ANNTOOL_STAMP_RELEASE | [43] Release rubber stamp
 | ANNTOOL_STAMP_SENT | [44] Sent rubber stamp
 | ANNTOOL_STAMP_SHIPPED | [45] Shipped rubber stamp
 | ANNTOOL_STAMP_TOPSECRET | [46] Top Secret rubber stamp
 | ANNTOOL_STAMP_URGENT | [47] Urgent rubber stamp
 | ANNTOOL_STAMP_VOID | [48] Void rubber stamp
 | ANNTOOL_STAMP_LAST | [48] the last rubber stamp
 | ANNTOOL_LAST | [48] the last tool button
 | ANNTOOL_USER | [0x0100] the first user defined tool
 | ANNTOOL_USERLAST | [0x0200] the last allowed user defined tool

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puTool parameter. This function will update the variable with the value of the constant for the selected tool.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer,
 | L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Inteface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

/* This example gets the automation object’s current tool and assigns it to a global variable. */
HANNOBJECT hAutoObject; /* Automation object */
L_UINT CurrentAutoTool; /* Annotation tool in automation mode */
void TestAnnGetTool(void)
{
L_AnnGetTool(hAutoObject, &CurrentAutoTool);
return;
}


L_AnnGetToolBarButtons

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetToolBarButtons(hwndToolBar, pButtons, puButtons, uStructSize)

HWND hwndToolBar; | /* window handle for the toolbar */
pANNBUTTON pButtons; | /* address of a variable to be updated */
L_UINT L_FAR * puButtons; | /* address of a variable to be updated */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by puButtons */

Retrieves information about the buttons in the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
pButtons | Pointer to an array of ANNBUTTON structures to be updated with information about the buttons in the annotation toolbar.
puButtons | Address of a variable to be updated with the number of buttons in the toolbar (number of entries in the pButtons array).

Returns

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

Comments

Call this function once, with pButtons set to NULL. This will retrieve the number of buttons in the toolbar, updating puButtons. Next, allocate the appropriate amount of memory for the pButtons array, and call this function again to retrieve the button information.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible, L_AnnFreeToolBarButtons, L_AnnSetToolBarButtons, L_AnnGetToolBarInfo, L_AnnSetToolBarColumns, L_AnnSetToolBarRows, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | New Annotation Features of Version 14.5

Example

For an example, refer to L_AnnFreeToolBarButtons.


L_AnnGetToolBarButtonVisible

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetToolBarButtonVisible(hwndToolBar, uButton, pfVisible)

HWND ToolBar; | /* window handle for the toolbar */
L_UINT uButton; | /* constant that specifies the tool */
L_BOOL L_FAR * pfVisible; | /* address of the variable to be updated */

Determines whether the specified tool on the annotation toolbar is currently visible. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
uButton | The constant that specifies the tool. The following are possible values:
 | Value | Meaning
 | ANNTOOL_SELECT | [0] Selection tool
 | ANNTOOL_LINE | [1] Line
 | ANNTOOL_RECT | [2] Rectangle
 | ANNTOOL_ELLIPSE | [3] Ellipse
 | ANNTOOL_POLYLINE | [4] Polyline
 | ANNTOOL_POLYGON | [5] Polygon
 | ANNTOOL_POINTER | [6] Pointer
 | ANNTOOL_FREEHAND | [7] Freehand line
 | ANNTOOL_HILITE | [8] Highlight
 | ANNTOOL_REDACT | [9] Redaction
 | ANNTOOL_TEXT | [10] Text
 | ANNTOOL_NOTE | [11] Note
 | ANNTOOL_STAMP | [12] Stamp
 | ANNTOOL_BUTTON | [13] Button
 | ANNTOOL_HOTSPOT | [14] Hot spot
 | ANNTOOL_AUDIO | [15] Audio clip
 | ANNTOOL_RULER | [16] Ruler clip
 | ANNTOOL_CROSSPRODUCT | [17] Cross product
 | ANNTOOL_POINT | [18] Point
 | ANNTOOL_PROTRACTOR | [19] Protractor
 | ANNTOOL_VIDEO | [20] Video
 | ANNTOOL_PUSHPIN | [21] Pushpin
 | ANNTOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot
 | ANNTOOL_STAMP_FIRST | [23] First rubber stamp
 | ANNTOOL_STAMP_APPROVED | [23] Approved rubber stamp
 | ANNTOOL_STAMP_ASSIGNED | [24] Assigned rubber stamp
 | ANNTOOL_STAMP_CHECKED | [25] Checked rubber stamp
 | ANNTOOL_STAMP_CLATPRV | [26] Client Attorney Privilege rubber stamp
 | ANNTOOL_STAMP_COPY | [27] Copy rubber stamp
 | ANNTOOL_STAMP_DRAFT | [28] Draft rubber stamp
 | ANNTOOL_STAMP_EXTENDED | [29] Extended rubber stamp
 | ANNTOOL_STAMP_FAX | [30] Fax rubber stamp
 | ANNTOOL_STAMP_FAXED | [31] Faxed rubber stamp
 | ANNTOOL_STAMP_IMPORTANT | [32] Important rubber stamp
 | ANNTOOL_STAMP_INVOICE | [33] Invoice rubber stamp
 | ANNTOOL_STAMP_NOTICE | [34] Notice rubber stamp
 | ANNTOOL_STAMP_OFFICIAL | [35] Official rubber stamp
 | ANNTOOL_STAMP_ONFILE | [36] Onfile rubber stamp
 | ANNTOOL_STAMP_PAID | [37] Paid rubber stamp
 | ANNTOOL_STAMP_PASSED | [38] Passed rubber stamp
 | ANNTOOL_STAMP_PENDING | [39] Pending rubber stamp
 | ANNTOOL_STAMP_PROCESSED | [40] Processed rubber stamp
 | ANNTOOL_STAMP_RECEIVED | [41] Received rubber stamp
 | ANNTOOL_STAMP_REJECTED | [42] Rejected rubber stamp
 | ANNTOOL_STAMP_RELEASE | [43] Release rubber stamp
 | ANNTOOL_STAMP_SENT | [44] Sent rubber stamp
 | ANNTOOL_STAMP_SHIPPED | [45] Shipped rubber stamp
 | ANNTOOL_STAMP_TOPSECRET | [46] Top Secret rubber stamp
 | ANNTOOL_STAMP_URGENT | [47] Urgent rubber stamp
 | ANNTOOL_STAMP_VOID | [48] Void rubber stamp
 | ANNTOOL_STAMP_LAST | [48] the last rubber stamp
 | ANNTOOL_LAST | [48] the last tool button
 | ANNTOOL_USER | [0x0100] the first user defined tool
 | ANNTOOL_USERLAST | [0x0200] the last allowed user defined tool
pfVisible | Address of the variable to be updated with a value indicating whether the specified tool is visible. Possible values are:
 | Value | Meaning
 | TRUE | The tool is visible.
 | FALSE | The tool is not visible.

Returns

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

Comments

When a tool is invisible, other tools in the toolbar are arranged so that no gaps are left, and so that their order is maintained (left-to-right and top-to-bottom, just as text would wrap).

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfVisible parameter. This function will update the variable with TRUE or FALSE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnSetToolBarButtonVisible
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This example sets the specified button as the current button
if it is visible. Otherwise, it returns FALSE. */
L_BOOL TestAnnButtonVisible(HWND hwndToolBar, L_UINT uButton)
{
L_BOOL fVisible;
/* See if the specified button is visible */
L_AnnGetToolBarButtonVisible(hwndToolBar, uButton, &fVisible);
/* If it is visible, set it. Otherwise, return FALSE. */
if (fVisible == TRUE)
{
L_AnnSetToolBarChecked(hwndToolBar, uButton);
return(TRUE);
}
else
{
return(FALSE);
}
}


L_AnnGetToolBarChecked

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetToolBarChecked(hwndToolBar, puChecked)

HWND ToolBar; | /* window handle for the toolbar */
L_UINT L_FAR * puChecked; | /* address of the variable to be updated */

Gets the selected tool in the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
puChecked | Address of the variable to be updated with the value of the constant for the selected tool. Possible values are:
 | Value | Meaning
 | ANNTOOL_SELECT | [0] Selection pointer
 | ANNTOOL_LINE | [1] Line
 | ANNTOOL_RECT | [2] Rectangle
 | ANNTOOL_ELLIPSE | [3] Ellipse
 | ANNTOOL_POLYLINE | [4] Polyline
 | ANNTOOL_POLYGON | [5] Polygon
 | ANNTOOL_POINTER | [6] Pointer
 | ANNTOOL_FREEHAND | [7] Freehand line
 | ANNTOOL_HILITE | [8] Highlight
 | ANNTOOL_REDACT | [9] Redaction
 | ANNTOOL_TEXT | [10] Text
 | ANNTOOL_NOTE | [11] Note
 | ANNTOOL_STAMP | [12] Stamp
 | ANNTOOL_BUTTON | [13] Button
 | ANNTOOL_HOTSPOT | [14] Hot spot
 | ANNTOOL_AUDIO | [15] Audio clip
 | ANNTOOL_RULER | [16] Ruler clip
 | ANNTOOL_CROSSPRODUCT | [17] Cross product
 | ANNTOOL_POINT | [18] Point
 | ANNTOOL_PROTRACTOR | [19] Protractor
 | ANNTOOL_VIDEO | [20] Video
 | ANNTOOL_PUSHPIN | [21] Pushpin
 | ANNTOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot
 | ANNTOOL_STAMP_FIRST | [23] First rubber stamp
 | ANNTOOL_STAMP_APPROVED | [23] Approved rubber stamp
 | ANNTOOL_STAMP_ASSIGNED | [24] Assigned rubber stamp
 | ANNTOOL_STAMP_CHECKED | [25] Checked rubber stamp
 | ANNTOOL_STAMP_CLATPRV | [26] Client Attorney Privilege rubber stamp
 | ANNTOOL_STAMP_COPY | [27] Copy rubber stamp
 | ANNTOOL_STAMP_DRAFT | [28] Draft rubber stamp
 | ANNTOOL_STAMP_EXTENDED | [29] Extended rubber stamp
 | ANNTOOL_STAMP_FAX | [30] Fax rubber stamp
 | ANNTOOL_STAMP_FAXED | [31] Faxed rubber stamp
 | ANNTOOL_STAMP_IMPORTANT | [32] Important rubber stamp
 | ANNTOOL_STAMP_INVOICE | [33] Invoice rubber stamp
 | ANNTOOL_STAMP_NOTICE | [34] Notice rubber stamp
 | ANNTOOL_STAMP_OFFICIAL | [35] Official rubber stamp
 | ANNTOOL_STAMP_ONFILE | [36] Onfile rubber stamp
 | ANNTOOL_STAMP_PAID | [37] Paid rubber stamp
 | ANNTOOL_STAMP_PASSED | [38] Passed rubber stamp
 | ANNTOOL_STAMP_PENDING | [39] Pending rubber stamp
 | ANNTOOL_STAMP_PROCESSED | [40] Processed rubber stamp
 | ANNTOOL_STAMP_RECEIVED | [41] Received rubber stamp
 | ANNTOOL_STAMP_REJECTED | [42] Rejected rubber stamp
 | ANNTOOL_STAMP_RELEASE | [43] Release rubber stamp
 | ANNTOOL_STAMP_SENT | [44] Sent rubber stamp
 | ANNTOOL_STAMP_SHIPPED | [45] Shipped rubber stamp
 | ANNTOOL_STAMP_TOPSECRET | [46] Top Secret rubber stamp
 | ANNTOOL_STAMP_URGENT | [47] Urgent rubber stamp
 | ANNTOOL_STAMP_VOID | [48] Void rubber stamp
 | ANNTOOL_STAMP_LAST | [48] the last rubber stamp
 | ANNTOOL_LAST | [48] the last tool button
 | ANNTOOL_USER | [0x0100] the first user defined tool
 | ANNTOOL_USERLAST | [0x0200] the last allowed user defined tool

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puChecked parameter. This function will update the variable with the value of the constant for the selected tool.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For complete sample code, refer to the ANNOTATE example.

/* This example gets the toolbar window’s current tool and assigns it to a global variable. */
HWND ToolbarWnd; /* Window for the annotation toolbar */
L_UINT CurrentAutoTool; /* Annotation tool in automation mode */
void TestAnnToolbarChecked(void)
{
L_TCHAR szMessage[80];
L_AnnGetToolBarChecked(ToolbarWnd, &CurrentAutoTool);
wsprintf(szMessage, TEXT("Tool number %d"), CurrentAutoTool);
MessageBox(NULL, szMessage, TEXT("Notice"), MB_OK);
return;
}


L_AnnGetToolBarInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetToolBarInfo(hwndToolBar, pInfo)

HWND hwndToolBar; | /* window handle for the toolbar */
pANNTOOLBARINFO pInfo; | /* address of the variable to be updated */

Gets information about the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
pInfo | Address of the ANNTOOLBARINFO variable to be updated with the toolbar information.

Returns

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

Comments

To change the number of rows, call L_AnnSetToolBarRows. To change the number of columns, call L_AnnSetToolBarColumns.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible, L_AnnFreeToolBarButtons, L_AnnSetToolBarButtons, L_AnnFreeToolBarButtons, L_AnnSetToolBarColumns, L_AnnSetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

void TestFunction2(void)
{
ANNTOOLBARINFO Info;
L_TCHAR cs[256];
L_INT nRet;
HWND ToolbarWnd;

nRet = L_AnnGetToolBarInfo(ToolbarWnd, &Info, sizeof(ANNTOOLBARINFO));
wsprintf(cs, TEXT("There are %d buttons\n%d rows\n%d columns\nin the toolbar."),
Info.uButtons, Info.uRows, Info.uColumns);
MessageBox(NULL, cs, TEXT(""), MB_OK);

L_AnnSetToolBarColumns(ToolbarWnd, Info.uColumns + 1);
MessageBox(NULL, TEXT("The toolbar now has an added column.\n"), TEXT(""), MB_OK);

L_AnnSetToolBarRows(ToolbarWnd, Info.uRows + 1);
MessageBox(NULL, TEXT("The toolbar now has one added row."), TEXT(""), MB_OK);
}


L_AnnGetTopContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTopContainer(hObject, phContainer)

HANNOBJECT hObject; | /* handle to the annotation object */
pHANNOBJECT phContainer; | /* address of variable to be updated */

Gets the handle of the root container of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
phContainer | Address of the HANNOBJECT variable to be updated with the handle of the root container.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phContainer parameter. This function will update the variable with the handle of the annotation object's root container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnInsert, L_AnnRemove, L_AnnGetContainer, L_AnnEnumerate, L_AnnGetItem
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnGetContainer.


L_AnnGetTransparent

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTransparent(hObject, pbTransparent)

HANNOBJECT hObject; | /* handle of the annotation object*/
L_BOOL L_FAR * pbTransparent; | /* address of the variable to be updated */

Gets a value indicating whether the bitmap stamp is using a transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object
pbTransparent | Address of the variable to be updated with a value indicating whether the bitmap stamp is transparent. Possible values are:
 | Value | Meaning
 | TRUE | The bitmap stamp is using a transparent color.
 | FALSE | The bitmap stamp is not using a transparent color.

Returns

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

Comments

Gets a value indicating whether the bitmap is using a transparent color. A transparent color is not painted when the image is painted.

The L_AnnGetTransparent function 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 L_AnnSetTransparent function to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). Call the L_AnnSetTransparentColor function to set the color to be used as the transparent color. Call the L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the L_AnnGetTransparentColor function to get a value that indicates which color is being used as the transparent color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTransparent, L_AnnGetROP2, L_AnnSetROP2, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

Example

For an example, refer to L_AnnSetTransparent.


L_AnnGetTransparentColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetTransparentColor(hObject, pcrTransparent)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF L_FAR * pcrTransparent; | /* address of a variable to be updated */

Retrieves the transparent color set by L_AnnSetTransparentColor. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pcrTransparent | Address of a COLORREF variable to be updated with the transparent 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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter.
 | In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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 functions will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS function, refer to L_GetPixelColor.

Returns

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

Comments

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 L_AnnGetTransparentColor function 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 L_AnnSetTransparent function to set such objects to use a transparent color. Call the L_AnnSetTransparentColor function to set the color to be used as the transparent color. Call the L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetTransparentColor, L_AnnSetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Color Values in LEADTOOLS
 | Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

Example

For an example, refer to L_AnnSetTransparentColor.


L_AnnGetType

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetType(hObject, puObjectType)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puObjectType; | /* address of the variable to be updated */

Gets the type of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puObjectType | Address of the variable to be updated with the object's type. For descriptions of possible object types, refer to Types of Annotations.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puObjectType parameter. This function will update the variable with the constant that specifies the type of annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnHitTest, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For a short example, refer to L_AnnEnumerate. For complete sample code, refer to the ANNOTATE example.


L_AnnGetUndoDepth

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUndoDepth(hObject, puUsedLevels, puMaxLevels)

HANNOBJECT hObject; | /* handle to the automation object */
L_UINT L_FAR * puUsedLevels; | /* address of a variable to be updated */
L_UINT L_FAR * puMaxLevels; | /* address of a variable to be updated */

Retrieves the number of user actions that can be reversed using the L_AnnUndo function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.
puUsedLevels | Address of a variable to be updated with the number or user actions that can be reversed using L_AnnUndo. This number will be between 0 and the number retrieved in puMaxLevels.
puMaxLevels | Address of a variable to be updated with the maximum number of user actions that can be undone using L_AnnUndo. This is the value that was set using L_AnnSetUndoDepth.

Returns

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

Comments

If puUsedLevels is updated with a value of 0, no user actions can be undone using the L_AnnUndo function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnUndo.


L_AnnGetUnit

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUnit(hObject, puUnit, pUnitAbbrev, puPrecision)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_UINT L_FAR *puUnit; | /* address of the variable to be updated with the unit of measure */
L_TCHAR L_FAR *pUnitAbbrev; | /* address of the character string to be updated with the unit abbreviation string */
L_UINT L_FAR *puPrecision; | /* address of the variable to be updated with the number of digits */

Gets the current unit of measurement values set by the L_AnnSetUnit function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
puUnit | Address of the variable to be updated with the object's unit of measurement. Possible values are:
 | Value | Meaning
 | ANNUNIT_INCH | [0x0000] inches
 | ANNUNIT_FEET | [0x0001] feet
 | ANNUNIT_YARDS | [0x0002] yards
 | ANNUNIT_MICROMETERS | [0x0003] micrometers
 | ANNUNIT_MILIMETERS | [0x0004] millimeters
 | ANNUNIT_CENTIMETERS | [0x0005] centimeters
 | ANNUNIT_METERS | [0x0006] meters
 | ANNUNIT_TWIPS | [0x0007] twips
 | ANNUNIT_POINTS | [0x0008] points
 | ANNUNIT_PIXELS | [0x0009] pixels
pUnitAbbrev | Address of the character string to be updated with the unit abbreviation string to be displayed after the distance.
puPrecision | Address of the variable to be updated with the number of digits to be displayed after the decimal place.

Returns

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

Comments

The following annotation objects utilize one or more rulers as part of the annotation:

ANNOBJECT_RULER

ANNOBJECT_POLYRULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_CROSSPRODUCT

In addition, the Automation object (ANNOBJECT_AUTOMATION) stores default unit 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 L_AnnSetUnit function 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 L_AnnGetUnit function to get the unit of measurement and its precision for the ruler. The L_AnnGetDistance2 function gets the length of each ruler that makes up an object, and the total length of all rulers.

To find out the size of the buffer required by pUnitAbbrev, call the L_AnnGetUnitLen function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects

Example

For an example, refer to L_AnnSetUnit.


L_AnnGetUnitLen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUnitLen(hObject, puLen)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_UINT L_FAR *puLen; | /* address of the variable to be updated with the length of the unit abbreviation string */

Gets the size of the buffer required to hold pUnitAbbrev in L_AnnGetUnit. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
puLen | Address of the variable to be updated with the length of the unit abbreviation string.

Returns

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

Comments

Call this function before calling L_AnnGetUnit if you want to get the exact size required to hold the Unit Abbreviation string.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information
 | Using Rulers in Annotation Objects

Example

For an example, refer to L_AnnSetUnit.


L_AnnGetUserData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUserData(hObject, pUserData, puUserDataSize)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UCHAR pUserData; | /* address of binary data to write */
L_UINT *puUserDataSize; | /* address of variable to updated with length of user data */
L_UINT uFlags; | /* flags that determine which objects to process */

Gets the user-defined data of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pUserData | Address that binary data is read into. Can be NULL.
puUserDataSize | Address of variable to be updated with the length (in bytes) of the user data

Returns

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

Comments

Use this function to get the associated user-defined data of an annotation object.

When getting the user-defined data, call this function twice: one time with pUserData set to NULL to get the length of the data, and another time to get the actual data.

HANNOBJECT hObject;
L_UCHAR *pUserData;
L_UINT uUserDataSize;

// Assume hObject is a valid annotation object
L_AnnGetUserData(hObject, NULL, &uUserDataSize);
pUserData = (L_UCHAR *)malloc(uUserDataSize);
L_AnnGetUserData(hObject, pUserData, &uUserDataSize);

User data can be binary or text data, and can be any length. When the annotion object is copied, and the user data is also copied. When saving the annotation (L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset), the user data is saved.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoCursor, L_AnnGetAutoCursor, L_AnnSetUserData, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Obtaining Annotation Object Information

Example

// This sample loads/saves the contents of a BITMAPHANDLE from/to user data of an annotation object
// Call the sample once with bSave set to TRUE, then call it again with bSave set to FALSE to
// load the saved user data as a BITMAPHANDLE
// hObject -- the annotation object
// pBitmap -- the bitmap that is loaded/saved
// bLoad -- TRUE means load from the annotation object, FALSE means save to the annotation object
L_VOID SampleAnnUserData(HANNOBJECT hObject, pBITMAPHANDLE pBitmap, L_BOOL bSave)
{
HGLOBAL hGlobal = NULL;
L_UINT uUserDataSize;
L_UCHAR *pUserData;

if (!pBitmap || !hObject)
return;

if (bSave) // saving
{
L_SaveBitmapMemory(&hGlobal, pBitmap, FILE_BMP, 24, 0, &uUserDataSize, NULL);
pUserData = (L_UCHAR *)GlobalLock(hGlobal);

L_AnnSetUserData(hObject, pUserData, uUserDataSize, ANNFLAG_NOINVALIDATE );

GlobalUnlock(hGlobal);
GlobalFree(hGlobal);
}

else // loading
{
// Load
L_AnnGetUserData(hObject, NULL, &uUserDataSize);
pUserData = (L_UCHAR *)malloc(uUserDataSize);
L_AnnGetUserData(hObject, pUserData, &uUserDataSize);
L_LoadBitmapMemory(pUserData, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, uUserDataSize, NULL, NULL);
free(pUserData);
}
}


L_AnnGetUserHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUserHandle(hObject, nIndex, pAnnHandle)

HANNOBJECT hObject; | /* handle to the annotation object with the user-defined handle */
L_INT32 nIndex; | /* index of user handle to get */
pANNHANDLE pAnnHandle; | /* pointer to a structure */

Gets information about the specified user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object for which to get the user handle.
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to structure to be updated with the user handle.

Returns

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

Comments

Before calling this function, you must create the annotation object.

Call this function to get information about an existing user-defined annotation handle.

If successful, the entire pAnnHandle structure is filled. The pAnnHandle->uFlags field is ignored. For more information, refer to ANNHANDLE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// This example displays information about the first user handle in an annotation object
L_VOID DumpAnnHandle(L_UINT uIndex, pANNHANDLE pAnnHandle)
{
L_TCHAR szMsg[400];

if (pAnnHandle)
{
wsprintf(szMsg, TEXT("uIndex %d\nnSize: %d\nnID: %d\n aptContainer[%f,%f]\nptClient[%d,%d]\nbVisible: %s\ncrPen: 0x%x\ncrFill: 0x%x\nnShape: %s\nhCursor: %s\n"),
uIndex,
pAnnHandle->uStructSize,
pAnnHandle->nID,
pAnnHandle->aptContainer.x, pAnnHandle->aptContainer.y,
pAnnHandle->ptClient.x, pAnnHandle->ptClient.y,
pAnnHandle->bVisible ? TEXT("Visible") : TEXT("Not Visible"),
pAnnHandle->crPen,
pAnnHandle->crFill,
pAnnHandle->nShape == ANNHANDLE_SHAPE_SQUARE ? TEXT("Square") : TEXT("Circle"),
pAnnHandle->hCursor ? TEXT("Cursor") : TEXT("No Cursor")
);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}
}

L_VOID ExampleAnnGetUserHandle(HANNOBJECT hObject)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
L_AnnGetUserHandles(hObject, NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
L_AnnGetUserHandle(hObject, 0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


L_AnnGetUserHandles

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUserHandles(hObject, pAnnHandle, *puCount)

HANNOBJECT hObject; | /* handle to the annotation object with the user-defined handles */
pANNHANDLE pAnnHandle; | /* array of ANNHANDLE structures that define user handles */
L_UINT *pCount; | /* pointer to an unsigned integer used to return the total count of user handles */

Gets information about all existing user-defined annotation handles. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object for which to get the user handles.
pAnnHandle | Array of ANNHANDLE structures to be updated with the user-defined handles.
puCount | Pointer to an unsigned integer used to return the total number of user handles

Returns

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

Comments

Call with pAnnHandle == NULL to get the total number of user handles. Then allocate memory for an array of ANNHANDLE structures and call this function again.

Gets an array of user-defined handles associated with the annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

// This example displays information about all the user handles in an object
L_VOID DumpAnnHandle(L_UINT uIndex, pANNHANDLE pAnnHandle)
{
L_TCHAR szMsg[400];

if (pAnnHandle)
{
wsprintf(szMsg, TEXT("uIndex %d\nnSize: %d\nnID: %d\n aptContainer[%f,%f]\nptClient[%d,%d]\nbVisible: %s\ncrPen: 0x%x\ncrFill: 0x%x\nnShape: %s\nhCursor: %s\n"),
uIndex,
pAnnHandle->uStructSize,
pAnnHandle->nID,
pAnnHandle->aptContainer.x, pAnnHandle->aptContainer.y,
pAnnHandle->ptClient.x, pAnnHandle->ptClient.y,
pAnnHandle->bVisible ? TEXT("Visible") : TEXT("Not Visible"),
pAnnHandle->crPen,
pAnnHandle->crFill,
pAnnHandle->nShape == ANNHANDLE_SHAPE_SQUARE ? TEXT("Square") : TEXT("Circle"),
pAnnHandle->hCursor ? TEXT("Cursor") : TEXT("No Cursor")
);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}
}

L_VOID ExampleAnnGetUserHandles(HANNOBJECT hObject)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
L_AnnGetUserHandles(hObject, NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

L_AnnGetUserHandles(hObject, pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


L_AnnGetUserMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetUserMode(hObject, puMode)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT L_FAR * puMode; | /* address of the variable to be updated */

Gets a value indicating the user mode of the specified annotation object. The user mode can be for interactive design of an annotation object or for run-time use. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
puMode | Address of the variable to be updated with the annotation object's current user mode. Possible values for the user mode are:
 | Value | Meaning
 | ANNUSER_DESIGN | [0] Design mode. Used for creating objects.
 | ANNUSER_RUN | [1] Run mode. Used for viewing and/or activating objects.

Returns

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

Comments

Before calling this function, you must declare a variable of data type L_UINT. Then, pass the address of the variable in the puMode parameter. This function will update the variable with the annotation object's user mode constant.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetUserMode
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This example gets the current user mode and assigns it to a global variable. */
HANNOBJECT hContainer; /* Container annotation object */
L_UINT nAnnUserMode; /* Automation user mode, design or run */
void TestAnnUserMode(void)
{
L_TCHAR szMessage[80];

L_AnnGetUserMode(hContainer, &nAnnUserMode);
wsprintf(szMessage, TEXT("User mode %d"), nAnnUserMode);
MessageBox(NULL, szMessage, TEXT("Notice"), MB_OK);
return;
}


L_AnnGetVisible

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetVisible(hObject, pfVisible)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL L_FAR * pfVisible; | /* address of the variable to be updated */

Gets a value that indicates whether the specified annotation object is visible. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pfVisible | Address of the variable to be updated with a value indicating whether the annotation object is visible. Possible values are:
 | Value | Meaning
 | TRUE | The object is visible.
 | FALSE | The object is not visible.

Returns

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

Comments

For a container object, the visible property determines whether objects in the container can be displayed. For other types of objects, the visible property determines whether the individual object can be displayed.

Before calling this function, you must declare a variable of data type L_BOOL. Then, pass the address of the variable in the pfVisible parameter. This function will update the variable with the annotation object's current value of the visible property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetVisible
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

/* This example uses a callback function (called by L_AnnEnumerate) to count the number
of invisible objects */
L_INT L_EXPORT EXT_CALLBACK TestAnnCallback (HANNOBJECT hObject, L_INT L_FAR * pUserData)
{
L_BOOL IsVisible; /* Indicates whether the object is visible */
L_INT ObjectCount; /* The number of objects */
/* Initialize the object count */
ObjectCount = (L_INT) *pUserData;
/* Get the current value of the visible property */
L_AnnGetVisible (hObject, &IsVisible);
/* Update the counter if the object is not visible */
if (IsVisible == FALSE)
{
++ObjectCount;
}
/* Update the caller's variable */
*pUserData = ObjectCount;
return SUCCESS;
}


L_AnnGetWnd

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetWnd(hObject, phWnd)

HANNOBJECT hObject; | /* handle to the annotation object */
HWND L_FAR * phWnd; | /* address of the variable to be updated */

Gets the window handle of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
phWnd | Address of the variable to be updated with the object's window handle.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HWND. Then, pass the address of the variable in the phWnd parameter. This function will update the variable with the window handle of the annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetWnd
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information

Example

For an example, refer to L_AnnSetWnd.


L_AnnGroup

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGroup(hObject, uFlags, pUserList)

HANNOBJECT hObject; | /* handle to the container object */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR * pUserList; | /* list of users */

Groups a number of objects within a container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the container object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_GROUP menu item has been selected.
 | ANNFLAG_USER | [0x0040] Group only those objects with users listed in pUserList.
pUserList | Character string that contains the list of users associated with the specified object. pUserList 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 ANNFLAG_USER is set in uFlags.

Returns

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

Comments

The Group automation menu item operates like L_AnnGroup(hContainer, ANNFLAG_RECURSE|ANNFLAG_SELECTED|ANNFLAG_CHECKMENU, NULL).

If ANNFLAG_USER is included in uFlags, any user associated with an object to be "grouped" must be included in pUserList. The function checks pUserList before grouping the objects and any object that has a user not in pUserList will not be included in the group.

If ANNFLAG_USER is not included in uFlags, the user list is ignored.

Please note that if you include ANNFLAG_SELECTED|ANNFLAG_USER, for example, in uFlags, the grouped objects must have a user in pUserList AND must also be selected.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnUngroup, L_AnnGetGrouping, L_AnnSetGrouping
Topics: | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Annotation Functions (Document/Medical only): Grouping and Ungrouping Objects
 | Grouping and Ungrouping Annotation Objects

Example

void TestFunction1(void)
{
HANNOBJECT hContainer;
L_AnnSetUser(hContainer, NULL, TEXT("MyObject"), ANNFLAG_RECURSE | ANNFLAG_SELECTED);
L_AnnGroup(hContainer, ANNFLAG_SELECTED | ANNFLAG_USER , TEXT("MyObject"));

}


L_AnnHitTest

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnHitTest(hObject, pPoint, puResult, phObjectHit)

HANNOBJECT hObject; | /* handle to the container object */
LPPOINT pPoint; | /* point to test */
L_UINT L_FAR * puResult; | /* position on the object at the point */
pHANNOBJECT phObjectHit; | /* address of the variable to be updated */

Gets the handle to the annotation object that is located at a specified point. If objects overlap, this function gets the front object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the container object that sets the scope of the search.
pPoint | Pointer to the POINT structure that specifies the point to test. Coordinates are relative to the associated window's client area.
puResult | The position on the annotation object that was found at the specified point. The following are possible values:
 | ANNHIT_NONE [0]
 | ANNHIT_BODY [1]
 | ANNHIT_HANDLE [2]
 | ANNHIT_NAME [3]
phObjectHit | Address of the variable to be updated with the handle to the annotation object that is found at the specified point.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. You can then pass the address of the variable in the phObjectHit parameter, which this function will update with the handle of the object located at the specified point.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

// 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 a MessageBox
void TestAnnHit(HANNOBJECT hContainer, int xFromWindow, int yFromWindow, pHANNOBJECT phAnnObject)
{
L_TCHAR szMsg[200];
L_TCHAR *pszResult;

// This function determines which annotation object you have clicked.
HANNOBJECT ThisObject; /* Local variable for the annotation object */
POINT PointToTest; /* The point in the window's client area to test */
L_UINT TestResult; /* Result of the test */

// Use incoming coordinates to specify the point to test
PointToTest.x = xFromWindow;
PointToTest.y = yFromWindow;

// Get the object at the specified point
L_AnnHitTest(hContainer, &PointToTest, &TestResult, &ThisObject);

switch(TestResult)
{
case ANNHIT_NONE:
pszResult = TEXT("ANNHIT_NONE");
*phAnnObject = 0;
break;

case ANNHIT_BODY:
pszResult = TEXT("ANNHIT_BODY");
*phAnnObject = ThisObject;
break;

case ANNHIT_HANDLE:
pszResult = TEXT("ANNHIT_HANDLE");
*phAnnObject = ThisObject;
break;

case ANNHIT_NAME:
pszResult = TEXT("ANNHIT_NAME");
*phAnnObject = ThisObject;
break;
}

wsprintf(szMsg, TEXT("[%x] %s"), ThisObject, pszResult);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
return;
}


L_AnnHitTestExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnHitTestExt(hContainer, pPoint, puResult, phObjectHit, pHitTestInfo, uStructSize)

HANNOBJECT hContainer; | /* handle to the container object */
LPPOINT pPoint; | /* pointer to a structure */
L_UINT L_FAR * puResult; | /* position on the object at the point */
pHANNOBJECT phObjectHit; | /* address of the variable to be updated */
pANNHITTESTINFO pHitTestInfo; | /* pointer to a ANNHITTESTINFO structure that provides hit test information */
L_UINT uStructSize; | /* size of the ANNHITTESTINFO structure */

This function encapsulates L_AnnHitTest(), which gets the handle to the annotation object that is located at a specified point. (If objects overlap, it gets the front object.) L_AnnHitTestExt gets additional information about the annotation object handle if the handle is a default or user-defined handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the container object that sets the scope of the search.
pPoint | Pointer to the POINT structure that specifies the point to test. Coordinates are relative to the associated window's client area.
puResult | The position on the annotation object that was found at the specified point. Possible values are:
 | ANNHIT_NONE [0]
 | ANNHIT_BODY [1]
 | ANNHIT_HANDLE [2]
 | ANNHIT_NAME [3]
 | ANNHIT_USER_HANDLE [4]
 | ANNHIT_ROTATE_HANDLE [5]
 | ANNHIT_MULTISELECT_HANDLE[6]
 | ANNHIT_MULTISELECT_ROTATE_HANDLE[7]
 | ANNHIT_MULTISELECT_BODY[8]
 | If (*puResult) is updated with ANNHIT_HANDLE or ANNHIT_USER_HANDLE, then pHitTestInfo contains additional information about the annotation object handle. For example, if (*puResult) is ANNHIT_ROTATE_HANDLE, pHitTestInfo->nHandleID will be either ROTATE_HANDLE_CENTER_ID[100] or ROTATE_HANDLE_GRIPPER_ID[101] to identify which rotate handle was hit.
 | ANNHIT_NONE [0]
phObjectHit | Address of the variable to be updated with the handle to the annotation object that is found at the specified point.
pHitTestInfo | Pointer to a ANNHITTESTINFO structure that provides hit test information whenever (*puResult) is updated with ANNHIT_HANDLE or ANNHIT_USER_HANDLE.
uStructSize | Size in bytes, of the structure pointed to by pHitTestInfo, for versioning. Use sizeof(ANNHITTESTINFO).

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. You can then pass the address of the variable in the phObjectHit parameter, which this function will update with the handle of the object located at the specified point.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// 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 hit test is a user handle, additional information about the handle is displayed.
L_VOID ExampleAnnHitTestExt(HANNOBJECT hContainer, POINT ptPointToTest, pHANNOBJECT phAnnObject)
{
L_TCHAR szMsg[200];
L_TCHAR szHitTestInfo[200];
ANNHITTESTINFO HitTestInfo;
L_TCHAR *pszResult;
L_INT nRet;

// This function determines which annotation object you have clicked.
HANNOBJECT hObject; // Local variable for the annotation object
L_UINT uResult; // Result of the test

// Get the object at the specified point
memset(&HitTestInfo, 0, sizeof(ANNHITTESTINFO));
HitTestInfo.uStructSize = sizeof(ANNHITTESTINFO);
nRet = L_AnnHitTestExt(hContainer, &ptPointToTest, &uResult, &hObject, &HitTestInfo, sizeof(ANNHITTESTINFO));
if (nRet != SUCCESS)
return;

switch(uResult)
{
case ANNHIT_NONE:
pszResult = TEXT("ANNHIT_NONE");
break;

case ANNHIT_BODY:
pszResult = TEXT("ANNHIT_BODY");
break;

case ANNHIT_NAME:
pszResult = TEXT("ANNHIT_NAME");
break;

case ANNHIT_HANDLE:
wsprintf(szHitTestInfo, TEXT("ANNHIT_HANDLE nHandleIndex[%d], nHandleID[%d]"),
HitTestInfo.nHandleIndex, HitTestInfo.nHandleID);
pszResult = szHitTestInfo;
break;

case ANNHIT_USER_HANDLE:
wsprintf(szHitTestInfo, TEXT("ANNHIT_USER_HANDLE nHandleIndex[%d], nHandleID[%d]"),
HitTestInfo.nHandleIndex, HitTestInfo.nHandleID);
pszResult = szHitTestInfo;
break;
}

wsprintf(szMsg, TEXT("[%x] %s\n"), hObject, pszResult);
OutputDebugString(szMsg);
return;
}


L_AnnInsert

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnInsert(hContainer, hObject, fStripContainer)

HANNOBJECT hContainer; | /* handle to the container object */
HANNOBJECT hObject; | /* handle to the annotation object to insert */
L_BOOL fStripContainer; | /* flag that indicates whether to insert a container */

Inserts the specified annotation object into the specified container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the container object, a specialized annotation object.
hObject | Handle to the annotation object to insert.
fStripContainer | Flag that indicates whether to insert a container. Possible values are:
 | Value | Meaning
 | 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.
 | 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.

Returns

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

Comments

If hObject is a single annotation object, set fStripContainer to FALSE. That way the object itself is inserted.

If hObject is a container, setting fStripContainer to TRUE will insert only the objects within the container, not the container itself.

If hObject is a container, setting fStripContainer to FALSE will insert the container and all objects within the container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnRemove, L_AnnGetContainer, L_AnnGetTopContainer, L_AnnEnumerate, L_AnnGetItem, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations

Example

For an example ,refer to L_AnnCreate.


L_AnnInsertTextTokenTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnInsertTextTokenTable(hAutomation, pTextToken)

HANNOBJECT hAutomation; | /* handle to the annotation automation object */
pANNTEXTTOKEN pTextToken; | /* pointer to a structure that defines the text token */

Inserts a text token into the text token table. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the annotation automation object.
pTextToken | Pointer to a structure that defines the text token table to insert.

Returns

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

Comments

The text token table is stored in the automation object, so this function is valid only for the ANNOBJECT_AUTOMATION annotation object.

This function inserts a token defined by pTextToken into the text token table. If the token already exists, the existing token is overwritten. If the token does not already exist, it is created.

The text token table can be displayed by performing the following steps:

1. | Right-click 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.

Note that the text token table above contains a separator. To add a separator, set TextToken as shown in the following code:

ANNTEXTTOKEN TextToken;
TextToken.nSize = sizeof(ANNTEXTTOKEN);
TextToken.cToken = 0;
TextToken.nTokenType = ANNTOKEN_SEPARATOR;

For a sample that illustrates how to define the text token table depicted above, see the Example.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnDeleteTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnGetTextExpandTokens, L_AnnSetTextExpandTokens
Topics: | The Annotation Text Token Table
 | Annotation Functions (Document/Medical only): Text Properties

Example

// This Example defines a new user token to display the current date in mm/dd/yyyy format
// It defines a second token for company name
// #D is the token
// Add this sample to the main annotation demo
// After running this sample:
// 1. Draw a text box
// 2. Right-click the text box
// 3. Display the text dialog
// 4. Click the "Insert Token" button
// 5. Choose the newly-defined tokens
L_VOID SampleAnnInsertTextTokenTable(HANNOBJECT hAutomation)
{
ANNTEXTTOKEN TextToken;

// Clear the current text token table
L_AnnClearTextTokenTable(hAutomation);

memset(&TextToken, 0, sizeof(ANNTEXTTOKEN));
TextToken.uStructSize = sizeof(ANNTEXTTOKEN);

// Define token for two digit month
TextToken.cToken = '0';
TextToken.pszDesc = TEXT("Two Digit Month");
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_DATE_MM;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);

// Define token for two digit day
TextToken.cToken = '1';
TextToken.pszDesc = TEXT("Two Digit day");
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_DATE_DD;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);

// Define token for four digit year
TextToken.cToken = '2';
TextToken.pszDesc = TEXT("Two Digit day");
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_DATE_YYYY;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);

// Add a separator
TextToken.cToken = 0;
TextToken.pszDesc = NULL;
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_SEPARATOR;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);

// Define token for mm/dd/yyyy
TextToken.cToken = 'D';
TextToken.pszDesc = TEXT("Date: mm/dd/yyyy");
TextToken.pszTokenString = TEXT("#0/#1/#2");
TextToken.nTokenType = ANNTOKEN_TEXT;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);

// Define token for company name
TextToken.cToken = 'c';
TextToken.pszDesc = TEXT("Company Name");
TextToken.pszTokenString = TEXT("Your Company Name");
TextToken.nTokenType = ANNTOKEN_TEXT;
L_AnnInsertTextTokenTable(hAutomation, &TextToken);
}


L_AnnIsFixedInRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnIsFixedInRect(hObject, prc, pbFixedInRect, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
LPRECT prc; | /* address of variable representing client area */
L_BOOL *pbFixedInRect; | /* address of variable to be updated */
L_UINT uFlags; | /* flags that determine which objects to process */

Indicates whether there are any fixed annotations in the client rectangle prc. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see Comments below.
pbFixedInRect | Pointer to a variable to be updated with a value that indicates whether hObject is fixed and in the client area represented by prc. Possible values are:
 | Value | Meaning
 | TRUE | There is a fixed annotation object in the client area.
 | FALSE | There are no fixed annotation objects in the client area.
uFlags | 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.
ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
ANNFLAG_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.
ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function is used primarily as an aid in scrolling annotations without using double buffering. For more information on double buffering, see the documentation for:

L_DoubleBufferEnable

L_DoubleBufferCreateHandle

L_DoubleBufferDestroyHandle

L_DoubleBufferBegin

L_DoubleBufferEnd

A successful call to L_AnnIsFixedInRect will update pbFixedInRect with TRUE if hObject intersects with prc and hObject is fixed. If prc is NULL, then pbFixedInRect is updated with TRUE if hObject is fixed.

It is useful to pass an annotation container object for parameter hObject, along with the uFlags equal to ANNFLAG_RECURSE. Then pbFixedInRect is updated with TRUE if ANY annotation object intersects with prc. If prc is NULL in this case, then pbFixedInRect is updated with TRUE if ANY fixed object exists in the container.

Fixed annotations are independent of the annotation container scalarX, scalarY, offsetX and offsetY properties. The result is that they do not scroll or move with the underlying image. For more information, refer to L_AnnSetScalarX, L_AnnSetScalarY, L_AnnSetOffsetX, and L_AnnSetOffsetY. For more information, refer to Fixed Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFixed, L_AnnPopFixedState, L_AnnPushFixedState, L_AnnSetFixed
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Example

// This Example displays a message box telling if there are any fixed annotations
// visible in the client area of hWnd. This is useful for handling scrolling and zooming
// of fixed annotations without double-buffering.
// hWnd -- window displaying annotations
// hContainer -- handle to the annotation container
L_VOID SampleAnnIsFixedInRect(HWND hWnd, HANNOBJECT hContainer)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_INT nRet;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
nRet = L_AnnIsFixedInRect(hContainer, &rcClient, &bFixedInRect, ANNFLAG_RECURSE);
if (nRet == SUCCESS)
{
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
}


L_AnnLoad

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLoad(pFile, phObject, pLoadOptions)

L_TCHAR L_FAR * pFile; | /* name of the file to load */
pHANNOBJECT phObject; | /* address of the variable to be updated */
PLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads the specified annotation file. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFile | Character string containing the name of the file to load.
phObject | Address of the variable to be updated with the handle to the outermost (root) container object from the file.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle of the outermost (root) object from the file (typically a container object). When this variable is no longer needed, you must free the allocated memory by calling L_AnnDestroy for this variable.

L_AnnLoad will load annotations stored in LEAD files. It will also look for annotations stored as a Wang compatible TIFF tag in TIF files, and load those annotations.

The page number used when loading annotations is obtained from the LOADFILEOPTION structure.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoadMemory, L_AnnLoadOffset, L_AnnDestroy, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | New Annotation Features of Version 14.5

Example

For complete sample code, refer to the ANNOTATE example.

/* This example loads annotations from a file and redraws the image to display the loaded annotations*/
HANNOBJECT hContainer; /* Container annotation object */
void TestLoadAnn(HWND hWnd)
{
int nRet;
HANNOBJECT TmpContainer;
L_TCHAR szMessage[80];
HDC hdc;
RECT rAnnBounds;
RECT rAnnBoundsName;

nRet = L_AnnLoad(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TEST.ANN"), &TmpContainer, NULL);
/* The following if statement inserts the loaded annotations into hContainer and lets you see the results of the load. */
if (nRet == SUCCESS)
{
L_AnnInsert(hContainer, TmpContainer, TRUE);
hdc = GetDC(hWnd);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hdc, &rAnnBounds, hContainer);
}
else
{
wsprintf(szMessage, TEXT("Error # %d"), nRet);
MessageBox(NULL, szMessage, TEXT("Error"), MB_OK);
}
}


L_AnnLoadMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLoadMemory(pMem, uMemSize, phObject, pLoadOptions)

L_UCHAR, L_FAR * pMem; | /* pointer to the file in memory to be loaded */
L_UINT32 uMemSize; | /* size of the file in memory (in bytes) */
pHANNOBJECT phObject; | /* address of the variable to be updated */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads an annotation from a file that is stored in memory. This function is available in the Document/Medical Toolkits.

Parameter | Description
pMem | Pointer to the file in memory to be loaded.
uMemSize | Size of the file in memory (in bytes).
phObject | Address of the variable to be updated with the handle to the container object of the loaded annotations.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle to the container object of the loaded annotations.

You can load annotations from multi-page TIF files using the pLoadOptions parameter.

If you have saved a memory handle to a tag in TIF or WANG format, using L_AnnSaveMemory, you must write the memory handle to the tag into a file using L_SetTag and L_SaveBitmapMemory before you can load it using this function

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

If this function returns SUCCESS and phObject is updated with NULL, there are no annotation objects to load.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadOffset, L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | New Annotation Features of Version 14.5

Example

/* This example loads temporary annotations from a file, saves the file in memory,
then loads the memory-resident file into the globally defined container */
HANNOBJECT hContainer; /* Container annotation object */
void TestLoadMemAnn(HWND hWnd)
{
HANNOBJECT TmpContainer; /* Temporary container for the annotations */
HGLOBAL hFileInMemory; /* Memory handle */
L_UINT32 uMemSize; /* Size of the data in memory */
L_UCHAR L_FAR *pData; /* Pointer to the data in memory */
int nRet;
HDC hdc;
RECT rAnnBounds;
RECT rAnnBoundsName;

/* Load the initial annotations */
L_AnnLoad(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TEST.ANN"), &TmpContainer, NULL);
/* Save the annotations as a file in memory */
L_AnnSaveMemory(TmpContainer, ANNFMT_NATIVE, FALSE, &hFileInMemory, &uMemSize, NULL);
/* Destroy the temporary container */
L_AnnDestroy(&TmpContainer, ANNFLAG_RECURSE);
/* Get the pointer to the memory-resident file */
pData = (L_UCHAR L_FAR *)GlobalLock (hFileInMemory);
/* Load the new file from memory */
nRet = L_AnnLoadMemory(pData, uMemSize, &TmpContainer, NULL);
if (nRet == SUCCESS)
{
L_AnnInsert(hContainer, TmpContainer, TRUE);
hdc = GetDC(hWnd);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hdc, &rAnnBounds, hContainer);
}
/* Clean up */
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);
}


L_AnnLoadOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLoadOffset(fd, nOffset, phObject, pLoadOptions)

L_INT fd; | /* Windows file handle of the file to load */
L_INT32 nOffset; | /* position of the first byte to load */
L_UINT32 nLength; | /* number of bytes to read */
pHANNOBJECT phObject; | /* address of the variable to be updated */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads annotations from a position within a file. This enables you to load an annotation file that is embedded in another file. This function is available in the Document/Medical Toolkits.

Parameter | Description
fd | The Windows file handle of the file to load.
nOffset | The position, from the beginning of the file, of the first byte to load. (The byte count starts at zero.)
nLength | The number of bytes of annotation data to read from the file. If you saved the offset using L_AnnSaveOffset, the variable pointed to by puSizeWritten in that function contains the length of data saved. If you do not know the length of the data, pass 0xFFFFFFFF for this parameter.
phObject | Address of the variable to be updated with the handle to the container object of the loaded annotations.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

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

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle to the container object of the loaded annotations.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadMemory, L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | New Annotation Features of Version 14.5

Example

/* This example loads an annotation file with a 30-byte offset. */
/* Refer to L_AnnSaveOffset to see how the test file is created. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnLoadOffset(HWND hWnd)
{
HANNOBJECT TmpContainer;
HFILE OffsetFile; /* File handle */
int nRet;
HDC hdc;
RECT rAnnBounds;
RECT rAnnBoundsName;

/* Open the file and get the file handle */
#ifdef UNICODE

OffsetFile = _wopen(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN"), OF_READ|OF_SHARE_DENY_WRITE );

#else

OffsetFile = _lopen("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN", OF_READ|OF_SHARE_DENY_WRITE );

#endif

/* Load the file with a 30-byte offset */
nRet = L_AnnLoadOffset(OffsetFile, 30, 0xFFFF, &TmpContainer, NULL);
/* if successfully loaded, view them */
if (nRet == SUCCESS)
{
L_AnnInsert(hContainer, TmpContainer, TRUE);
hdc = GetDC(hWnd);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hdc, &rAnnBounds, hContainer);
}
/* Close the file */
_lclose(OffsetFile);
return;
}


L_AnnLock

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLock(hObject, pLockKey, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object*/
L_TCHAR L_FAR * pLockKey; | /* string containing the key */
L_UINT uFlags; | /* flags that determine which objects to process */

Locks one or more annotation objects with the specified key. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pLockKey | Character string containing the key used to lock the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_LOCK menu item has been selected.

Returns

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

Comments

Only unlocked objects can be locked. If an object is already locked, it will stay locked with its original key. You must pass the same key to L_AnnUnlock to unlock the object(s).

An object must be unlocked in order to change that object in automated mode.

Redact objects must be unlocked to be restored (unrealized). Refer to L_AnnUnrealize.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnUnlock, L_AnnShowLockedIcon, L_AnnUnrealize, L_AnnRealize, L_AnnGetSelected, L_AnnSetSelected
Topics | Annotation Functions (Document/Medical ): Security
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Annotation Security

Example

For an example, refer to L_AnnGetLocked.


L_AnnMove

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnMove(hObject, dDx, dDy, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dDx; | /* how much to move the objects horizontally */
L_DOUBLE dDy; | /* how much to move the objects vertically */
L_UINT uFlags; | /* flags that determine which objects to process */

Moves one or more objects, using unscaled delta values. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dDx | How much to move the objects horizontally.
dDy | How much to move the objects vertically.
uFlags | 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 ( | ).
 | Note: The objects within a container move with it, because their coordinates are relative to the container. Therefore, you should not set the ANNFLAG_RECURSE flag if you want to move a container with its objects.
 | The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

The unscaled delta values are relative to the container. They are interpreted by the scalar properties, which are set by the L_AnnSetScalarX and L_AnnSetScalarY functions. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRotate, L_AnnFlip, L_AnnReverse, L_AnnResize
Topics: | Annotation Functions: Doing Geometric Transformations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to L_AnnCopy.


L_AnnPopFixedState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnPopFixedState(hObject, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFlags; | /* flags that determine which objects to process */

Re-enables the ‘fixed’ state of an annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function re-enables the fixed state of one or more annotations. It is to be called after the ‘fixed’ state as been temporarily disabled by a call to L_AnnPushFixedState.

Fixed annotations are independent of the annotation container scalarX, scalarY, offsetX and offsetY properties. The result is that they do not scroll or move with the underlying image. For more information, refer to L_AnnSetScalarX, L_AnnSetScalarY, L_AnnSetOffsetX, and L_AnnSetOffsetY.

In some instances, however, it is necessary to display a fixed annotation at a larger or smaller size than its fixed size. For Example, when using the magnifying glass on a fixed annotation, the annotation needs to be painted larger than normal.

To accommodate, call L_AnnPushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call L_AnnPopFixedState to restore the annotation object’s fixed state.

Typically, you would call L_AnnPushFixedState/L_AnnPopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to L_AnnPushFixedState and L_AnnPopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For Example,

L_AnnPushFixedState(); | Fixed state is temporarily disabled
L_AnnPushFixedState(); | Fixed state is temporarily disabled
L_AnnPopFixedState(); | Fixed state is still disabled
L_AnnPopFixedState(); | Fixed state is enabled

Note that L_AnnPushFixedState and L_AnnPopFixedState should always be called in pairs.

The following annotations cannot be fixed:

ANNOBJECT_CONTAINER

ANNOBJECT_REDACT

ANNOBJECT_ENCRYPT

For more information, refer to Fixed Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFixed, L_AnnIsFixedInRect, L_AnnPushFixedState, L_AnnSetFixed
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Example

// This Example enables the"fixed" property fo 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 API annotation demo.
L_VOID SampleAnnPopFixedState(HANNOBJECT hContainer)
{
L_AnnPopFixedState(hContainer, ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


L_AnnPrint

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnPrint(hDC, prcBounds, hObject)

HDC hDC; | /* handle to the device context (DC) for printing */
LPRECT prcBounds; | /* pointer to the Windows RECT structure for printing */
HANNOBJECT hObject; | /* handle to the annotation object to print */

Prints the specified annotation object, fitting it to a bounding rectangle in the specified device context. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDC | Handle to the device context (DC) where the annotation is to print. The mapping mode of the device context must be MM_TEXT.
prcBounds | Pointer to the Windows RECT structure that defines the bounding rectangle where this function will fit the annotation for printing. To maintain the aspect ratio, this rectangle should have the same proportions as the annotation object that you are printing.
hObject | Handle to the annotation object to print. If you specify a container object, all visible objects in the container will print.

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRealize, L_PrintBitmap
Topics: | Annotation Functions: Input and Output
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Automated User Interface for Annotations

Example

For complete sample code, refer to the ANNOTATE example.

/* This example prints a bitmap and its annotations. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnPrint(HWND hWnd)
{
HDC PrinterDC;
L_INT WidthAllowed, HeightAllowed, WidthFactor, HeightFactor;
L_INT NewWidth, NewHeight;
RECT OutputBounds;
/* Get the HDC for the default printer */
PrinterDC = L_PrintBitmap(NULL, &LeadBitmap, 0, 0, 0, 0, FALSE);
/* Initialize variables for fitting the image to the printer */
WidthAllowed = GetDeviceCaps(PrinterDC, HORZRES);
HeightAllowed = GetDeviceCaps(PrinterDC, VERTRES);
HeightFactor = BITMAPHEIGHT(&LeadBitmap);
WidthFactor = BITMAPWIDTH(&LeadBitmap);
/* See if using the maximum width will make the image too tall */
if((L_INT)(((L_UINT32)WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{ /* Use the maximum width, and calculate the height value */
NewWidth = WidthAllowed;
NewHeight = (L_INT)(((L_UINT32)NewWidth * HeightFactor) / WidthFactor);
}
else
{ /* Use the maximum height, and calculate the width value */
NewHeight = HeightAllowed;
NewWidth = (L_INT)(((L_UINT32)NewHeight * WidthFactor) / HeightFactor);
}
/* Print the bitmap without a page eject */
L_PrintBitmap(PrinterDC, &LeadBitmap, 1, 1, NewWidth, NewHeight, FALSE);
/* Specify the bounding rectangle for the annotation output */
OutputBounds.top = 0;
OutputBounds.left = 0;
OutputBounds.right = NewWidth;
OutputBounds.bottom = NewHeight;
/* Print the annotations */
L_AnnPrint(PrinterDC, &OutputBounds, hContainer);
/* Send the page eject and end the print job */
L_PrintBitmap(NULL, &LeadBitmap, 0, 0, 0, 0, TRUE);
return;
}


L_AnnPushFixedState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnPushFixedState(hObject, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFlags; | /* flags that determine which objects to process */

Temporarily disables the ‘fixed’ state of an annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function temporarily disables the fixed state of one or more annotations.

Fixed annotations are independent of the annotation container scalarX, scalarY, offsetX and offsetY properties. The result is that they do not scroll or move with the underlying image. For more information, refer to L_AnnSetScalarX, L_AnnSetScalarY, L_AnnSetOffsetX, and L_AnnSetOffsetY.

In some instances, however, it is necessary to display a fixed annotation at a larger or smaller size than its fixed size. For Example, when using the magnifying glass on a fixed annotation, the annotation needs to be painted larger than normal.

To accommodate, call L_AnnPushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call L_AnnPopFixedState to restore the annotation object’s fixed state.

Typically, you would call L_AnnPushFixedState/L_AnnPopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to L_AnnPushFixedState and L_AnnPopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For Example,

L_AnnPushFixedState(); | Fixed state is temporarily disabled
L_AnnPushFixedState(); | Fixed state is temporarily disabled
L_AnnPopFixedState(); | Fixed state is still disabled
L_AnnPopFixedState(); | Fixed state is enabled

Note that L_AnnPushFixedState and L_AnnPopFixedState should always be called in pairs.

The following annotations cannot be fixed:

ANNOBJECT_CONTAINER

ANNOBJECT_REDACT

ANNOBJECT_ENCRYPT

For more information, refer to Fixed Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFixed, L_AnnIsFixedInRect, L_AnnPopFixedState, L_AnnSetFixed, L_AnnSetTicMarkLength
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Example

// 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 API annotation demo.
L_VOID SampleAnnPushFixedState(HANNOBJECT hContainer)
{
L_AnnPushFixedState(hContainer, ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


L_AnnRealize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnRealize(pBitmap, prcBounds, hObject, fRedactOnly)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT prcBounds; | /* pointer to the bounding rectangle for drawing */
HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fRedactOnly; | /* flag that indicates which objects to realize */

Applies the specified annotation objects to a bitmap, altering the bitmap, itself. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to update.
prcBounds | Pointer to the Windows RECT structure that specifies the bounding rectangle where the annotations will be drawn.
 | You can pass NULL for the default, which matches the bitmap by specifying left = 0, top = 0, right = bitmap width, and bottom = bitmap height.
hObject | Handle to the annotation object.
fRedactOnly | Flag that indicates which objects to realize. Possible values are:
 | Value | Meaning
 | TRUE | Realize only redaction objects
 | FALSE | Realize any visible object.

Returns

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

Comments

If you specify a container object, all annotations in the container are realized. You can specify redaction only if you only want to realize redaction objects, which are used for hiding information.

If you realize a redact object, moving the redact object will leave the original location of the redact object hidden. To restore the image under the redact object (so that when you move the redact object, the underlying image is not hidden), you must unrealize the redact object by calling L_AnnUnrealize.

This function is implemented by treating the bitmap as a device context and drawing the annotations in the device context.

When you call L_AnnRealize with fRedactOnly set to TRUE, the background behind the redact object is saved into the redact object. That background info is saved together with the object and can be restored later with L_AnnUnrealize. If a REDACT object has a bitmap already, then the background is not saved. The background is saved inside locked objects, too. This way, complete security can be implemented. If it is desired for some portion of the image to be hidden, a REDACT object can be placed on top and L_AnnRealize with fRedactOnly set to true can be called. The bitmap under the object is changed and that portion is saved inside the Redact object. Next, the object is locked and saved together with the bitmap. To restore the original image, the redact objects have to be unlocked with the correct key and then L_AnnUnrealize must be called each time a Redact object is unlocked.

Encryptor objects cannot be realized. The encryptor is the only annotation object that cannot be realized.

This function 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 L_ColorResBitmap to change the image to a supported bits per pixel before calling L_AnnRealize.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnPrint, L_AnnUnrealize, L_AnnGetLocked, L_AnnLock, L_AnnUnlock, L_AnnShowLockedIcon
Topics: | Annotation Functions: Input and Output
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

For complete sample code, refer to the ANNOTATE example.

/* This example realizes all objects, using the default rectangle */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestAnnRealize(HANNOBJECT hAnnObject)
{
HANNOBJECT RootContainer; /* Root container */
/* Get the root container */
L_AnnGetTopContainer(hAnnObject, &RootContainer);
/* Realize all objects */
L_AnnRealize(&LeadBitmap, NULL, RootContainer, FALSE);
return;
}


L_AnnRemove

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnRemove(hObject)

HANNOBJECT hObject;

/* handle to the annotation object */

Removes the specified annotation object from its current container, leaving the object with no container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.

Returns

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

Comments

If you want the object to be inserted into another container, such as the main container of the display, you must use the L_AnnInsert function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnInsert, L_AnnGetContainer, L_AnnGetTopContainer, L_AnnEnumerate, L_AnnGetItem, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, L_AnnRestrictCursor, L_AnnSetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Implementing Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

/* This example removes an object from its container and inserts it into the root container */
void TestAnnRemove(HANNOBJECT hAnnObject)
{
HANNOBJECT RootContainer; /* Root container */
/* Get the root container */
L_AnnGetTopContainer(hAnnObject, &RootContainer);
/* Remove the object from its current container */
L_AnnRemove(hAnnObject);
/* Insert the object into the root container */
L_AnnInsert(RootContainer, hAnnObject, FALSE);
return;
}


L_AnnResize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnResize(hObject, dFactorX, dFactorY, pCenter, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dFactorX; | /* factor by which to change the width of the object */
L_DOUBLE dFactorY; | /* factor by which to change the height of the object */
pANNPOINT pCenter; | /* pointer to the point that is to remain stationary */
L_UINT uFlags; | /* flags that determine which objects to process */

Changes the size of one or more annotation objects, letting you specify the point that is to remain stationary. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dFactorX | Factor by which to change the width of the object, used as follows:
 | New width = Old width * dFactorX
dFactorY | Factor by which to change the height of the object, used as follows:
 | New height = Old height * dFactorY
pCenter | Pointer to an ANNPOINT structure that specifies the point that is to remain stationary.
 | You can pass NULL to use the default, which is the center of the object. If more than one object is selected, each object is resized on its own center.
 | The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
 | Coordinates of the point 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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function uses unscaled values that are relative to the container object. For more information, refer to Low-Level Coordinate System for Annotations.

This function applies to multiple and selected objects based on values of the uFlags parameter.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRotate, L_AnnMove, L_AnnFlip, L_AnnReverse
Topics: | Annotation Functions: Doing Geometric Transformations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

/* This example resizes the container and all objects in it */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnResize(void)
{
ANNPOINT ResizePt; /* Point to remain stationary */
/* Set the origin of the container rectangle as the point to remain stationary */
ResizePt.x = 0;
ResizePt.y = 0;
/* Resize the container and all objects in it, reducing the size by half */
L_AnnResize(hContainer, (L_DOUBLE) 0.5,(L_DOUBLE) 0.5, &ResizePt, ANNFLAG_RECURSE);
return;
}


L_AnnRestrictCursor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnRestrictCursor( hContainer, lpRect, pPoint, prcOldClip, bRestrictClient)

HANNOBJECT hContainer; | /* handle to the container object */
LPRECT lpRect; | /* pointer to a RECT structure */
LPPOINT pPoint; | /* pointer to a POINT structure */
LPRECT prcOldClip; | /* pointer a RECT structure that contains the previous clip rectangle */
L_BOOL bRestrictClient; | /* flag that specifies whether the cursor is restricted to the client window */

Restricts the mouse cursor in conjunction with annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle to the container object
lpRect | Pointer to a RECT structure that contains the rectangle within which the cursor is restricted .
pPoint | Pointer to a POINT structure that contains the point around which the lpRect rectangle is centered.
prcOldClip | Pointer to a RECT structure that contains the previous clip rectangle.
bRestrictClient | Flag that specifies whether the cursor is restricted to the client window. Possible values are:
 | Value | Meaning
 | TRUE | Restrict the cursor to the client window.
 | FALSE | Do not restrict the cursor to the client window.

Returns

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

Comments

This function is used to restrict the mouse cursor. It should be used when creating custom annotation objects.

Calling this function always restricts the mouse cursor to the annotation container. However, depending on the arguments passed, the mouse cursor can be restricted further .

This function can be used in the following ways:

To restrict the cursor to the bounds of the container, pass NULL for lpRect and NULL for pPoint.

To restrict the cursor to a box around pPoint (and the container), pass pPoint and lpRect. This is used to restrict movement when dragging an annotation. The pPoint parameter specifies the location at which the user begins the dragging operation by pressing the mouse button. The lpRect parameter specifies the bounding box of the annotation. Calling this function 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 lpRect and NULL for pPoint.

To do the above, and also restrict to the client area, set bRestrictClient to TRUE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnRestrictCursor, L_AnnSetRestrictToContainer, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// Example for L_AnnConvert, L_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.
L_VOID ExampleAnnRestrictCursor(HANNOBJECT hObject)
{
L_UINT uType;
ANNRECT arcBounds;
RECT rcBounds;
HANNOBJECT hContainer;
RECT rcClipOld;

L_AnnGetType(hObject, &uType);

if ((uType != ANNOBJECT_AUTOMATION) && (uType != ANNOBJECT_CONTAINER))
{
L_AnnGetTopContainer(hObject, &hContainer);
L_AnnGetRect(hObject, &arcBounds, NULL);
L_AnnConvert(hObject, (LPPOINT)&rcBounds, (pANNPOINT)&arcBounds, 2, ANNCONVERT_TO_CLIENT);

rcBounds.left -= 10;
rcBounds.top -= 10;
rcBounds.right += 10;
rcBounds.bottom += 10;

L_AnnRestrictCursor(hContainer, &rcBounds, NULL, &rcClipOld, FALSE);

// When done with restricting cursor, call the line below
// ClipCursor(&rcClipOld);
}
}


L_AnnReverse

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnReverse(hObject, pCenter, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINT pCenter; | /* pointer to the center of rotation */
L_UINT uFlags; | /* flags that determine which objects to process */

Reverses one or more annotation objects, left to right. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pCenter | Pointer to the LEADTOOLS ANNPOINT structure that specifies the center of rotation.
 | Pass NULL in this parameter to use the default for each affected object. With the default, if a container is reversed, all objects in it are reversed as a unit, using the container's center as the axis. If an individual object is reversed, it is reversed on its own center.
 | The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
 | 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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

You cannot flip or reverse an object that contains text. If you flip or reverse a container that includes text, the text will move to the new position, but will retain its orientation.

L_AnnReverse does not change the bitmap of a Point annotation object. It only changes the position of the point. To change the bitmap you must get the bitmap using L_AnnGetBitmap, change the bitmap, and then set the bitmap using L_AnnSetBitmap.

The center of a protractor object is the angle point (vertex). The center of a cross-product is the intersection of the two rulers. If you pass NULL for pCenter, these center points will be used instead of the center of the bounding rectangle when reversing the object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRotate, L_AnnMove, L_AnnFlip, L_AnnResize
Topics: | Annotation Functions: Doing Geometric Transformations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects
 | Flipping, Reversing and Rotating Annotation Objects

Example

/* This example reverses an object on its own center */
void TestAnnReverse (HANNOBJECT hAnnObject)
{
ANNPOINT RotationPt; /* Point of rotation */
ANNRECT ObjectRect; /* Defining rectangle of this object */
ANNRECT ObjectRectName;
/* Get the object's rectangle to use for calculating rotation */
L_AnnGetRect(hAnnObject, &ObjectRect, &ObjectRectName);
/* Specify the horizontal point of rotation (the object's own center ) */
RotationPt.x = ObjectRect.left + ((ObjectRect.right - ObjectRect.left) / 2);
/* Reverse the object */
L_AnnReverse(hAnnObject, &RotationPt, 0);
return;
}


L_AnnRotate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnRotate(hObject, dAngle, pCenter, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dAngle; | /* angle of rotation */
pANNPOINT pCenter; | /* pointer to the center of rotation */
L_UINT uFlags; | /* flags that determine which objects to process */

Rotates one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dAngle | The angle of rotation, expressed in double-precision floating point.
pCenter | Pointer to the LEADTOOLS ANNPOINT structure that specifies the center of rotation.
 | Pass NULL in this parameter to use the default for each affected object. With the default, if a container is rotated, all objects in it are rotated as a unit, using the container's center as the axis. If an individual object is rotated, it is rotated on its own center.
 | The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
 | 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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

You cannot rotate a note, hot spot, button, or audio clip. If you rotate a container that includes these objects, they will move to new positions, but will retain their orientation.

L_AnnRotate does not change the bitmap of a Point annotation object. It only changes the position of the point. To change the bitmap you must get the bitmap using L_AnnGetBitmap, change the bitmap, and then set the bitmap using L_AnnSetBitmap.

The center of a protractor object is the angle point (vertex). The center of a cross-product is the intersection of the two rulers. If you pass NULL for pCenter, these center points will be used instead of the center of the bounding rectangle when rotating the object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnMove, L_AnnFlip, L_AnnReverse, L_AnnResize
Topics: | Annotation Functions: Doing Geometric Transformations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects
 | Flipping, Reversing and Rotating Annotation Objects

Example

/* This example rotates an object using its lower right corner as the center of rotation */
void TestAnnRotate(HANNOBJECT hAnnObject)
{
ANNPOINT RotationPt; /* Point of rotation */
ANNRECT ObjectRect; /* Defining rectangle of this object */
ANNRECT ObjectRectName;

/* Get the object's rectangle to use for calculating rotation */
L_AnnGetRect(hAnnObject, &ObjectRect, &ObjectRectName);
/* Specify the point of rotation (the object's lower right corner ) */
RotationPt.x = ObjectRect.right;
RotationPt.y = ObjectRect.bottom;
/* Rotate the object 90 degrees clockwise */
L_AnnRotate(hAnnObject, 90, &RotationPt, 0);
return;
}


L_AnnSave

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSave(pFile, hObject, uFormat, fSelected, pSaveOptions)

L_TCHAR L_FAR * pFile; | /* name of the file to save */
HANNOBJECT hObject; | /* handle to the root annotation */
L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL fSelected; | /* flag that indicates which objects to save*/
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves annotations in the specified file. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFile | Character string containing the name of the file to save.
hObject | Handle to the root annotation object that includes all objects to save in the file. This typically is a container object.
uFormat | Format for saving annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
 | ANNFMT_WMF | [0x0001] Use the Windows WMF format.
 | ANNFMT_ENCODED | [0x0004] Save as a binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_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 ANNFMT_NATIVE.
fSelected | Flag that indicates which objects to save. Possible values are:
 | Value | Meaning
 | TRUE | Save all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | FALSE | Save only the specified object.
pSaveOptions | Pointer to a SAVEFILEOPTION structure that contains optional extended save options. This information is used to add annotation pages or replace annotation pages in a multi-page annotation file. Pass NULL to save a one page annotation file.

Returns

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

Comments

In version 14.5, the new text based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

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

Save annotations in the WMF format only for use in another application. LEADTOOLS reads annotations only in the native format.

To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the hObject and fSelected parameters as follows:

To save the specified object, set hObject to that object and set fSelected to FALSE.

To save only selected objects in a container, set hObject to the container and set fSelected to TRUE.

To save all objects in a container, set hObject to the container and set fSelected to FALSE.

To save an annotation to a TIF file as a tag, call L_AnnSaveTag.

The information in the SAVEFILEOPTION structure can be used to add new pages or replace existing pages in a multi-page annotation file of type ANNFMT_NATIVE, ANNFMT_ENCODED or ANNFMT_XML. Note that all the pages of an annotation multi-page file must be all of type ANNFMT_NATIVE or all of type ANNFMT_ENCODED or all of type ANNFMT_XML. An annotation file cannot contain pages of different format types.

To insert new pages to an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_INSERTPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the location for insertion. The new page will be inserted in front of the page specified in the PageNumber field.

To replace an existing page in an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_REPLACEPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the page to replace.

To delete a page from an annotation multi-page file, use L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnSaveMemory, L_AnnSaveOffset, L_AnnSaveTag, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | New Annotation Features of Version 14.5

Example

For complete sample code, refer to the ANNOTATE example.

For another example, refer to L_AnnFileInfo.

/* This example saves currently selected annotations in a file */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnSave (void)
{
int nRet;
nRet = L_AnnSave(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\TEST.ANN"), hContainer, ANNFMT_NATIVE, FALSE, NULL);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("Annotations saved"), TEXT("Notice"), MB_OK);
return;
}


L_AnnSaveMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSaveMemory(hObject, uFormat, fSelected, phMem, puMemSize, pSaveOptions)

HANNOBJECT hObject; | /* handle to the root annotation */
L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL fSelected; | /* flag that indicates which objects to save */
HGLOBAL L_FAR * phMem; | /* address of the memory handle */
L_UINT32 L_FAR * puMemSize; | /* address of the variable to be updated */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves the specified annotations to a file in memory. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the root annotation object that includes all objects to save in the file. This typically is a container object.
uFormat | Format for saving annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
 | ANNFMT_WMF | [0x0001] Use the Windows WMF format.
 | ANNFMT_TIFFTAG | [0x0002] Save all annotation properties, including those not supported by the Wang specification as an ANNTAG_TIFF tag.
 | ANNFMT_WANGTAG | [0x0003] Save only the annotation properties supported by the Wang specification as an ANNTAG_TIFF tag.
 | ANNFMT_ENCODED | [0x0004] Save as a binary format. This file size is smaller and upward compatible. It also provides better security.
 | ANNFMT_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 ANNFMT_NATIVE.
fSelected | Flag that indicates which objects to save. Possible values are:
 | Value | Meaning
 | TRUE | Save all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | FALSE | Save only the specified object.
phMem | Address of a variable to be updated with the memory handle. This function uses the handle to allocate the memory. It unlocks the memory upon completion of the save.
puMemSize | Address of a variable to be updated with the size of the file.
pSaveOptions | Pointer to a SAVEFILEOPTION structure that contains optional extended save options. This information is used to add annotation pages or replace annotation pages in a multi-page annotation file. Pass NULL to save a one page annotation file.

Returns

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

Comments

In version 14.5, the new text based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

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.

Save annotations in the WMF format only for use in another application. LEADTOOLS reads annotations only in the native format.

To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the hObject and fSelected parameters as follows:

To save the specified object, set hObject to that object and set fSelected to FALSE.

To save only selected objects in a container, set hObject to the container and set fSelected to TRUE.

To save all objects in a container, set hObject to the container and set fSelected to FALSE.

L_AnnSaveTag is an alternative to L_AnnSaveMemory and L_AnnSetTag, if you are going to save it as a TIF or WANG tag format

Both the ANNFMT_TIFFTAG and the ANNFMT_WANGTAG can be saved inside a TIFF file using L_SetTag with uTag set to ANNTAG_TIFF and uType set to TAG_BYTE.

To detect whether a TIF file has annotation information, you should call L_ReadFileTag and see if ANNTAG_TYPE is present.

If uFormat is ANNFMT_NATIVE, phMem is updated with a memory handle to the annotation file in memory.

If uFormat is ANNFMT_TIFFTAG or ANNFMT_WANGTAG, phMem is updated with a memory handle to the tag.

If you save a memory handle to a tag in TIF or WANG format, using L_AnnSaveMemory, you must write the memory handle to the tag into a file using L_SetTag and L_SaveBitmapMemory before you can load it using the L_AnnLoadMemory function.

If this function returns SUCCESS and phMem is updated with NULL, there are no annotations objects to save.

The information in the SAVEFILEOPTION structure can be used to add new pages or replace existing pages in a multi-page annotation file of type ANNFMT_NATIVE, ANNFMT_ENCODED or ANNFMT_XML. Note that all the pages of an annotation multi-page file must be all of type ANNFMT_NATIVE or all of type ANNFMT_ENCODED or all of type ANNFMT_XML. An annotation file cannot contain pages of different format types.

To insert new pages to an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_INSERTPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the location for insertion. The new page will be inserted in front of the page specified in the PageNumber field.

To replace an existing page in an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_REPLACEPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the page to replace.

To delete a page from an annotation multi-page file, use L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset.

When adding or replacing an annotation page in an existing memory file, pass the address of a valid HGLOBAL hMem (non zero). When creating a new memory file, declare a variable of type HGLOBAL and set it to zero before passing the address to L_AnnSaveMemory.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnSave, L_AnnSaveOffset, L_AnnSaveTag, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | New Annotation Features of Version 14.5

Example

For another example, refer to L_AnnFileInfoMemory.

void TestAnnSaveMem (HWND hWnd, HANNOBJECT hContainer)
{
HANNOBJECT TmpContainer; /* Temporary container for the annotations */
HGLOBAL hTag; /* Memory handle */
L_UINT32 uMemSize; /* Size of the data in memory */
L_UCHAR L_FAR *pData; /* Pointer to the data in memory */
int nRet;
HDC hdc;
RECT rAnnBounds;
RECT rAnnBoundsName;

/* Load the initial annotations */
L_AnnLoad(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\TEST.ANN"), &TmpContainer, NULL);
/* Save the annotations as a TIFF TAG in memory */
hTag = 0;
L_AnnSaveMemory(TmpContainer, ANNFMT_TIFFTAG, FALSE, &hTag, &uMemSize, NULL);

/* Get the pointer to the memory-resident tag */
pData = (L_UCHAR L_FAR *) GlobalLock (hTag);

/* Set the tag so when the bitmap is saved as TIFF, the tag
is also saved */
L_SetTag(ANNTAG_TIFF, TAG_BYTE, uMemSize, pData);

/* Destroy the temporary container */
L_AnnDestroy(&TmpContainer, ANNFLAG_RECURSE);

/* Load the new file from memory */
nRet = L_AnnLoadMemory(pData, uMemSize, &TmpContainer, NULL);

if (nRet == SUCCESS)
{
/* Insert the annotations into the main container, hContainer, so they will be active. */
L_AnnInsert(hContainer, TmpContainer, TRUE);
hdc = GetDC(hWnd);
L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hdc, &rAnnBounds, hContainer);
}

/* Clean up */
GlobalUnlock (hTag);
GlobalFree (hTag);
}


L_AnnSaveOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSaveOffset(fd, nOffset, puSizeWritten, hObject, uFormat, fSelected, pSaveOptions)

L_INT fd; | /* Windows file handle of the file to save */
L_INT32 nOffset; | /* where to embed the saved annotation file */
L_UINT32 L_FAR * puSizeWritten; | /* address of the variable to be updated */
HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL fSelected; | /* flag that indicates which objects to save */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves the specified annotations at a specified position in an existing file. This function is available in the Document/Medical Toolkits.

Parameter | Description
fd | The Windows file handle of the file to save.
nOffset | The offset within the specified file to embed the saved annotation file. For example, if you specify 5, then 5 bytes of other data will precede the embedded file.
puSizeWritten | Address of a variable to be updated with the size of the embedded file.
hObject | Handle to the annotation object.
uFormat | Format for saving annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | [0x0000] Use LEAD's own format for annotations. NOTE: This format is being replaced by ANNFMT_XML.
 | ANNFMT_WMF | [0x0001] Use the Windows WMF format.
 | ANNFMT_ENCODED | [0x0004] Save as a binary format. This file size is smaller and upward compatible. It also provides better security.
 | ANNFMT_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 ANNFMT_NATIVE.
fSelected | Flag that indicates which objects to save. Possible values are:
 | Value | Meaning
 | TRUE | Save all objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | FALSE | Save only the specified object.
pSaveOptions | Pointer to a SAVEFILEOPTION structure that contains optional extended save options. This information is used to add annotation pages or replace annotation pages in a multi-page annotation file. Pass NULL to save a one page annotation file.

Returns

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

Comments

In version 14.5, the new text based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

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.

Save annotations in the WMF format only for use in another application. LEADTOOLS reads annotations only in the native format.

To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the hObject and fSelected parameters as follows:

To save the specified object, set hObject to that object and set fSelected to FALSE.

To save only selected objects in a container, set hObject to the container and set fSelected to TRUE.

To save all objects in a container, set hObject to the container and set fSelected to FALSE.

This function overwrites existing data at the specified location in the file. You can use this function to update an image that you loaded with the L_AnnLoadOffset function. The offset is specified in bytes. You must open the file and get a Windows file handle before calling this function.

Before calling this function, you must declare a variable of data type L_UINT32. Then, pass the address of the variable in the puSizeWritten parameter. This function will update the variable with the size of the embedded file.

The information in the SAVEFILEOPTION structure can be used to add new pages or replace existing pages in a multi-page annotation file of type ANNFMT_NATIVE, ANNFMT_ENCODED or ANNFMT_XML. Note that all the pages of an annotation multi-page file must be all of type ANNFMT_NATIVE or all of type ANNFMT_ENCODED or all of type ANNFMT_XML. An annotation file cannot contain pages of different format types.

To insert new pages to an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_INSERTPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the location for insertion. The new page will be inserted in front of the page specified in the PageNumber field.

To replace an existing page in an annotation multi-page file:

1. | Declare a variable of type SAVEFILEOPTION.
2. | Set the uFlags field of the SAVEFILEOPTION structure to ESO_REPLACEPAGE.
3. | Set the PageNumber field of the SAVEFILEOPTION structure to the page to replace.

To delete a page from an annotation multi-page file, use L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnSave, L_AnnSaveMemory, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Files
 | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For another example, refer to L_AnnFileInfoOffset.

void TestAnnSaveOffset(HANNOBJECT hContainer)
{
HFILE NewFile; /* File handle */
int nRet;

L_UINT32 SizeWritten; /* Variable to be updated with the size written */
/* Create a file */
#ifdef UNICODE

NewFile = _wcreat(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN"), 0);

#else

NewFile = _lcreat("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN", 0);

#endif

/* Write header information -- 29 characters and a terminator */
_lwrite(NewFile, "This is a 29-character string", 30);
/* Save the file with an offset */
nRet = L_AnnSaveOffset(NewFile, 30, &SizeWritten, hContainer, ANNFMT_NATIVE, FALSE, NULL);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("File saved with offset"), TEXT("Notice"), MB_OK);
/* Close the file */
_lclose(NewFile);
return;
}


L_AnnSaveTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSaveTag(hObject, uFormat, fSelected)

HANNOBJECT hObject; | /* handle of the root annotation object */
L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL fSelected; | /* flag that indicates which objects to save */

Copies the annotation objects into a memory location so that the next TIFF saved will contain these annotations in a Wang compatible TIFF tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the root annotation object.
uFormat | File format to use when saving the annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_TIFFTAG | [0x0002] Save the object in WANG format, along with all LEAD properties not supported by the Wang specification.
 | ANNFMT_WANGTAG | [0x0003] Save only the properties supported by the Wang specification.
fSelected | Flag that indicates which objects to save. Possible values are:
 | Value | Meaning
 | TRUE | Save all selected objects.
 | FALSE | Save only the specified object.

Returns

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

Comments

After calling this function, saving an image as a TIFF format will cause the annotations to be saved in a tag in the TIFF file. This function is the equivalent of the following:

HGLOBAL hMem;
L_UINT32 ulSize;

// save the annotations to memory
L_AnnSaveMemory(hObject, uFormat, fSelected, &hMem &ulSize);

// store a copy of the annotations in LTFIL
L_SetTag(ANNTAG_TIFF, TAG_BYTE, ulSize, GlobalLock(hMem));

// free the memory handle, since LTFIL has a copy
GlobalUnlock(hMem);
GlobalFree(hMem);

The annotations will not be saved unless you also save an image in one of the TIFF formats (FILE_TIF_JPEG, FILE_CCITT, FILE_TIF, FILE_TIFLZW, FILE_CCITT_GROUP3_1DIM, FILE_CCITT_GROUP3_2DIM, FILE_CCITT_GROUP4, FILE_TIF_CMYK, FILE_TIFLZW_CMYK, FILE_TIF_PACKBITS, FILE_TIF_PACKBITS_CMYK, FILE_TIF_YYC, FILE_TIFLZW_YYC, FILE_TIF_PACKBITS_YCC, FILE_TIF_CMP, FILE_TIF_JBIG).

This tag can be cleared using L_SetTag like this:

L_SetTag(ANNTAG_TIFF, 0, 0, NULL);

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSave, L_AnnSaveMemory, L_SetTag, L_DeleteTag
Topics | Annotation Functions (Document/Medical only): Saving Annotation Files
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Annotation Files

Example:

/*This example saves all annotations in a container in a Wang compatible TIFF tag. The page and annotations are appended to the end of the file. Note that saving the annotation, as ANNFMT_WANGTAG will lose some objects/properties not supported by the Wang specification. If don't want to lose any information, save the annotations as ANNFMT_TIFFTAG instead.*/
HANNOBJECT hContainer; /* Container object */
void TestAnnSaveTag(void)
{
L_INT nRet;
SAVEFILEOPTION SaveFileOption;
BITMAPHANDLE LeadBitmap;

L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
SaveFileOption.PageNumber = 2; // append the page

/* set Wang Compatibility mode for annotations */
nRet = L_AnnSaveTag(hContainer, ANNFMT_WANGTAG, TRUE);
if(nRet != SUCCESS)
MessageBox(NULL, TEXT("Error creating annotation data.\n")
TEXT("The file will be saved without annotations.\n\n"),
TEXT("Annotation Error"),
MB_OK);
/* Save the bitmap to a file, with the tag. */
L_SaveBitmap(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TEST.TIF"), &LeadBitmap, FILE_TIF, 0,
0, &SaveFileOption);
}


L_AnnSelectPoint

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSelectPoint(hObject, pPoint)

HANNOBJECT hObject; | /* handle to the annotation object */
LPPOINT pPoint; | /* pointer to the Windows POINT structure */

Selects the annotation object at the specified point, relative to the window. If objects overlap, this function selects the front object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPoint | Pointer to the Windows POINT structure. Coordinates are relative to the associated window's client area.

Returns

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

Comments

Selecting an object sets its selected property to TRUE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

/* This example selects an object at a particular point in the window, changes the
background color of selected object, and updates the display. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnSelectPoint(HWND hWnd)
{
RECT rClientArea; /* Client area of the current window */
POINT SelectionPoint; /* Point in the client area */
HDC hWindowDC; /* Device context of the current window */
RECT rAnnBounds; /* Bounding rectangle when displaying the note */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Select an object in the top left part of the window */
SelectionPoint.y = rClientArea.bottom / 4;
SelectionPoint.x = rClientArea.right / 4;
L_AnnSelectPoint(hContainer, &SelectionPoint);
/* Set the background color of the selected object */
L_AnnSetBackColor(hContainer, RGB(255,0,0),
ANNFLAG_SELECTED|ANNFLAG_RECURSE);
/* Get the bounding rectangle of the selected object */
L_AnnGetSelectRect(hContainer, &rAnnBounds);
/* Get the window's device context */
hWindowDC = GetDC (hWnd);
/* Display the change */
L_AnnDraw(hWindowDC, &rAnnBounds, hContainer);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return;
}


L_AnnSelectRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSelectRect(hObject, pRect)

HANNOBJECT hObject; | /* handle to the annotation object */
LPRECT pRect; | /* pointer to the Windows RECT structure */

Selects all objects within the specified rectangle, relative to the window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRect | Pointer to the Windows RECT structure. Coordinates are relative to the associated window's client area.

Returns

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

Comments

Selecting an object sets its selected property to TRUE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnSetSelected, L_AnnGetSelected, L_AnnGetSelectItems
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

/* This example selects all objects in the top half of the client area, changes the
background color of selected objects, and updates the display. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnSelectRect(HWND hWnd)
{
RECT rClientArea; /* Client area of the current window */
RECT rSelectionRect; /* Bounding rectangle of selected objects */
HDC hWindowDC; /* Device context of the current window */
RECT rAnnBounds; /* Bounding rectangle when displaying the note */
L_UINT SelectCount; /* Number of objects selected */
L_TCHAR szMessage[80]; /* Message buffer */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Select the objects in the top half of the client area. Notice that
some adjustments are required to ensure that the specified rectangle encloses
all objects in the top half of the client area. */
rSelectionRect.top = rClientArea.top - 1;
rSelectionRect.left = rClientArea.left -1;
rSelectionRect.right = rClientArea.right + 2;
rSelectionRect.bottom = (rClientArea.bottom / 2) + 2;
L_AnnSelectRect(hContainer, &rSelectionRect);
/* Set the background color of selected objects */
L_AnnSetBackColor(hContainer, RGB(255,0,0),
ANNFLAG_SELECTED|ANNFLAG_RECURSE);
/* Get the bounding rectangle of selected objects */
L_AnnGetSelectRect(hContainer, &rAnnBounds);
/* Get the window's device context */
hWindowDC = GetDC (hWnd);
/* Display the change */
L_AnnDraw(hWindowDC, &rAnnBounds, hContainer);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
/* Get the number of objects selected */
L_AnnGetSelectCount(hContainer, &SelectCount);
/* Display a message box with the result */
wsprintf (szMessage, TEXT("%d objects selected"), SelectCount);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
return;
}


L_AnnSendToBack

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSendToBack(hObject)

HANNOBJECT hObject;

/* handle to the annotation object */

Reorders the specified annotation object so that it is displayed behind other objects in the same container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.

Returns

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

Comments

This function moves the object to the beginning of the enumeration order for objects in the same container. When the container is displayed, using the L_AnnDraw function, this object is displayed first.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDraw, L_AnnBringToFront, L_AnnGetBoundingRect
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnBringToFront.


L_AnnSetActiveState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetActiveState(hObject, uState)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uState; | /* constant that indicates whether the object is enabled or disabled */

Sets the activation state of an annotation object. If an annotation object is active, it will respond to activation events. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uState | The constant that indicates whether the object is enabled or disabled. Possible values are:
Value | Meaning
ANNACTIVE_DISABLED | [0] The object will not respond to activation events.
ANNACTIVE_ENABLED | [1] The object will respond to activation events.

Returns

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

Comments

The following types of objects, respond to activation events:

Automation object

Audio clip

Button

Hot spot

Freehand Hot spot

Push pin

For descriptions of the various types of objects and their properties, refer to Types of Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetActiveState, L_AnnGetUserMode, L_AnnSetUserMode
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to the TestCreateButtonAnn procedure in Using Non automated Annotations in Run Mode.

For an example of how the tag of an activated object is used, refer to the L_AnnGetTag function. */

For complete sample code, refer to the ANNOTATE example.


L_AnnSetAutoBackColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoBackColor(hObject, uObjectType, crBack)

HANNOBJECT hObject; | /* handle to the automation object */
L_UINT uObjectType; | /* object type */
COLORREF crBack; | /* COLORREF value that specifies the background color */

Sets the background color of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uObjectType | Type of the object, which is having its background color changed. For a list of possible values, refer to Types of Annotations.
crBack | The COLORREF value that specifies the background color.

Returns

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

Comments

This function does not affect objects that do not have this property or that do not let you change the property. The automation back color is used as a default for all annotation objects that are created (using automation) from that point on. For descriptions of the various types of objects and their properties, refer to Types of Annotations. Please note the following:

if uObjectType is: | then the background color is changed for:
ANNOBJECT_NOTE or ANNOBJECT_PUSHPIN | Note objects and push pin objects created by the automation object
ANNOBJECT_HILITE | Hilite objects created by the automation object.
ANNOBJECT_REDACT | Redact objects created by the automation object.
any other object such as ANNOBJECT_TEXT, ANNOBJECT_RECT, etc. | All other objects, created by the automation object, which have a background color property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoBackColor, L_AnnGetBackColor, L_AnnSetBackColor, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Changing the Annotation Automation Background Colors
 | Altering Annotation Object Settings
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_AnnGetAutoBackColor.


L_AnnSetAutoContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoContainer(hObject, hContainer)

HANNOBJECT hObject; | /* handle to an annotation automation object */
HANNOBJECT hContainer; | /* handle to the container */

Specifies the container for the automation object. The automation object is used to implement default properties. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an annotation automation object.
hContainer | Handle to the container.

Returns

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

Comments

This function associates the automation object with a root container without inserting the object into the container.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetAutoCursor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoCursor(hAutomation, uItem, hCursor)

HANNOBJECT hAutomation; | /* handle to an automation object */
L_UINT uItem; | /* value that specifies the cursor to be displayed */
HCURSOR hCursor; | /* handle to a windows cursor */

Sets one of the cursors associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the annotation automation object.
uItem | Value that specifies the cursor to be displayed on various actions. Possible values are:
 | Value | Meaning
 | ANNAUTOCURSOR_DEFAULT | [0] Displayed when cursor is over the annotation container, and other action is occuring. The default is the windows predefined cursor IDC_ARROW.
 | ANNAUTOCURSOR_DRAWNEW | [1] Displayed when drawing a new annotation (design mode). This is displayed on all tools except for ANNTOOL_SELECT.
 | ANNAUTOCURSOR_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:
 |  | ANNOBJECT_BUTTON
 |  | ANNOBJECT_HOTSPOT
 |  | ANNOBJECT_FREEHANDHOTSPOT
 |  | ANNOBJECT_AUDIO
 |  | ANNOBJECT_VIDEO
 |  | ANNOBJECT_PUSHPIN
 | ANNAUTOCURSOR_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).
 | ANNAUTOCURSOR_SELECT | [5] Displayed in design mode, when hovering over an unselected annotation. The default is the windows predefined cursor IDC_IBEAM.
 | ANNAUTOCURSOR_TEXT | [6] Displayed in design mode, when entering text into one of the following text annotations:
 |  | ANNOBJECT_TEXT
 |  | ANNOBJECT_TEXTPOINTER
 |  | ANNOBJECT_RTF
 |  | ANNOBJECT_NOTE
 | The default is the windows predefined cursor IDC_IBEAM.
 | ANNAUTOCURSOR_WAIT | [7] Displayed during the wait operation. The default is the hourglass.
 | ANNAUTOCURSOR_ROTATE_GRIPPER | [8] Displayed when hovering over a gripper rotate handle. The rotate handles are displayed only after calling L_AnnSetOptions.
 | ANNAUTOCURSOR_ROTATE_CENTER | [9] Displayed when hovering over rotate center handle. The rotate handles are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_ROTATE).
 | The following cursors are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_CURSORS).
 | ANNAUTOCURSOR_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 L_AnnSetOptions(hAutomation, OPTIONS_NEW_SIDE_HANDLES).
 | ANNAUTOCURSOR_SIZENESW | [11] Displayed when hovering over the North-east or South-west select handles in a rectangular object.
 | ANNAUTOCURSOR_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 L_AnnSetOptions (hAutomation, OPTIONS_NEW_SIDE_HANDLES).
 | ANNAUTOCURSOR_SIZENWSE | [13] Displayed when hovering over the North-west or South-east select handles in a rectangular object.
 | ANNAUTOCURSOR_SELECT_OUTLINE | [14] Displayed when doing a drag type select in automation mode.

 | The following cursors are displayed when the corresponding tool is active. For example, when the PolyLine tool is active in automation mode, the ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR will be shown.
 | ANNAUTOCURSOR_TOOL_LINE_CURSOR | [15] Displayed when the line tool is active.
 | ANNAUTOCURSOR_TOOL_RECT_CURSOR | [16] Displayed when the rectangle tool is active.
 | ANNAUTOCURSOR_TOOL_ELLIPSE_CURSOR | [17] Displayed when the ellipse tool is active.
 | ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR | [18] Displayed when the polyline tool is active.
 | ANNAUTOCURSOR_TOOL_POLYGON_CURSOR | [19] Displayed when the polygon tool is active.
 | ANNAUTOCURSOR_TOOL_POINTER_CURSOR | [20] Displayed when the pointer is active.
 | ANNAUTOCURSOR_TOOL_FREEHAND_CURSOR | [21] Displayed when the free hand is active.
 | ANNAUTOCURSOR_TOOL_HILITE_CURSOR | [22] Displayed when the highlight is active.
 | ANNAUTOCURSOR_TOOL_REDACT_CURSOR | [23] Displayed when the redact tool is active.
 | ANNAUTOCURSOR_TOOL_TEXT_CURSOR | [24] Displayed when the text tool is active.
 | ANNAUTOCURSOR_TOOL_NOTE_CURSOR | [25] Displayed when the note tool is active.
 | ANNAUTOCURSOR_TOOL_STAMP_CURSOR | [26] Displayed when the stamp tool is active.
 | ANNAUTOCURSOR_TOOL_BUTTON_CURSOR | [27] Displayed when the button tool is active.
 | ANNAUTOCURSOR_TOOL_HOTSPOT_CURSOR | [28] Displayed when the hotspot tool is active.
 | ANNAUTOCURSOR_TOOL_AUDIO_CURSOR | [29] Displayed when the audio tool is active.
 | ANNAUTOCURSOR_TOOL_RULER_CURSOR | [30] Displayed when the ruler tool is active.
 | ANNAUTOCURSOR_TOOL_CROSSPRODUCT_CURSOR | [31] Displayed when the cross product tool is active.
 | ANNAUTOCURSOR_TOOL_POINT_CURSOR | [32] Displayed when the point tool is active.
 | ANNAUTOCURSOR_TOOL_PROTRACTOR_CURSOR | [33] Displayed when the protractor tool is active.
 | ANNAUTOCURSOR_TOOL_VIDEO_CURSOR | [34] Displayed when the video tool is active.
 | ANNAUTOCURSOR_TOOL_PUSHPIN_CURSOR | [35] Displayed when the pushpin tool is active.
 | ANNAUTOCURSOR_TOOL_FREEHANDHOTSPOT_CURSOR | [36] Displayed when the freehand hotspot tool is active.
 | ANNAUTOCURSOR_TOOL_CURVE_CURSOR | [37] Displayed when the curve tool is active.
 | ANNAUTOCURSOR_TOOL_CURVECLOSED_CURSOR | [38] Displayed when the closed curve tool is active.
 | ANNAUTOCURSOR_TOOL_ENCRYPT_CURSOR | [39] Displayed when the encrypt tool is active.
 | ANNAUTOCURSOR_TOOL_TEXTPOINTER_CURSOR | [40] Displayed when the text pointer tool is active.
 | ANNAUTOCURSOR_TOOL_POLYRULER_CURSOR | [41] Displayed when the polyruler tool is active.
 | ANNAUTOCURSOR_TOOL_RTF_CURSOR | [42] Displayed when the RTF tool is active.
 | ANNAUTOCURSOR_TOOL_RUBBERSTAMP_CURSOR | [43] Displayed when the rubber stamp tool is active.
hCursor | Handle to the cursor that will be displayed.

Returns

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

Comments

If hAutomation is NULL, the annotation cursors are changed for all the automation objects that will be created from this point on. It also changes the cursors for the automation objects that have not had their cursors changed (still using defaults).

If hAutomation is not NULL, the hCursor is changed only for the specified automation object. Some programs create a new automation object each time a file is opened. This is especially true for MDI applications. In this case, the hCursor is set only for the current file. If you want this hCursor to be set for all files, you must set the hCursor each time you create a new automation object, or call L_AnnSetAutoCursor with hObject set to NULL.

Internally, a copy is made of hCursor, so the hCursor can be destroyed after calling this fuction.

To retrieve a copy of an annotation cursor, call L_AnnGetAutoCursor.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoCursor, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoHilightPen, L_AnnSetOptions, L_AnnGetOptions, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions: Implementing Annotations
 | Annotation Functions: Displaying and Manipulating Annotation Objects
 | Color Halftone and Halftone Images
 | New Annotation Features of Version 14.5

Example

// This sample changes the annotation cursors for the automation object hAutomation
L_VOID SampleAnnSetCursors(HANNOBJECT hAutomation)
{
HCURSOR hCursorDefault;
HCURSOR hCursorDrawNew;
HCURSOR hCursorHandle;
HCURSOR hCursorHotspot;
HCURSOR hCursorMove;
HCURSOR hCursorSelect;
HCURSOR hCursorText;

// Load cursors
hCursorDefault = LoadCursorFromFile( TEXT("E:\\Images\\cursors\\MyArrow.cur"));
hCursorDrawNew = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyCross.cur"));
hCursorHandle = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyHandle.cur"));
hCursorHotspot = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyHotspot.cur"));
hCursorMove = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyMove.cur"));
hCursorSelect = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MySelect.cur"));
hCursorText = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyIBeam.cur"));

L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_DEFAULT, hCursorDefault);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_DRAWNEW, hCursorDrawNew);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_HANDLE, hCursorHandle);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_HOTSPOT, hCursorHotspot);

L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_MOVE, hCursorMove);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_SELECT, hCursorSelect);
L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_TEXT, hCursorText);
}


L_AnnSetAutoDefaults

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoDefaults(hAutomation, hObject, uFlags)

HANNOBJECT hAutomation; | /* handle to the automation object.*/
HANNOBJECT hObject; | /* handle to the annotation object.*/
L_UINT uFlags; | /* flags that determine which objects to process*/

Assigns the default properties of the specified automation object to the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the automation object.
hObject | Handle to the annotation object.
uFlags | Flags that determine which objects, referenced by hObject, 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function 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 an automation object to the specified annotation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Elements: | L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestFunction2(HWND hwnd)
{
ANNRECT ContainerRect, MyNoteRect, ContainerRectName;
RECT rAnnBounds;
RECT rAnnBoundsName;
HANNOBJECT MyNote;
HDC hWindowDC;
HANNOBJECT hAutoObject;
HANNOBJECT hContainer;

hWindowDC = GetDC(hwnd);
L_AnnAddUndoNode(hAutoObject);
L_AnnCreateItem(hContainer, ANNOBJECT_NOTE, TRUE, &MyNote);
L_AnnSetAutoDefaults(hAutoObject, MyNote, 0);
L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
MyNoteRect.left = ContainerRect.right / 8;
MyNoteRect.top = ContainerRect.bottom / 8;
MyNoteRect.right = ContainerRect.right / 2;
MyNoteRect.bottom = ContainerRect.bottom / 2;
L_AnnSetRect(MyNote, &MyNoteRect);
L_AnnGetBoundingRect(MyNote, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hWindowDC, &rAnnBounds, MyNote);
ValidateRect(hwnd, &rAnnBounds);
ReleaseDC(hwnd, hWindowDC);
}


L_AnnSetAutoDialogFontSize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoDialogFontSize(hObject, nFontSize)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_INT nFontSize; | /* font size */

Sets the size, in points, of the font used to display the automation dialog boxes. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an automation object.
nFontSize | The font size to set.

Returns

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

Comments

This function applies only to automation objects.

The default value is 8. (The default value is 9 in the Japanese version.)

To get the font size for an annotation automation object, use the L_AnnGetAutoDialogFontSize.

This function may be used to convert the annotation automation dialogs to another language. For more information, refer to Converting Automation Dialogs to Other Languages.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoDialogFontSize, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Converting Automation Dialogs to Other Languages
 | Altering Annotation Object Settings

Example

void TestFunction()
{

HANNOBJECT hAutoObject;
L_INT nfontsize;
/* Get and Set the font size for the dialogs */
L_AnnGetAutoDialogFontSize(hAutoObject, &nfontsize);
nfontsize *= 2;
L_AnnSetAutoDialogFontSize(hAutoObject, nfontsize);
return;
}


L_AnnSetAutoDrawEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoDrawEnable(hObject, fEnable)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_BOOL fEnable; | /* flag that indicates whether to enable or disable automated drawing */

Enables or disables automated drawing, using the left mouse button, in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an annotation automation object.
fEnable | Flag that indicates whether the left mouse button is used to draw automated annotation objects in design mode. Possible values are:
 | Value | Meaning
 | TRUE | The left mouse button is enabled for automated drawing.
 | FALSE | The left mouse button is disabled for automated drawing.

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoMenuEnable, L_AnnGetAutoMenuEnable, L_AnnGetAutoDrawEnable, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

/* This example toggles between enabling and disabling automated drawing. */
void TestAnnDrawEnable (HANNOBJECT hAnnObject)
{
L_BOOL fEnable; /* Is drawing enabled? */
/* Is automated drawing disabled? */
L_AnnGetAutoDrawEnable(hAnnObject, & fEnable);
if (fEnable == FALSE)
{
MessageBox (NULL, TEXT("Drawing is disabled. It will be enabled"), TEXT("Notice"), MB_OK);
L_AnnSetAutoDrawEnable(hAnnObject, TRUE);
}
else
{
MessageBox(NULL, TEXT("Drawing is enabled. It will be disabled."), TEXT("Notice"), MB_OK);
L_AnnSetAutoDrawEnable(hAnnObject, FALSE);
}
return;
}


L_AnnSetAutoHilightPen

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoHilightPen(hAutomation, crHilight)

HANNOBJECT hAutomation; | /* handle to an automation object */
COLORREF crHilight; | /* color of pen used for highlighting */

Sets the color of the pen that is used for highlighting. This function is available in Document/Medical toolkits

Parameter | Description
hAutomation | Handle to the annotation automation object. Pass NULL to change the default, which affects newly created automation objects.
crHilight | A COLORREF value representing the color of the pen used for highlighting.

Returns

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

Comments

Use this function 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 resulting outline is displayed using the highlight pen.

In automated annotation design mode, after choosing the Select tool and clicking on an existing annotation object. While the left mouse button is held 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 pixels.

The default highlight pen has a COLORREF 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 as follows:

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 operation with the underlying color will give a result that is visibly different from the underlying color.

A good choice is 0xC0C0C0 (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. These cursors will not be visible if an image has many mid-range values. To avoid this, define new cursors and use the L_AnnSetAutoCursor function. The main annotation demo (ANNOT32.EXE) demonstrates how to change the highlight pen and the annotation cursors.

Each automation object can have its own highlight pen color. To change the default highlight pen for newly created automation objects, pass NULL for the hAutomation parameter. The only way to restore the default color is to call L_AnnSetAutoHilightPen and set the color back to the original value (0xFFFFFF).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoBackColor, L_AnnGetAutoContainer, L_AnnGetAutoCursor, L_AnnGetAutoDialogFontSize, L_AnnGetAutoDrawEnable, L_AnnGetAutoMenuEnable, L_AnnGetAutoMenuItemEnable, L_AnnGetAutoMenuState, L_AnnGetAutoOptions, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnGetAutoUndoEnable, L_AnnSetAutoBackColor, L_AnnSetAutoContainer, L_AnnSetAutoCursor, L_AnnSetAutoDefaults, L_AnnSetAutoDialogFontSize, L_AnnSetAutoDrawEnable, L_AnnSetAutoMenuEnable, L_AnnSetAutoMenuItemEnable, L_AnnSetAutoMenuState, L_AnnSetAutoOptions, L_AnnSetAutoText, L_AnnSetAutoUndoEnable, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Grayscale Images
 | Changing the Annotation Automation Pen Highlight Color
 | Displaying Annotations
 | Implementing Automation
 | Annotation Automation Object
 | Altering Annotation Object Settings
 | Using Color Values in LEADTOOLS
 | Color Halftone and Halftone Images

Example

// This sample changes the annotation highlight pen for the existing automation object,
// and for all automation objects that will be created
L_VOID SampleAnnSetHilightPen(HANNOBJECT hAutomation)
{
// Change the highlight pen for the existing automation object
L_AnnSetAutoHilightPen(hAutomation, RGB(0xC0, 0xC0, 0xC0));

// Change the default highlight pen--all newly created automation objects will have this for the default highlight pen
L_AnnSetAutoHilightPen(NULL, RGB(0xC0, 0xC0, 0xC0));
}


L_AnnSetAutoMenuEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoMenuEnable(hObject, fEnable)

HANNOBJECT hObject; | /* handle to an annotation automation object */
L_BOOL fEnable; | /* flag that indicates whether to enable or disable the menus */

Enables or disables the automated annotation menus, which appear when the user clicks the right mouse button. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to an annotation automation object.
fEnable | Flag that indicates whether to enable or disable the automated annotation menus. Possible values are:
 | Value | Meaning
 | TRUE | Enable the automated annotation menus.
 | FALSE | Disable the automated annotation menus.

Returns

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

Comments

You can disable the context-sensitive automated menus if you want to change the annotation behavior in automation mode. However, this is not necessary if you only want to change the menu text. For changing the text, refer to L_AnnSetAutoText.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoMenuEnable, L_AnnSetAutoDrawEnable, L_AnnGetAutoDrawEnable, L_AnnSetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnMenuEnable (HANNOBJECT hAnnObject)
{
L_BOOL fEnable;
/* Are menus enabled? */
L_AnnGetAutoMenuEnable(hAnnObject, & fEnable);
if (fEnable == FALSE)
{
MessageBox (NULL, TEXT("Menus are disabled. They will be enabled."), TEXT("Notice"), MB_OK);
L_AnnSetAutoMenuEnable(hAnnObject, TRUE);
}
else
{
MessageBox(NULL, TEXT("Menus are enabled. They will be disabled."), TEXT("Notice"), MB_OK);
L_AnnSetAutoMenuEnable(hAnnObject, FALSE);
}
return;
}


L_AnnSetAutoMenuItemEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoMenuItemEnable(hObject, nObjectType, uItem, uEnable, uFlags, pUserList)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT nObjectType; | /* type of annotation object */
L_UINT uItem; | /* constant for the specified item */
L_UINT uEnable; | /* flag that indicates whether to enable or disable an item */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR *pUserList; | /* character string that contains the user list */

Enables or disables a menu item for one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
nObjectType | Constant that specifies an object's type. If hObject is an automation object, the specified menu item for all objects of type nObjectType will be enabled or disabled. For descriptions of possible object types, refer to Types of Annotations.
uItem | 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 Video 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 Play Video Dialog Strings
 | Annotation Automation Stamp Metafile Dialog Strings
 | Annotation Automation ToolTip Dialog Strings
 | Annotation Automation Transparent Color Dialog Strings
 | Annotation Automation Capture Dialog Strings
uEnable | Flag that indicates whether to enable or disable the specified item. Possible values are:
 | Value | Meaning
 | ANNMENU_ENABLED | Enable the menu item.
 | ANNMENU_DISABLED | Disable the menu item.
 | ANNMENU_DEFAULT | Enable or disable the menu item, based on the setting for the object type.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_USER | [0x0040] Process only those objects that have a user included in pUserList. If pUserList is NULL, process only those objects that do not have an associated user.
pUserList | Character string that contains the list of users associated with the specified object. pUserList 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 ANNFLAG_USER is set in uFlags.

Returns

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

Comments

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

The menu item strings are changed using the L_AnnSetAutoText function.

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 | nObjectType | 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 | ANNOBJECT_XXX | Menu item is not displayed for all objects of type ANNOBJECT_XXX.
Not NULL | Disabled | Automation object | ANNOBJECT_ALL | Menu item is not displayed for all objects.
Not NULL | Enabled | Automation object | ANNOBJECT_XXX | Menu item is displayed for all objects of type ANNOBJECT_XXX.
Not NULL | Enabled | Automation object | ANNOBJECT_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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoMenuItemEnable, L_AnnSetAutoText, L_AnnGetAutoText, L_AnnGetAutoMenuState, L_AnnSetAutoMenuState, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestFunction2(void)
{

HANNOBJECT hAutoObject;
L_UINT Enable;
L_AnnGetAutoMenuItemEnable(hAutoObject, ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, &Enable);
if (Enable == ANNMENU_ENABLED)
{
MessageBox(NULL, TEXT("Menu item is enabled. It will now be disabled."), TEXT(""), MB_OK);
L_AnnSetAutoMenuItemEnable(hAutoObject, ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
}
else if (Enable == ANNMENU_DISABLED)
{
MessageBox(NULL, TEXT("Menu item is disabled. It will be enabled."), TEXT(""), MB_OK);
L_AnnSetAutoMenuItemEnable(hAutoObject, ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_ENABLED, 0, NULL);
}
else
{
MessageBox(NULL, TEXT("Menu item is using its default behavior. It will be disabled."), TEXT(""), MB_OK);
L_AnnSetAutoMenuItemEnable(hAutoObject, ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
}
}


L_AnnSetAutoMenuState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoMenuState(hObject, nObjectType, pEnable, pEnableFlags, uBits, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_INT nObjectType; | /* type of annotation object */
L_UCHAR L_FAR * pEnable; | /* an array of bit flags */
L_UCHAR L_FAR * pEnableFlags; | /* an array of bit flags */
L_UINT uBits; | /* number of bits in pEnable and pEnableFlags */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets all menu items at one time. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
nObjectType | Constant that specifies an object's type. If hObject is an automation object, the menu items for all objects of type nObjectType will be enabled or disabled based on pEnableFlags and pEnable. For descriptions of possible object types, refer to Types of Annotations.
pEnable | An array of bit flags that specify whether to enable or disable the corresponding menu item specified in pEnableFlags. The bits in the pEnable array are ordered just like the bits in the pEnableFlags array. Therefore, if you wish to display the ANNAUTOTEXT_MENU_CUT menu item, you must make sure that pEnableFlags[0] & 0x40 == 1 is true, and that pEnable[0] & 0x40 == 1 is also true.
pEnableFlags | An array of bit flags that specify the menu items to change. The bits are ordered from most significant to least significant. Therefore, pEnableFlags[0] contains flags for menu items 0, 1, 2, 3, 4,5, 6, 7. This corresponds to ANNAUTOTEXT_MENU_UNDO, ANNAUTOTEXT_MENU_CUT, ANNAUTOTEXT_MENU_COPY, ANNAUTOTEXT_MENU_PASTE, ANNAUTOTEXT_MENU_DELETE, ANNAUTOTEXT_MENU_SELECTALL, ANNAUTOTEXT_MENU_BRINGTOFRONT, and ANNAUTOTEXT_MENU_SENDTOBACK. For example, if you wish to change the setting for ANNAUTOTEXT_MENU_CUT, make sure pEnableFlags[0] & 0x40 == 1 is true.
uBits | Number of bits in the pEnableFlags and pEnable arrays. The number of bytes pointed to by pEnable and pEnableFlags can be determined using the following equation: Bytes = (uBits + 7) / 8.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

If a bit in the pEnableFlags array is set to 1, then the corresponding bit in the pEnable array determines whether the corresponding menu item will be displayed or not. If the corresponding bit in pEnable is one, the menu item will be displayed, provided the menu item string is not NULL. If the corresponding bit in pEnable is 0, the corresponding menu item will not be displayed.

If a bit in pEnableFlags is 0, the corresponding bit in pEnable is ignored, and the menu item is displayed or not displayed based on the default behavior.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoMenuState, L_AnnGetAutoMenuItemEnable, L_AnnSetAutoMenuItemEnable, L_AnnSetAutoText, L_AnnGetAutoText, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestFunction1(void)
{
HANNOBJECT hAutoObject;
L_UCHAR pEnableFlags[2];
L_UCHAR pEnable[2];
L_UCHAR resultFlag;
L_UINT uBits = 16;
L_UCHAR result;
L_TCHAR cs[256];

/* Get the menu state for Note objects */
L_AnnGetAutoMenuState(hAutoObject, ANNOBJECT_NOTE, pEnable, pEnableFlags, uBits);
/* 0x40 represents the Cut menu item. Therefore test to see if the 0x40 flag has been set in pEnableFlags, indicating a change from its default behavior. */
resultFlag = pEnableFlags[0] & 0x40;
if (resultFlag == 0x40) /* The flag for the Cut menu item has been set */
{
MessageBox(NULL, TEXT("pEnableFlags is set"), TEXT(""), MB_OK);
/* Check to see if the same flag has been set in pEnable */
result = pEnable[0] & 0x40;
if (result == 0x40) /* The enable flag has been set, the menu item is enabled. */
{
MessageBox(NULL, TEXT("The menu item was enabled. It will be disabled."), TEXT(""), MB_OK);
pEnable[0] = 0x00;
L_AnnSetAutoMenuState(hAutoObject, ANNOBJECT_NOTE, pEnable, pEnableFlags, uBits, 0);
}
else /* The enable flag was not set, the menu item is disabled. */
{

MessageBox(NULL, TEXT("The menu item was disabled. It will be enabled."), TEXT(""), MB_OK);
pEnable[0] = 0x40;
L_AnnSetAutoMenuState(hAutoObject, ANNOBJECT_NOTE, pEnable, pEnableFlags, uBits, 0);
}

}
else /* The flag for the Cut menu item was not set. Set it and disable the Cut menu item. */
{
pEnableFlags[0] = 0x40;
pEnable[0] = 0;
wsprintf (cs, TEXT("The value of pEnableFlags[0] is %X.\n"), pEnableFlags[0]);
MessageBox(NULL, cs, TEXT(""), MB_OK);
L_AnnSetAutoMenuState(hAutoObject, ANNOBJECT_NOTE, pEnable, pEnableFlags, uBits, 0);
}
}


L_AnnSetAutoOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoOptions(hObject, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFlags; | /* flags that determine the options to set */

Sets options for the automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFlags | Flags that determine the options to set. Possible values are:
 | Value | Meaning
 | ANNAUTO_TABBEDDIALOG | Combine the dialog boxes that describe most of the object properties into one tabbed dialog box. Only dialog boxes that are not system dependent can be tabbed. The dialog boxes that are not tabbed are Font, Color, and File. If this flag is not set, the dialogs are displayed as in previous versions of LEADTOOLS.
 | ANNAUTO_REVERSEEDIT_KEYS | Reverse the behavior of the Enter key and the Ctrl + Enter key combination for Text, Note and Push Pin objects. By default, for the Text, Note and Push pin objects, pressing the Enter key ends the text input, while the Ctrl + Enter key combination allows the user to add a new line to the text input. Setting this flag reverses these behaviors.

Returns

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

Comments

By default, the dialogs are combined in a tabbed dialog box.

If a tabbed dialog box is used, the caption of the dialog box will be one of the following:

Default Properties

Selected Properties

Container Properties

Pointer Properties

Audio Properties

Button Properties

Ellipse Properties

Freehand Properties

Hilite Properties

Hotspot Properties

Line Properties

Note Properties

Polygon Properties

Polyline Properties

Rectangle Properties

Redact Properties

Stamp Properties

Text Properties

Automation Properties

Ruler Properties

Cross product Properties

Point Properties

Protractor Properties

Video Properties

Pushpin Properties

Freehand Hot Spot Properties

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoOptions, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestFunction2(void)
{
// L_AnnEnumerate(hContainer, annMetaCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, NULL);
HANNOBJECT hAutoObject;
L_INT nRet;
L_UINT uFlags;

nRet = L_AnnGetAutoOptions(hAutoObject, &uFlags);
if (nRet == SUCCESS)
{
if (uFlags != 0)
uFlags = 0;
else
uFlags = ANNAUTO_TABBEDDIALOG;
L_AnnSetAutoOptions(hAutoObject, uFlags);
}
else
MessageBox(NULL, TEXT("Error getting auto options."), TEXT(""), MB_OK);

}


L_AnnSetAutoSnapCursor

#include "l_bitmap.h"

EXT_FUNCTION L_AnnSetAutoSnapCursor(hAutomation, bSnap)

HANNOBJECT hAutomation; | /* handle to the automation annotation object */
L_BOOL bSnap; | /* value that indicates whether to restrict the cursor location */

Sets the behavior of the cursor location when creating annotations using automation in design mode.

Parameter | Description
hAutomation | Handle to the automation annotation object
bSnap | Boolean value that indicates whether to restrict the cursor location during annotation creation 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.

Returns

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

Comments

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoSnapCursor, L_AnnGetAutoCursor, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoCursor, L_AnnRestrictCursor, L_AnnGetRestrictToContainer, L_AnnSetRestrictToContainer, L_AnnGetAutoBackColor, L_AnnGetAutoContainer, L_AnnGetAutoDialogFontSize, L_AnnGetAutoDrawEnable, L_AnnGetAutoMenuEnable, L_AnnGetAutoMenuItemEnable, L_AnnGetAutoMenuState, L_AnnGetAutoOptions, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnGetAutoUndoEnable, L_AnnSetAutoBackColor, L_AnnSetAutoContainer, L_AnnSetAutoDefaults, L_AnnSetAutoDialogFontSize, L_AnnSetAutoDrawEnable, L_AnnSetAutoMenuEnable, L_AnnSetAutoMenuItemEnable, L_AnnSetAutoMenuState, L_AnnSetAutoOptions, L_AnnSetAutoText, L_AnnSetAutoUndoEnable
Topics: | Displaying and Manipulating Annotation Objects
 | Altering Annotation Object Settings
 | Obtaining Annotation Object Information
 | Annotation Functions: Implementing Automation

Example

// 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.
L_VOID ExampleAnnSetAutoSnapCursor(HANNOBJECT hAutomation)
{
L_INT nRet = TRUE;
L_BOOL bSnap = FALSE;
L_CHAR szMsg[200];

nRet = L_AnnGetAutoSnapCursor(hAutomation, &bSnap);
if (nRet != SUCCESS)
return;

bSnap = !bSnap;
nRet = L_AnnSetAutoSnapCursor(hAutomation, bSnap);
if (nRet != SUCCESS)
return;

wsprintf(szMsg, "Automation Snap Cursor State changed from %s to %s",
!bSnap ? "TRUE" : "FALSE",
bSnap ? "TRUE" : "FALSE");

MessageBox(NULL, szMsg, "Notice", MB_OK);
}


L_AnnSetAutoText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoText(hObject, uItem, pText)

HANNOBJECT hObject; | /* handle to an automation object */
L_UINT uItem; | /* constant for the specified item */
L_TCHAR L_FAR * pText; | /* character string for the item */

Sets the character string for a menu or dialog box item associated with automated annotations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
uItem | 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 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 Video 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 Play Video 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 Dialog Strings
pText | Character string to use for the menu or dialog box item.

Returns

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

Comments

To retrieve the character string for a menu item or dialog box item, use L_AnnGetAutoTextLen to determine the length of the string and to allocate a buffer of appropriate size. Then call L_AnnGetAutoText to retrieve the string.

When you call L_AnnSetAutoText, if you pass an empty string, the menu item defined by uItem will be disabled and removed from the automation menu. To re-enable the menu item, call L_AnnSetAutoText and pass a valid string.

If hObject is NULL, the automation strings are changed for all the automation objects that will be created from this point on. It also changes the strings for the automation objects that have not overwritten the specified string.

If hObject is not NULL, the string is overwritten only for the specified automation object. Some programs create a new automation object each time a file is opened. This is especially true for MDI applications. In this case, the string is set only for the current file. If you want this string to be set for all files, you must set the string each time you create a new automation object, or call L_AnnSetAutoText with hObject set to NULL.

To reset a string used in the annotation toolbar menus, you must call L_AnnSetAutoText with hObject sett to NULL, since the annotation toolbar is not tied to a specific automation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetHyperlinkMenuEnable, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing an Automated Annotation Program

Example

/* This example changes the text for selecting the line style. */
HANNOBJECT hAutoObject; /* Automation object */
void TestAnnSetAutoText(void)
{
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_SOLID, TEXT("Solid line"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASH, TEXT("Dash (_ _ _ _)"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DOT, TEXT("Dot (. . . .)"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASHDOT, TEXT("Dash dot (_._._)"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_DASHDOTDOT, TEXT("Dash dot dot (_.._.._)"));
L_AnnSetAutoText(hAutoObject, ANNAUTOTEXT_LINE_NULL, TEXT("Invisible line"));
return;
}


L_AnnSetAutoUndoEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetAutoUndoEnable(hObject, bEnable);

HANNOBJECT hObject; | /* handle to the automation object */
L_BOOL bEnable; | /* flag that indicates whether to enable undo */

Enables or disables the undo mechanism for an automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.
bEnable | Flag that indicates whether to enable or disable the undo mechanism for the 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.

Returns

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

Comments

Use this function along with L_AnnAddUndoNode to combine multiple changes into a single undo call. For more information on this process, refer to L_AnnAddUndoNode.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnAddUndoNode, L_AnnGetAutoUndoEnabled, L_AnnGetUndoDepth, L_AnnSetUndoDepth, L_AnnUndo, L_AnnSetAutoHilightPen, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Undoing Automation Operations
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnGetAutoUndoEnable.


L_AnnSetBackColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetBackColor(hObject, crBack, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF crBack; | /* COLORREF value that specifies the background color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the background color of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
crBack | The COLORREF value that specifies the background color.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_BACKGROUNDCOLOR menu item has been selected.

Returns

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

Comments

You use the Windows COLORREF data type to specify the color. For example, you can use the L_GetPixelColor function or the Windows RGB macro to get a color value.

This function applies to multiple and selected objects based on values of the uFlags parameter.

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetForeColor, L_AnnGetForeColor, L_AnnGetBackColor, L_AnnSetROP2, L_AnnGetROP2, L_AnnGetAutoBackColor, L_AnnSetAutoBackColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Color Values in LEADTOOLS

Example

void TestAnnBackColor(HANNOBJECT hAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
L_AnnGetBackColor(hAnnObject, &ThisColor);
L_AnnSetBackColor (hAnnObject, ThisColor ^ 0x00FFFFFF, 0);
return;
}


L_AnnSetBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetBitmap(hObject, pBitmap, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the bitmap of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pBitmap | Pointer to the bitmap handle referencing the bitmap to assign to the specified object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Sets the bitmap of one or more annotation objects.

The L_AnnSetBitmap function is valid only for the following object types:

Point

Pushpin

Stamp (including the Tubber Stamp tools)

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

Call the L_AnnGetBitmap function to get the bitmap for one or more annotation objects.

Only the Stamp object uses this property. The specified bitmap is a LEAD bitmap. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

This function applies to multiple and selected objects based on values of the uFlags parameter.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

/* This example creates a stamp object containing a bitmap */

HANNOBJECT hContainer; /* Container annotation object */
HANNOBJECT MyStamp; /* Stamp annotation object */

void TestCreateStampAnn(HWND hWnd)
{
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT ContainerRectName;
ANNRECT MyStampRect; /* Rectangle for the stamp object */
RECT rAnnBounds; /* Bounding rectangle used to draw the object */
RECT rAnnBoundsName;
BITMAPHANDLE TmpBitmap; /* Bitmap for the stamp */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Load the LEAD bitmap, reduced to 8-bit, defaulting to fixed palette */
L_LoadBitmap (TEXT("IMAGE2.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);
/* Get the container's rectangle */
L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
/* Create the stamp annotation */
L_AnnCreateItem(hContainer, ANNOBJECT_STAMP, TRUE, &MyStamp);
/* Size and position the stamp, adjusting the height to keep the bitmap's aspect ratio */
MyStampRect.left = ContainerRect.right / 8;
MyStampRect.top = ContainerRect.bottom / 2;
MyStampRect.right = ContainerRect.right / 2;
MyStampRect.bottom = MyStampRect.top +
(((MyStampRect.right - MyStampRect.left) * BITMAPHEIGHT(&TmpBitmap)) / BITMAPWIDTH(&TmpBitmap));
L_AnnSetRect(MyStamp,&MyStampRect);
/* Assign the bitmap to the stamp; then free the temporary bitmap */
L_AnnSetBitmap(MyStamp, &TmpBitmap, 0);
L_FreeBitmap(&TmpBitmap);
/* Display the stamp */
L_AnnGetBoundingRect(MyStamp, &rAnnBounds, &rAnnBoundsName);
L_AnnDraw(hWindowDC, &rAnnBounds, MyStamp);
/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
return;
}


L_AnnSetBitmapDpiX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetBitmapDpiX(hObject, dDpiX, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dDpiX; | /* horizontal DPI value to set */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the horizontal Bitmap DPI (dots per inch) value that is used to translate the horizontal distance for the Ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dDpiX | The horizontal DPI value to set. Valid values are greater than or equal to 1.
 | If you pass 0 or a positive value less than 1, the value will default to 150. If you pass a negative value, the function will return an error.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on the value of the uFlags parameter.

Only Automation and Ruler objects are affected.. Refer to Annotation Automation Object.

You should set this value to the bitmap’s XResolution. Call this function every time you load objects or paste them from the clipboard. Otherwise, the distances shown by the ruler objects will not be accurate.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiY, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

BITMAPHANDLE LeadBitmap;
HANNOBJECT hContainer;
void TestAnnBitmapDpiX(void)
{
L_DOUBLE xRes;
L_DOUBLE yRes;

/* get the bitmap x and y res from the object */
L_AnnGetBitmapDpiX(hContainer, &xRes);
L_AnnGetBitmapDpiY(hContainer, &yRes);

/* set all selected items to have the same dpi for ruler tool as the bitmap */
if(xRes != (L_DOUBLE) LeadBitmap.XResolution)
L_AnnSetBitmapDpiX(hContainer, (L_DOUBLE) LeadBitmap.XResolution, ANNFLAG_RECURSE | ANNFLAG_SELECTED);
if(yRes != (L_DOUBLE) LeadBitmap.YResolution)
L_AnnSetBitmapDpiY(hContainer, (L_DOUBLE) LeadBitmap.YResolution, ANNFLAG_RECURSE | ANNFLAG_SELECTED);
return;
}


L_AnnSetBitmapDpiY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetBitmapDpiY(hObject, dDpiY, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dDpiY; | /* vertical DPI value to set */
L_UINT uFlags; | /* flags that determine which objects to process*/

Sets the vertical Bitmap DPI (dots per inch) value that is used to translate the vertical distance for the Ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dDpiY | The vertical DPI value to set. Valid values are greater than or equal to 1.
 | If you pass 0 or a positive value less than 1, the value will default to 150. If you pass a negative value, the function will return an error.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on the value of the uFlags parameter.

Only Automation and Ruler objects are affected. Refer to Annotation Automation Object.

You should set this value to the bitmap’s YResolution. Call this function every time you load objects or paste them from the clipboard. Otherwise, the distances shown by the ruler objects will not be accurate.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnSetBitmapDpiX.


L_AnnSetDpiX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetDpiX(hObject, dDpiX, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dDpiX; | /* horizontal DPI value to set */
L_UINT uFlags; | /* reserved for future use */

Sets the horizontal DPI (dots per inch) value that is used to translate user input, such as font size, that is expressed in physical measurements. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dDpiX | The horizontal DPI value to set. Valid values are greater than or equal to 1.
 | If you pass 0 or a positive value less than 1, the value will default to 150. If you pass a negative value, the function will return an error.
uFlags | Reserved for future use. You can pass 0.

Returns

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

Comments

The DPI properties apply only to the annotation automation object. Refer to Annotation Automation Object.

Typically, if you are matching annotations to a bitmap, you can use the bitmap handle's XResolution field to set this value.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetDpiY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetDpiY(hObject, dDpiY, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dDpiY; | /* vertical DPI value to set */
L_UINT uFlags; | /* reserved for future use */

Sets the vertical DPI (dots per inch) value that is used to translate user input, such as font size, that is expressed in physical measurements. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dDpiY | The vertical DPI value to set.
uFlags | Reserved for future use. You can pass 0.

Returns

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

Comments

The DPI properties apply only to the annotation automation object. Refer to Annotation Automation Object.

Typically, if you are matching annotations to a bitmap, you can use the bitmap handle's YResolution field to set this value.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetEncryptOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetEncryptOptions(hObject, pEncryptOptions, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNENCRYPTOPTIONS pEncryptOptions; | /* pointer to a structure that specifies various encrypt options */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the options for the specified Encrypt annotation object. This object may be in the encryptor or the decryptor state. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pEncryptOptions | Pointer to an ANNENCRYPTOPTIONS structure that specifies the various encrypt options to set.
uFlags | 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 ( | ). Possible values are:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function to set the encrypt options of an encrypt annotation object. To use this function, declare a variable of type ANNENCRYPTOPTIONS, and pass the address of this variable for pEncryptOptions.

Use the L_AnnGetEncryptOptions function to get the encrypt options of an encrypt annotation object. These options are in an ANNENCRYPTOPTIONS structure.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetPredefinedMetafile, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Encryption and Decrytion Annotation Objects

Example

For an example, refer to L_AnnEncryptApply.


L_AnnSetFillMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFillMode(hObject, uFillMode, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the fill mode of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFillMode | The constant that specifies the object's fill mode. Possible fill mode values are:
 | Value | Meaning
 | ANNMODE_TRANSPARENT | [0] Transparent
 | ANNMODE_TRANSLUCENT | [1] Translucent
 | ANNMODE_OPAQUE | [2] Opaque
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FILL menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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 L_AnnSetROP2 function and the L_AnnSetFillMode function affect each other. If you set uFillMode to ANNFILLMODE_OPAQUE, then uROP2 cannot be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSLUCENT, then uROP2 has to be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSPARENT, uROP2 can be anything.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnGetFillMode, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetROP2, L_AnnSetROP2, L_AnnSetBackColor, L_AnnSetForeColor, L_AnnGetSelected, L_AnnSetSelected, L_AnnGetTransparent, L_AnnSetTransparent, L_AnnGetTransparentColor, L_AnnSetTransparentColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFillMode(HANNOBJECT hAnnObject)
{
L_UINT FillMode; /* Object fill mode */
/* Set the fill mode to transparent, unless it already is */
L_AnnGetFillMode(hAnnObject, &FillMode);
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
L_AnnSetFillMode(hAnnObject, ANNMODE_TRANSPARENT, 0);
return;
}


L_AnnSetFillModeExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFillModeExt(hObject, uFillMode, nAlpha, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object*/
L_UINT uFillMode; | /* constant that specifies the object's fill mode*/
L_INT nAlpha; | /* integer that specifies the object’s alpha value */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the fill mode and alpha of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFillMode | The constant that specifies the object's fill mode. Possible fill mode values are:
 | Value | Meaning
 | ANNMODE_TRANSPARENT | [0] Transparent
 | ANNMODE_TRANSLUCENT | [1] Translucent
 | ANNMODE_OPAQUE | [2] Opaque
 | ANNMODE_ALPHA | [3] Alpha
nAlpha | Value that specifies the object’s alpha value. This is only valid if uFillMode is ANNMODE_ALPHA. Possible values are: -1..255. For an explanation of these values, refer to the Comments section below.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FILL menu item has been selected.

Returns

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

Comments

Like L_AnnSetFillMode, you can use this function to set the fill mode for annotation objects. With this function, the L_AnnSetFillMode function has been extended to support the new fill mode ANNMODE_ALPHA.

Before calling L_AnnSetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

L_VOID ExampleEnableOption(HANNOBJECT hAutomation)
{
L_UINT uOptions = 0;
L_AnnGetOptions ( hAutomation);
L_AnnSetOptions ( hAutomation, uOptions | OPTIONS_NEW_ALPHA);
}

The following figure displays rectangle annotation objects using different alpha values:

The nAlpha parameter is used only if the uFillMode parameter is passed as ANNMODE_ALPHA, in which case, nAlpha can be between -1 and 255 inclusive. Values are used as follows:

A value of -1 means to leave the existing nAlpha value unchanged

A value of 0 means the annotation object background is completely transparent

A value of 255 means the annotation background is completely opaque.

Any value between 0 and 255 can be used to specify a varying degree of transparency.

Note that the L_AnnSetROP2 function and the L_AnnSetFillModeExt function affect each other. If you set uFillMode to ANNFILLMODE_OPAQUE, then uROP2 cannot be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSLUCENT, then uROP2 has to be ANNROP2_AND. If you set uFillMode to ANNFILLMODE_TRANSPARENT, uROP2 can be anything.

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFillMode, L_AnnSetFillMode, L_AnnGetFillModeExt, L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetROP2, L_AnnSetROP2, L_AnnSetOptions, L_AnnGetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only): Displaying Annotations
 | Annotation Functions: Object Information
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing Annotations
 | Implementing a Non-automated Annotation Program
 | Obtaining Annotation Object Information
 | Altering Annotation Object Settings
 | Illustration of Fill Options for Annotations
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Container Annotation Object
 | Annotation Automation Object
 | Annotation Functions (Document/Medical only): Getting and Setting Color Properties
 | Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Example

// The following example toggles through all supported fill modes for an annotation object.

// The background color is set to blue in each case

L_INT ExampleAnnGetFillModeExt(HANNOBJECT hObject)
{
int nRet;
L_UINT uFillMode;

nRet = L_AnnGetFillModeExt (hObject, &uFillMode, NULL);
if (nRet != SUCCESS)
return nRet;

nRet = L_AnnSetBackColor (hObject, RGB(0,0,255), 0);

switch(uFillMode)
{
case ANNMODE_TRANSPARENT:
uFillMode = ANNMODE_TRANSLUCENT;
break;

case ANNMODE_TRANSLUCENT:
uFillMode = ANNMODE_OPAQUE;
break;

case ANNMODE_OPAQUE:
uFillMode = ANNMODE_ALPHA;
break;

case ANNMODE_ALPHA:
default:
uFillMode = ANNMODE_TRANSPARENT;
break;
}

// Arbitrarily set an alpha value of 128
// Note that this value is used only if the uFillMode is ANNMODE_ALPHA
nRet = L_AnnSetFillModeExt(hObject, uFillMode, 128, 0);
return nRet;
}


L_AnnSetFillPattern

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFillPattern(hObject, uFillPattern, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the fill pattern of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFillPattern | The constant that specifies the fill pattern. Possible fill pattern values are:
 | Value | Meaning
 | ANNPATTERN_SOLID | [0] Solid
 | ANNPATTERN_BDIAGONAL | [1] Backward diagonal
 | ANNPATTERN_CROSS | [2] Cross
 | ANNPATTERN_DIAGCROSS | [3] Diagonal cross
 | ANNPATTERN_FDIAGONAL | [4] Forward diagonal
 | ANNPATTERN_HORIZONTAL | [5] Horizontal
 | ANNPATTERN_VERTICAL | [6] Vertical
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FILL menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFillPattern, L_AnnSetFillMode, L_AnnGetFillMode, L_AnnGetPolyFillMode, L_AnnSetPolyFillMode, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

/* This example gets and updates the property of the object passed by the caller */
void TestAnnFillPattern(HANNOBJECT hAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */
/* Set the fill pattern to solid, unless it already is */
L_AnnGetFillPattern(hAnnObject, &FillPattern);
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
L_AnnSetFillPattern(hAnnObject, ANNPATTERN_SOLID, 0);
return;
}


L_AnnSetFixed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFixed(hObject, bFixed, bAdjust, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bFixed; | /* value that specifies whether the annotation object is fixed */
L_BOOL bAdjust; | /* value that specifies whether the annotation will be automatically adjusted */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the annotation is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bFixed | Value that specifies whether the annotation object is fixed. Possible values are:
 | Value | Meaning
 | TRUE | The annotation object is fixed.
 | FALSE | The annotation object is not fixed.
bAdjust | Value that specifies whether the annotation will be automatically adjusted when changing the fixed states. Possible values are:
 | Value | Meaning
 | TRUE | The annotation object is automatically adjusted when changing the fixed state.
 | FALSE | The annotation object is not automatically adjusted when changing the fixed state.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

A fixed annotation does not move or change size when the annotation container scalars and offsets are changed. The effect is that the annotation does not move or change size when the underlying image is scrolled or zoomed.

Passing TRUE for the bAdjust parameter automatically adjusts 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 pass FALSE for the bAdjust parameter, the annotation object can move or resize if the annotation container has scalar values other than 1, or offset values other than 0. For more information, refer to L_AnnSetScalarX, L_AnnSetScalarY, L_AnnSetOffsetX, and L_AnnSetOffsetY.

The following annotations cannot be fixed:

ANNOBJECT_CONTAINER

ANNOBJECT_REDACT

ANNOBJECT_ENCRYPT

For more information, refer to Fixed Annotations

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFixed, L_AnnIsFixedInRect, L_AnnPopFixedState, L_AnnPushFixedState
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions (Document/Medical only): Getting and Setting the Fixed Property

Example

// This Example toggles the "fixed" property of an annotation object
// If an object is fixed, it does not move when the underlying image is scrolled or zoomed
L_VOID SampleAnnFixed(HANNOBJECT hObject)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = L_AnnGetFixed(hObject, &bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
L_AnnSetFixed(hObject, bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("L_AnnGetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


L_AnnSetFontBold

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontBold(hObject, fFontBold, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the bold-font property of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fFontBold | 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.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFontBold(HANNOBJECT hAnnObject)
{
L_BOOL IsBold; /* Is the object’s text bold */
/* Set the font to bold, unless it already is */
L_AnnGetFontBold(hAnnObject, &IsBold);
if (IsBold == TRUE)
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
L_AnnSetFontBold (hAnnObject, TRUE, 0);
return;
}


L_AnnSetFontItalic

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontItalic(hObject, fFontItalic, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the italic-font property of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fFontItalic | 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.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFontItalic(HANNOBJECT hAnnObject)
{
L_BOOL IsItalic; /* Is the object’s text italic */
/* Set the font to italic, unless it already is */
L_AnnGetFontItalic(hAnnObject, &IsItalic);
if (IsItalic == TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
L_AnnSetFontItalic (hAnnObject, TRUE, 0);
return;
}


L_AnnSetFontName

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontName(hObject, pFontName, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pFontName; | /* name of the font to assign */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the font of one or more annotation objects. You specify the name of the font in a character string. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pFontName | The character string containing the name of the font to assign.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

void TestAnnFontName(HANNOBJECT hAnnObject)
{
L_TCHAR L_FAR * pFontName; /* The object’s font name */
HGLOBAL hFontname; /* Handle for memory management */
L_UINT NameLength; /* Length of the object’s font name */
/* Get the length of the current font name */
L_AnnGetFontNameLen(hAnnObject, &NameLength);
/* Allocate and lock a zero-filled buffer for the font name */
hFontname = GlobalAlloc(GPTR, NameLength * sizeof (L_TCHAR));
pFontName = (L_TCHAR L_FAR *)GlobalLock( hFontname );
/* Get the current font name */
L_AnnGetFontName(hAnnObject, pFontName);
/* Set the font to Times New Roman, unless it already is */
if (lstrcmp(pFontName, TEXT("Times New Roman")) == 0)
MessageBox (NULL, TEXT("Already Times New Roman"), TEXT("Notice"), MB_OK);
else
L_AnnSetFontName (hAnnObject, TEXT("Times New Roman"), 0);
/* Free memory that we no longer need */
GlobalFree(hFontname);
return;
}


L_AnnSetFontSize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontSize(hObject, dFontSize, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dFontSize; | /* font size to set */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the font size of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dFontSize | The font size to set, expressed as an unscaled value relative to the container.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

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 L_AnnGetScalarX function, and C is the value that you get from the L_AnnGetScalarY function:

dFontSize = A / sqrt( B * C )

For more information, refer to Low-Level Coordinate System for Annotations.

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFontSize(HANNOBJECT hAnnObject)
{
L_DOUBLE FontSize; /* Object font size */
/* Double the font size */
L_AnnGetFontSize(hAnnObject, &FontSize);
L_AnnSetFontSize (hAnnObject, FontSize * 2, 0);
return;
}


L_AnnSetFontStrikeThrough

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontStrikeThrough(hObject, fFontStrikeThrough, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fFontStrikeThrough; | /* flag that indicates whether to apply a strike-through */
L_UINT uFlags; | /* flags that determine which objects to process */

Applies or removes the strike-through (a line through the middle of the text), of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fFontStrikeThrough | 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.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnSetFontUnderline, L_AnnGetFontUnderline, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFontStrike(HANNOBJECT hAnnObject)
{
L_BOOL StrikeThrough; /* Strike-through property of the object’s text */
/* Set the font to have a strike-through, unless it already has one */
L_AnnGetFontStrikeThrough(hAnnObject, &StrikeThrough);
if (StrikeThrough == TRUE)
MessageBox (NULL, TEXT("Already has strike-through"), TEXT("Notice"), MB_OK);
else
L_AnnSetFontStrikeThrough(hAnnObject, TRUE, 0);
return;
}


L_AnnSetFontUnderline

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetFontUnderline(hObject, fFontUnderline, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fFontUnderline; | /* flag that indicates whether to underline the text */
L_UINT uFlags; | /* flags that determine which objects to process */

Applies or removes the underline of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fFontUnderline | 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.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FONT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFontName, L_AnnGetFontName, L_AnnGetFontNameLen, L_AnnSetFontSize, L_AnnGetFontSize, L_AnnGetFontUnderline, L_AnnSetFontStrikeThrough, L_AnnGetFontStrikeThrough, L_AnnSetFontItalic, L_AnnGetFontItalic, L_AnnSetFontBold, L_AnnGetFontBold
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnFontUnderline(HANNOBJECT hAnnObject)
{
L_BOOL UnderLine; /* Underline property of the object’s text */
/* Set the font to have an underline, unless it already has one */
L_AnnGetFontUnderline(hAnnObject, &UnderLine);
if (UnderLine == TRUE)
MessageBox (NULL, TEXT("Already has an underline"), TEXT("Notice"), MB_OK);
else
L_AnnSetFontUnderline (hAnnObject, TRUE, 0);
return;
}


L_AnnSetForeColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetForeColor(hObject, crFore, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF crFore; | /* COLORREF value that specifies the foreground color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the foreground color of one or more annotation objects. The default foreground color is red. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
crFore | The COLORREF value that specifies the foreground color.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_FOREGROUNDCOLOR menu item has been selected.

Returns

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

Comments

You use the Windows COLORREF data type to specify the color. For example, you can use the L_GetPixelColor function or the Windows RGB macro to get a color value.

This function applies to multiple and selected objects based on values of the uFlags parameter.

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetForeColor, L_AnnSetBackColor, L_AnnGetBackColor, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Altering Annotation Object Settings
 | Using Color Values in LEADTOOLS

Example

For complete sample code, refer to the Annotate example.

void TestAnnForeColor(HANNOBJECT hAnnObject)
{
COLORREF ThisColor; /* Object foreground color */
/* Invert the foreground color */
L_AnnGetForeColor(hAnnObject, &ThisColor);
L_AnnSetForeColor (hAnnObject, ThisColor ^ 0x00FFFFFF, 0);
return;
}


L_AnnSetGaugeLength

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetGaugeLength(hObject, dLength, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dLength; | /* new length of the ruler object's gauge */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the length of the gauge (the perpendicular lines at the ends of the Ruler object). This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dLength | The new length of the ruler object's gauge.
uFlags | Flags that determine which objects to process. The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_RULER menu item has been selected.

Returns

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

Comments

The gauge length property applies only to Automation and Ruler objects. Refer to Annotation Automation Object.

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

HANNOBJECT hContainer;

void TestAnnGauge(HANNOBJECT hAnnObject)
{
L_DOUBLE dLength;
/* if gauge length setting
is longer than 5 pixels, then make it 5 pixels. */
L_AnnGetGaugeLength(hAnnObject, &dLength);
if (dLength > 5.0f)
{
L_AnnSetGaugeLength(hAnnObject, 5.0f, 0);
/* make all ruler objects the same. */
L_AnnSetGaugeLength(hContainer, 5.0f, ANNFLAG_RECURSE);
}
return;
}


L_AnnSetGrouping

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetGrouping(hObject, bAutoGroup, uFlags)

HANNOBJECT hObject; | /* handle to the container object */
L_BOOL bAutoGroup; | /* flags that indicates whether or not to group objects */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the grouping of the objects within the specified container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the container object.
bAutoGroup | Flag that indicates whether or not to group the objects within the specified container. Possible values are:
 | Value | Meaning
 | TRUE | All objects within the container should be treated as a group.
 | FALSE | Each object within the container can be selected and modified independently.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetGrouping, L_AnnGroup, L_AnnUngroup
Topics: | Grouping and Ungrouping Annotation Objects
 | Altering Annotation Object Settings

Example

/*
this example will temporarily disable the grouping in all objects
and re-enable the grouping later
*/
// disable grouping in all groups

HANNOBJECT hContainer;

L_AnnSetGrouping(hContainer, FALSE, ANNFLAG_RECURSE);

/* you can now select and change individual objects within groups */

// re-enable grouping in all groups.
// note that we do NOT enable grouping in the topmost container!
// if you enable the grouping in the top container, then all the
//objects will act as a group!
L_AnnSetGrouping(hContainer, TRUE, ANNFLAG_RECURSE|ANNFLAG_NOTTHIS);


L_AnnSetHyperlink

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetHyperlink(hObject, uType, uMsg, wParam, pLink, uFlags)

HANNOBJECT hObject; | /* handle of the annotation object */
L_UINT uType; | /* hyperlink type */
L_UINT uMsg; | /* user-defined message value */
WPARAM wParam; | /* wParam value to be passed to the user defined message */
L_TCHAR L_FAR * pLink; | /* hyperlink string /*
L_UINT uFlags; | /* flags to determine which objects to process */

Sets the hyperlink type and parameters of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uType | Constant that specifies the object's hyperlink type. Possible values are:
 | Value | Meaning
 | ANNLINK_NONE | [0x0000] Object has no hyperlink.
 | ANNLINK_LTANNEVENT | [0x0001] WM_LTANNEVENT message will be sent with LTANNEVENT_HYPERLINK
 | ANNLINK_USERMSG | [0x0002] The user defined message will be sent with wParam as the wParam message of this function and lParam containing the handle of the object.
 | ANNLINK_RUN | [0x0003] The program specified in pLink will be run. Both the program and the command line parameters have to be specified in pLink.
 | ANNLINK_WEBPAGE | [0x0004] The web page with the URL specified in pLink will be opened in the current browser. Note that not all web browsers accept a page on the command line. Some will simply go to their default home page.
uMsg | Value indicating a user defined message that will be sent to the window associated with the annotation object if uType is ANNLINK_USERMSG. This parameter will be ignored if uType is anything other than ANNLINK_USERMSG.
wParam | wParam value that is passed to the user defined message if uType is ANNLINK_USERMSG.
pLink | Character string containing the program to run when the object is clicked, if uType is ANNLINK_RUN. If uType is ANNLINK_WEBPAGE, it is the URL to be accessed by the default browser. This string should be NULL terminated. This parameter is ignored if uType contains any other value.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

The data pointed to by pLink is copied. If you dynamically allocated a buffer to hold the data, you should free the string after calling this function.

All objects can be hyperlinked, however, locked objects do not generate hyperlink actions.

Default hyperlink type is ANNLINK_NONE.

For the objects that already have an associated action in run mode (hotspot, button, audio), the hyperlink is processed before their associated action.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetHyperlink, L_AnnGetHyperlinkLen, L_AnnSetHyperlinkMenuEnable, L_AnnGetHyperlinkMenuEnable, L_AnnGetSelected, L_AnnSetSelected
Topics | Annotation Functions (Document/Medical only): Hyperlinks
 | Implementing Annotation Hyperlinks
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

HANNOBJECT hAutoObject; /* Automation object */
HANNOBJECT hContainer; /* Container object */
void TestAnnHyperlink(HANNOBJECT hAnnObject)
{
/* change the automation object and all selected objects in the container
to have a webpage hyperlink */
L_AnnSetHyperlink(hAnnObject, ANNLINK_WEBPAGE, 0, 0, TEXT("http://www.leadtools.com"), 0);
/* if you wish to have all objects in the container set with the same hyperlink, uncomment the next line */
/*L_AnnSetHyperlink(hContainer, ANNLINK_WEBPAGE, 0, 0, TEXT("http://www.leadtools.com"), ANNFLAG_RECURSE|ANNFLAG_SELECTED);*/
return;
}


L_AnnSetHyperlinkMenuEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetHyperlinkMenuEnable (hObject, fEnable, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_BOOL fEnable; | /* flag that indicates whether to show the hyperlink menu item */
L_UINT uFlags; | /* reserved for future use */

Enables or disables the displaying of the hyperlink menu item when you click the right mouse button in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
fEnable | Flag that indicates whether to display the hyperlink menu item when you right click in design mode. Possible values are:
 | Value | Meaning
 | TRUE | Show the hyperlink menu item when you click the right mouse button in design mode.
 | FALSE | Do not show the hyperlink menu item.
uFlags | Reserved for future use. You can pass 0.

Returns

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

Comments

This function applies only to automation objects.

Set fEnable to TRUE if you want to bring up a dialog box to select the type of hyperlink an object will have. There is no default way to set the hyperlink type. The text in the menu is given by ANNAUTOTEXT_MENU_HYPERLINK (see L_AnnSetAutoText).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetHyperlinkMenuEnable, L_AnnSetHyperlink, L_AnnGetHyperlinkLen, L_AnnGetHyperlink, L_AnnSetAutoText
Topics | Annotation Functions (Document/Medical only): Hyperlinks
 | Annotation Objects - Automated Features
 | Implementing Annotation Hyperlinks
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

HANNOBJECT hAutoObject; /* Automation object */
void TestAnnHyperlinkMenu(void)
{
L_BOOL bEnabled;

/* toggle display of HyperLink menu item */
L_AnnGetHyperlinkMenuEnable(hAutoObject, &bEnabled);
if(bEnabled)
/* disable menu item */
L_AnnSetHyperlinkMenuEnable (hAutoObject, FALSE, 0);
else
/* enable menu item */
L_AnnSetHyperlinkMenuEnable(hAutoObject, TRUE, 0);
return;
}


L_AnnSetLineStyle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetLineStyle(hObject, uLineStyle, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the line style of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uLineStyle | The constant that specifies the line style. Possible line style values are:
 | Value | Meaning
 | ANNLINE_SOLID | [0] Solid line
 | ANNLINE_DASH | [1] Dashed line
 | ANNLINE_DOT | [2] Dotted line
 | ANNLINE_DASHDOT | [3] Dash dot line
 | ANNLINE_DASHDOTDOT | [4] Dash dot dot line
 | ANNLINE_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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_LINE menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetLineWidth, L_AnnGetLineWidth, L_AnnGetLineStyle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnLineStyle(HANNOBJECT hAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
L_AnnGetLineStyle(hAnnObject, &LineStyle);
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
L_AnnSetLineStyle(hAnnObject, ANNLINE_DASH, 0);
return;
}


L_AnnSetLineWidth

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetLineWidth(hObject, dLineWidth, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dLineWidth; | /* unscaled line width of an object */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the unscaled line width of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dLineWidth | 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.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_LINE menu item has been selected.

Returns

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

Comments

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 L_AnnGetScalarX function, and C is the value that you get from the L_AnnGetScalarY function:

dLineWidth = A / sqrt( B * C )

For more information, refer to Low-Level Coordinate System for Annotations.

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetLineWidth, L_AnnSetLineStyle, L_AnnGetLineStyle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnLineWidth(HANNOBJECT hAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
L_AnnGetLineWidth(hAnnObject, &LineWidth);
L_AnnSetLineWidth(hAnnObject, LineWidth * 2, 0);
return;
}


L_AnnSetMetafile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetMetafile(hObject, hMetafile, uType, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
HMETAFILE hMetafile; | /* handle to a metafile */
L_UINT uType; | /* constant that indicates the metafile to set */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the metafile for an object that uses a metafile. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
hMetafile | Handle to a metafile.
uType | Constant that indicates the metafile to set. Possible values are:
 | Value | Meaning
 | ANNMETAFILE_USER | [0x7FFF] user-defined metafiles
 | ANNMETAFILE_APPROVED | [0] predefined metafiles - APPROVED
 | ANNMETAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
 | ANNMETAFILE_CHECKED | [2] predefined metafile -CHECKED
 | ANNMETAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
 | ANNMETAFILE_COPY | [4] predefined metafile - COPY
 | ANNMETAFILE_DRAFT | [5] predefined metafile - DRAFT
 | ANNMETAFILE_EXTENDED | [6] predefined metafile - EXTENDED
 | ANNMETAFILE_FAX | [7] predefined metafile - FAX
 | ANNMETAFILE_FAXED | [8] predefined metafile - FAXED
 | ANNMETAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
 | ANNMETAFILE_INVOICE | [10] predefined metafile - INVOICE
 | ANNMETAFILE_NOTICE | [11] predefined metafile - NOTICE
 | ANNMETAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
 | ANNMETAFILE_ONFILE | [13] predefined metafile - ON FILE
 | ANNMETAFILE_PAID | [14] predefined metafile - PAID
 | ANNMETAFILE_PASSED | [15] predefined metafile - PASSED
 | ANNMETAFILE_PENDING | [16] predefined metafile - PENDING
 | ANNMETAFILE_PROCESSED | [17] predefined metafile - PROCESSED
 | ANNMETAFILE_RECEIVED | [18] predefined metafile - RECEIVED
 | ANNMETAFILE_REJECTED | [19] predefined metafile - REJECTED
 | ANNMETAFILE_RELEASE | [20] predefined metafile - RELEASE
 | ANNMETAFILE_SENT | [21] predefined metafile - SENT
 | ANNMETAFILE_SHIPPED | [22] predefined metafile - SHIPPED
 | ANNMETAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
 | ANNMETAFILE_URGENT | [24] predefined metafile - URGENT
 | ANNMETAFILE_VOID | [25] predefined metafile - VOID
 | ANNMETAFILE_HOTSPOT | [26] predefined metafile for Hotspots and Freehand hotspots.
 | ANNMETAFILE_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
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_METAFILE menu item has been selected.

Returns

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

Comments

The L_AnnSetMetafile function is valid only for the following object types:

Encrypt

Freehand Hotspot

Hotspot

Stamp

If uType == ANNMETAFILE_USER, then hMetafile is the metafile handle. You can use any of the windows functions to create a metafile.

If uType is one of the ANNMETAFILE_XXX values, the hMetafile value 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 L_AnnSetPredefinedMetafile function.

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.

Calling the L_AnnSetMetafile function changes the metafile for the selected objects. Any new objects will still get the default metafile. To change the default metafiles for newly created objects that use metafiles, call the L_AnnSetPredefinedMetafile function.

Call the L_AnnGetMetafile function to retrieve a metafile for an object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetPredefinedMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnEncryptApply, L_AnnGetSecondaryMetafile, L_AnnGetPredefinedBitmap, L_AnnSetPredefinedBitmap, L_AnnGetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Example

For an example, refer to L_AnnGetPredefinedMetafile.


L_AnnSetNameOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetNameOptions(hObject, pNameOptions, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNNAMEOPTIONS pNameOptions; | /* pointer to a structure that specifies name options */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the options for the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pNameOptions | Pointer to an ANNNAMEOPTIONS structure that specifies the name options to set.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function to set the name options of any annotation object. To use this function, declare a variable of type ANNNAMEOPTIONS, and pass the address of this variable for pNameOptions. For more information, refer to the documentation for the structure ANNNAMEOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetPredefinedMetafile, L_AnnGetPredefinedMetafile, L_AnnSetMetafile, L_AnnGetNameOptions, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnEncryptApply, L_AnnGetSecondaryMetafile, L_AnnGetPredefinedBitmap, L_AnnSetPredefinedBitmap, L_AnnGetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

/*************************************************************************/
//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

L_INT EXT_CALLBACK annSetNameCallback(HANNOBJECT hObject, L_INT L_FAR * pUserData)
{
L_TCHAR *pszOldName;
L_TCHAR *pszNewName;
L_UINT uObjectType;
L_TCHAR szMsg[200];
ANNPOINT NameOffset = {0,0};
ANNNAMEOPTIONS NameOptions;

memset(&NameOptions, 0, sizeof(ANNNAMEOPTIONS));
NameOptions.uStructSize = sizeof(ANNNAMEOPTIONS);
NameOptions.uFlags = ANNNAME_NAME_LENGTH;

L_AnnGetNameOptions(hObject, &NameOptions, sizeof(ANNNAMEOPTIONS));

NameOptions.pszName = (L_TCHAR *)malloc(NameOptions.uNameLen + 1 * sizeof (L_TCHAR) );
pszOldName = NameOptions.pszName;

NameOptions.uFlags = ANNNAME_NAME;
L_AnnGetNameOptions(hObject, &NameOptions, sizeof(ANNNAMEOPTIONS));

L_AnnGetType(hObject, &uObjectType);
if (ANNOBJECT_BUTTON == uObjectType)
{
pszNewName = TEXT("Name Restricted");
NameOptions.bNameRestrict = TRUE;
}
else
{
pszNewName = TEXT("Name Unrestricted");
NameOptions.bNameRestrict = FALSE;
}

NameOptions.pszName = pszNewName;
NameOptions.uFlags = ANNNAME_NAME | ANNNAME_RESTRICT;
L_AnnSetNameOptions( hObject, &NameOptions, 0);

wsprintf(szMsg, TEXT("Old Name = %s\nNew Name = %s\n"), pszOldName, pszNewName);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);

free(pszOldName);

return SUCCESS;
}

L_VOID SampleAnnSetNameOptions(HANNOBJECT hContainer)
{
L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)annSetNameCallback, NULL, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, NULL);
}


L_AnnSetNodes

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetNodes(hObject, bShowNodes, uGapNodes, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bShowNodes; | /* flag that indicates whether to show the nodes */
L_UINT uGapNodes; | /* distance between nodes */
L_UINT uFlags; | /* flags that determine which objects to process */

Determines which nodes will be shown for those annotation objects that use nodes. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object.
bShowNodes | Flag that indicates whether to show the nodes. Possible values are:
 | Value | Meaning
 | TRUE | Show the nodes.
 | FALSE | Do not show the nodes.
uGapNodes | 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. |

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_NODES menu item has been selected.

Returns

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

Comments

Determines which nodes of the annotation object should display when in design mode.

This function 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 function determines how the nodes for the object will be displayed in design mode.

If hObject is an Automation object, this function 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 function determines how the nodes of the Curve, Closed Curve, Polygon, Polylines, Freehand Hot Spot, or Freehand objects within the container will be displayed.

If bShowNodes is set to FALSE, uGapNodes will be ignored since the nodes will not be shown anyway.

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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

L_INT EXT_CALLBACK annEnumCallback(HANNOBJECT hObject, L_INT L_FAR * pUserData)
{
L_BOOL ShowNodes;
L_UINT GapNodes, Type;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_POLYGON:
case ANNOBJECT_POLYLINE:
case ANNOBJECT_FREEHAND:
L_AnnGetNodes(hObject, &ShowNodes, &GapNodes);
if (ShowNodes == FALSE)
ShowNodes = TRUE;
if (GapNodes != 1)
GapNodes = 1;
L_AnnSetNodes(hObject, ShowNodes, GapNodes, 0);
break;
default:
MessageBox(NULL, TEXT("This object does not have nodes."), TEXT("Notice"), MB_OK);
}
return SUCCESS;
}

void TestFunction1(void)
{
L_AnnEnumerate(hContainer, annEnumCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL);
}


L_AnnSetOffsetX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetOffsetX(hObject, dOffsetX, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dOffsetX; | /* new value of the X offset */
L_UINT uFlags; | /* flags that determine which objects to process */

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. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject | Handle to the annotation object.
dOffsetX | The new value of the X offset.
uFlags | 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 ( | ).
 | Note: Normally, you set this property only on the root container. The flags are included only to give you the same level of control as with other properties.
 | The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

The offset values are applied after the scalar properties, which are set by the L_AnnSetScalarX and L_AnnSetScalarY functions. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Altering Annotation Object Settings

Example

For another example, refer to Implementing a Non-automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.

/* This example moves all objects down and to the right by changing the container offsets */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnOffset(void)
{
L_DOUBLE OffsetX, OffsetY; /* Variables for updating offsets */
ANNRECT ContainerRect;
ANNRECT ContainerRectName;

L_AnnGetOffsetX(hContainer, &OffsetX);
L_AnnGetOffsetY(hContainer, &OffsetY);
/* Get the container rectangle to use for positioning the line */
L_AnnGetRect(hContainer, &ContainerRect, &ContainerRectName);
L_AnnSetOffsetX (hContainer,
OffsetX + ((ContainerRect.right - ContainerRect.left) / 20),
0);
L_AnnSetOffsetY(hContainer,
OffsetX + ((ContainerRect.bottom - ContainerRect.top) / 20),
0);
return;
}


L_AnnSetOffsetY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetOffsetY(hObject, dOffsetY, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dOffsetY; | /* new value of the Y offset */
L_UINT uFlags; | /* flags that determine which objects to process */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dOffsetY | The new value of the Y offset.
uFlags | 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 ( | ).
 | Note: Normally, you set this property only on the root container. The flags are included only to give you the same level of control as with other properties.
 | The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

The offset values are applied after the scalar properties, which are set by the L_AnnSetScalarX and L_AnnSetScalarY functions. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnSetScalarY, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Altering Annotation Object Settings

Example

For a short example, refer to Implementing a Non-automated Annotation Program or L_AnnSetOffsetX.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetOptions(hAutomation, uOptions)

HANNOBJECT hAutomation; | /* handle to the automation object */
L_UINT uOptions; | /* annotation options to set */

Sets user interface and other annotation options introduced in version 14.5. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutomation | Handle to the automation object.
uOptions | Options to enable. Use a bitwise OR to specify more than one value.
 | Value | Meaning
 | OPTIONS_NEW_STAMP_METAFILES | [0x0001] Uses the new rubber stamp styles.
 | OPTIONS_NEW_TOOLBAR | [0x0002] Displays the new XP style annotation toolbar.
 | OPTIONS_NEW_ALPHA | [0x0004] Displays new "alpha" option in the Fill mode dialog.
 | OPTIONS_NEW_ROTATE | [0x0008] Displays rotate handles on objects in design mode.
 | OPTIONS_NEW_SIDE_HANDLES | [0x0010] Displays side handles on rectangular objects in design mode.
 | OPTIONS_NEW_MULTI_SELECT | [0x0020] Displays a multiselect outline of multiply selected objects, along with the new multi-select resize behavior.
 | OPTIONS_NEW_CURSORS | [0x0040] Displays different cursors for each of the annotation tools, and when hovering over handles in design mode.
 | OPTIONS_NEW_ESC_CANCEL | [0x0080] Allows the user to cancel current action by pressing ESC. Actions include annotation creation and manipulation.
 | OPTIONS_NEW_CALIBRATE_RULER | [0x0100] Enables ruler calibrate feature in design mode
 | OPTIONS_NEW_DOT_DASH_LINES | [0x0200] Draws the dash and dot line styles with line width greater than 1 pixel.
 | OPTIONS_NEW_TEXT_OPTIONS | [0x0400] Enables new text annotation options including show/hide text, show/hide border, and changing text color.
 | OPTIONS_NEW_ALL | Enables ALL the new options. The value for this constant is the logical "or" of all the above flags.

Returns

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

Comments

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 L_AnnSetOptions with the desired flags. To get the current Version 14.5 options, call the L_AnnGetOptions function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetOptions; ANNBUTTON, L_AnnFreeToolBarButtons, L_AnnGetToolBarButtons, L_AnnSetToolBarButtons, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnSetAutoCursor, L_AnnGetAutoCursor, L_AnnSave, L_AnnSaveOffset, L_AnnSaveMemory, L_AnnLoad, L_AnnLoadOffset, L_AnnLoadMemory, L_AnnSetTextOptions, L_AnnGetTextOptions
Topics: | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Example

// This example demonstrates how to enable/disable the new
// 'side handle' annotation feature in version 14.5. To see how this works,
// paste this example into the main annotation demo, draw a rectangle,
// and select it before calling this function. The example toggles the feature.

L_VOID ExampleAnnSetOptions(HANNOBJECT hAutomation)
{
L_CHAR *pszMsg = NULL;
L_INT nRet = SUCCESS;
L_UINT uOptions = 0;
nRet = L_AnnGetOptions(&uOptions);
if (nRet != SUCCESS)
return;

if (uOptions & OPTIONS_NEW_SIDE_HANDLES)
{
uOptions &= ~OPTIONS_NEW_SIDE_HANDLES;
pszMsg = "Draw a rectangular object and select it. Note there are no side handles. Run this example again to enable the side handles.";
}
else
{
uOptions |= OPTIONS_NEW_SIDE_HANDLES;
pszMsg = "Draw a rectangular object and select it. Note the side handles. Run this example again to disable the side handles.";

}

L_AnnSetOptions(hAutomation, uOptions);
MessageBox(NULL, pszMsg, "Notice", MB_OK);
}


L_AnnSetPointOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetPointOptions (hObject, pPointOptions, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINTOPTIONS pPointOptions; | /* pointer to a structure that specifies various point options */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the options for the specified point annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPointOptions | Pointer to an ANNPOINTOPTIONS structure that specifies various point options to set.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function to set the point options of an annotation point object. To use this function, declare a variable a type ANNPOINTOPTIONS, and pass the address of this variable for pPointOptions. For more information, refer to the documentation for the structure ANNPOINTOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetPredefinedMetafile, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnGetPointOptions.


L_AnnSetPoints

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetPoints(hObject, pPoints, uCount)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNPOINT pPoints; | /* points that specify the shape of the annotation */
L_UINT uCount; | /* number of points */

Defines the shape of an annotation object, such as a polygon, that requires multiple points. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pPoints | Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the shape of the annotation.
 | The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.
 | 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.
uCount | The number of points in the array that you specify in the pPoints parameter.

Returns

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

Comments

You call this function once, passing an array of points, 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, you can use the L_AnnDefine function to specify the array of points interactively.

L_AnnSetPoints works only with the following types of objects:

ANNOBJECT_POINTER
ANNOBJECT_FREEHAND
ANNOBJECT_LINE
ANNOBJECT_POLYGON
ANNOBJECT_POLYLINE
ANNOBJECT_POINT
ANNOBJECT_PROTRACTOR
ANNOBJECT_FREEHANDHOTSPOT
ANNOBJECT_TEXTPOINTER
ANNOBJECT_POLYRULER

For annotation objects that are defined by a rectangle, use the L_AnnSetRect function.

You can position a Point object using the following:

ANNPOINT apt;
L_AnnSetPoints(hPoint, apt, 1);

where apt contains the desired position.

To set the points of a cross-product object, do the following:

ANNPOINT apt[5];
L_AnnGetPoints(hPoint, apt, 5);

hPoint is the handle to the cross-product object. apt[0] and apt[1] are the points for the primary ruler. apt[2] is the intersection point. apt[3] and apt[4] are the points for the secondary ruler.

To set the points of a protractor object, do the following:

ANNPOINT apt [3];
L_AnnSetPoints(hPoint, apt, 3);

hPoint is the handle to the protractor object. apt[0] and apt[2] are the endpoints for the two rulers. apt[1] is the intersection point. This is shown below:

When calling L_AnnSetPoints on a ANNOBJECT_TEXTPOINTER object, specify three points. The three points are (Upper Left), (Lower Right), (Anchor).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack, L_AnnSetRect, L_AnnGetRect, L_AnnGetBoundingRect, L_AnnGetPointCount, L_AnnGetPoints
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnCreate.


L_AnnSetPolyFillMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetPolyFillMode(hObject, uPolyFillMode, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uPolyFillMode; | /* constant that specifies the polygon fill mode */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the value that determines how a polygonal annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uPolyFillMode | The constant that specifies the polygon fill mode. Possible polygon fill mode values are:
 | Value | Meaning
 | ANNPOLYFILL_WINDING | [0] All pixels that are inside the resulting exterior lines are filled.
 | ANNPOLYFILL_ALTERNATE | [1] The filled area includes the area between odd-numbered and even-numbered polygon sides on each scan line.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function affects only polygon objects. For descriptions of the various types of objects and their properties, refer to Types of Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetFillPattern, L_AnnGetFillPattern, L_AnnSetFillMode, L_AnnGetFillMode, L_AnnGetPolyFillMode, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

void TestAnnPolyFillMode(HANNOBJECT hAnnObject)
{
L_UINT PolyFillMode; /* Object's polygonal fill mode */
/* Change the fill mode */
L_AnnGetPolyFillMode(hAnnObject, &PolyFillMode);
if (PolyFillMode == ANNPOLYFILL_WINDING)
L_AnnSetPolyFillMode (hAnnObject, ANNPOLYFILL_ALTERNATE, 0);
else
L_AnnSetPolyFillMode (hAnnObject, ANNPOLYFILL_WINDING, 0);
return;
}


L_AnnSetPredefinedBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetPredefinedBitmap(uType, pBitmap)

L_UINT uType; | /* value that indicates the bitmap to change */
pBITMAPHANDLE pBitmap; | /* pointer to a valid bitmap handle containing an image */

Changes a predefined bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
uType | Value that indicates the bitmap to change. Possible values are:
 | Value | Meaning
 | ANNBITMAP_POINT | [0] predefined metafile for annotation point object
pBitmap | Pointer to a valid bitmap handle containing the image to set.

Returns

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

Comments

This function is valid only for the ANNOBJECT_POINT object. This function affects point objects created by the automation object. For example, if you replace the ANNBITMAP_POINT default bitmap handle with another bitmap handle, then objects created by the automation mode when the ANNBITMAP_POINT tool is set will look like the new bitmap handle.

A bitmap handle can be reset to its original metafile by passing NULL for pBitmap. For example, to reset the point bitmap handle to the original value, do the following:

L_AnnSetPredefinedBitmap(ANNBITMAP_POINT, (pBITMAPHANDLE)NULL);

Call the L_AnnSetPredefinedBitmap function to retrieve a copy of the predefined bitmap.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_ScrambleBitmap, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnGetPredefinedBitmap.


L_AnnSetPredefinedMetafile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetPredefinedMetafile(uType, hMetafile)

L_UINT uType; | /* constant that indicates the metafile to change */
HMETAFILE hMetafile; | /* handle to a metafile */

Changes a predefined metafile. This function is available in the Document/Medical Toolkits.

Parameter | Description
uType | Constant that indicates the metafile to change. Possible values are:
 | Value | Meaning
 | ANNMETAFILE_APPROVED | [0] predefined metafiles - APPROVED
 | ANNMETAFILE_ASSIGNED | [1] predefined metafile - ASSIGNED
 | ANNMETAFILE_CHECKED | [2] predefined metafile -CHECKED
 | ANNMETAFILE_CLATPRV | [3] predefined metafile - CLIENT ATTORNEY PRIVILEGE
 | ANNMETAFILE_COPY | [4] predefined metafile - COPY
 | ANNMETAFILE_DRAFT | [5] predefined metafile - DRAFT
 | ANNMETAFILE_EXTENDED | [6] predefined metafile - EXTENDED
 | ANNMETAFILE_FAX | [7] predefined metafile - FAX
 | ANNMETAFILE_FAXED | [8] predefined metafile - FAXED
 | ANNMETAFILE_IMPORTANT | [9] predefined metafile - IMPORTANT
 | ANNMETAFILE_INVOICE | [10] predefined metafile - INVOICE
 | ANNMETAFILE_NOTICE | [11] predefined metafile - NOTICE
 | ANNMETAFILE_OFFICIAL | [12] predefined metafile - OFFICIAL
 | ANNMETAFILE_ONFILE | [13] predefined metafile - ON FILE
 | ANNMETAFILE_PAID | [14] predefined metafile - PAID
 | ANNMETAFILE_PASSED | [15] predefined metafile - PASSED
 | ANNMETAFILE_PENDING | [16] predefined metafile - PENDING
 | ANNMETAFILE_PROCESSED | [17] predefined metafile - PROCESSED
 | ANNMETAFILE_RECEIVED | [18] predefined metafile - RECEIVED
 | ANNMETAFILE_REJECTED | [19] predefined metafile - REJECTED
 | ANNMETAFILE_RELEASE | [20] predefined metafile - RELEASE
 | ANNMETAFILE_SENT | [21] predefined metafile - SENT
 | ANNMETAFILE_SHIPPED | [22] predefined metafile - SHIPPED
 | ANNMETAFILE_TOPSECRET | [23] predefined metafile - TOP SECRET
 | ANNMETAFILE_URGENT | [24] predefined metafile - URGENT
 | ANNMETAFILE_VOID | [25] predefined metafile - VOID
 | ANNMETAFILE_HOTSPOT | [26] predefined metafile for Hotspots and Freehand hotspots.
 | ANNMETAFILE_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
hMetafile | Handle to the metafile used to replace the specified predefined metafile. Passing NULL will reset the predefined metafile specified by uType to its original metafile.

Returns

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

Comments

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 the Freehand Hotspot predefined metafiles to the original value, do the following:

L_AnnSetPredefinedMetafile(ANNMETAFILE_HOTSPOT, (HMETAFILE)NULL);

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetPredefinedMetafile, L_AnnGetMetafile, L_AnnSetMetafile, L_ScrambleBitmap, L_AnnGetEncryptOptions, L_AnnSetEncryptOptions, L_AnnEncryptApply, L_AnnGetSecondaryMetafile, L_AnnGetPredefinedBitmap, L_AnnSetPredefinedBitmap, L_AnnGetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Example

Please note that the following TestFunction uses the GetEnhMetaFile function which is for WIN32.

void TestFunction1(void)
{
HENHMETAFILE hClassified;
/* Get the handle to the metafile. */
hClassified = GetEnhMetaFile(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\Classified.emf"));
if (hClassified != NULL)
{
MessageBox(NULL, TEXT("Have metafile handle."), TEXT(""), MB_OK);
/* Set the ANNMETAFILE_OFFICIAL metafile to the new metafile */
L_AnnSetPredefinedMetafile(ANNMETAFILE_OFFICIAL, (HMETAFILE)hClassified);
/* Reset the toolbar menu text */
L_AnnSetAutoText(NULL, ANNAUTOTEXT_MENU_STAMP_OFFICIAL, TEXT("Classified"));
}
else
{
MessageBox(NULL, TEXT("No handle."), TEXT(""), MB_OK);
DeleteEnhMetaFile(hClassified);
}
}


L_AnnSetProtractorOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetProtractorOptions(hObject, bAcute, uUnit, pszAbbrev, uPrecision, dArcRadius, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bAcute; | /* flag that indicates which angle to set */
L_UINT uUnit; | /* flag that indicates the units of the angle */
L_TCHAR L_FAR * pszAbbrev; | /* address of the character string containing the unit abbreviation string */
L_UINT uPrecision; | /* number of digits */
L_DOUBLE dArcRadius; | /* length of the arc radius */
L_UINT uFlags; | /* flag that determine which objects to process */

Sets various options for a Protractor object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bAcute | Flag that indicates whether to draw the inside (acute or <180 degrees) angle or the outside (obtuse or >180 degrees) angle of the protractor. Possible values are:
 | Value | Meaning
 | TRUE | Draw the inside (acute) angle of the protractor.
 | FALSE | Draw the outside (obtuse) angle of the protractor.
uUnit | Flag that indicates the units of the angle. Possible values are:
 | Value | Meaning
 | ANNANGLE_DEGREES | Measure the angle in degrees. The default abbreviation for this unit is the degree sign.
 | ANNANGLE_RADIANS | Measure the angle in radians. The default abbreviation for this unit is "rad".
pszAbbrev | Character string that contains the abbreviation to be put after the angle. Use NULL to set the default abbreviation for the specified unit.
uPrecision | The number of digits after the decimal. ( "." ) Valid values are 0 – 200.
dArcRadius | The arc radius.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Note: This function 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 uFlags.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetProtractorOptions, L_AnnGetAngle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

L_INT EXT_CALLBACK annEnumCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_UINT Type, Unit;
L_BOOL Acute;
L_DOUBLE Radius;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_PROTRACTOR:
L_AnnGetProtractorOptions(hObject, &Acute, &Unit, NULL, NULL, NULL, &Radius);
if (Acute == TRUE)
Acute = FALSE;
else
Acute = TRUE;
if (Unit == ANNANGLE_DEGREES)
Unit = ANNANGLE_RADIANS;
else
Unit = ANNANGLE_DEGREES;
if (Radius >= 25)
Radius = 10;
else
Radius = 25;
L_AnnSetProtractorOptions(hObject, Acute, Unit, NULL, 2, Radius, 0);
break;
default:
MessageBox(NULL, TEXT("This object is not a protractor."), TEXT("Notice"), MB_OK);
}
return SUCCESS;
}

HANNOBJECT hContainer;
void TestFunction1(void)
{
L_AnnEnumerate(hContainer, annEnumCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL);
}


L_AnnSetRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetRect(hObject, pRect)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNRECT pRect; | /* pointer to the ANNRECT structure for the container */

Sets the defining rectangle of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRect | Pointer to the LEADTOOLS ANNRECT structure that specifies the container. The ANNRECT structure is like a Windows RECT structure, except that it uses double-precision floating point values.
 | Coordinates of an object's rectangle 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.

Returns

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

Comments

You can use this function to set the dimensions of an annotation object, such as a rectangle or ellipse, that is defined by a rectangle. For polygonal objects, you can use the L_AnnSetPoints or L_AnnDefine function.

The coordinates of the rectangle are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnBringToFront, L_AnnSendToBack, L_AnnGetRect, L_AnnSetPoints, L_AnnGetBoundingRect, L_AnnGetPointCount, L_AnnGetPoints
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing a Non-automated Annotation Program.


L_AnnSetRestrictToContainer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetRestrictToContainer(hObject, bRestrict, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bRestrict; | /* flag that specifies whether to restrict the object to the container */
L_UINT uFlags; | /* flags that determine which objects to process */

Restricts one or more annotation objects to a container. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object
bRestrict | Boolean value that specifies whether to restrict the object to the container. Possible values are:
 | Value | Meaning
 | TRUE | Restrict the object to the container.
 | FALSE | Do not restrict the object to the container.
uFlags | Flags that determine which objects to process. Possible values are:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_BACKGROUNDCOLOR menu item has been selected.

Returns

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

Comments

If an object is restricted to the container, then no part of that object can be moved outside of the container using automation.

All annotation objects support restriction.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnRestrictCursor, L_AnnRestrictCursor, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Custom Annotations
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

// This example toggles the "restrict to container" property of the annotation to the container
// If an object is restricted to the container, no part of it can be moved outside the container.
L_VOID ExampleAnnSetRestrictToContainer(HANNOBJECT hObject)
{
L_BOOL bRestrict;
L_INT nRet;
L_TCHAR *pszMsg;

nRet = L_AnnGetRestrictToContainer(hObject, &bRestrict);
if (nRet == SUCCESS)
{
bRestrict = !bRestrict;
L_AnnSetRestrictToContainer(hObject, bRestrict, 0);
pszMsg = bRestrict ? TEXT("Restricted to container") : TEXT("Not restricted to container");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
}


L_AnnSetROP2

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetROP2(hObject, uROP2, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uROP2; | /* constant that specifies a ROP code */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the binary raster operation (ROP2) code for one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uROP2 | 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
 | ANNROP2_COPY | [0x0000] Draw the object using the object's color
 | ANNROP2_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.
 | ANNROP2_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.
 | The default value is ANNROP2_COPY.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_ROP2 menu item has been selected.

Returns

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

Comments

The L_AnnSetROP2 function 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 L_AnnSetForeColor and L_AnnSetBackColor), and call this function with uROP2 set to ANNROP2_AND.

L_AnnSetROP2 is valid only for the following object types:

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_CURVE

ANNOBJECT_CURVECLOSED

ANNOBJECT_ELLIPSE

ANNOBJECT_FREEHAND

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_LINE

ANNOBJECT_POINTER

ANNOBJECT_POINT

ANNOBJECT_POLYGON

ANNOBJECT_POLYLINE

ANNOBJECT_POLYRULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_RECT

ANNOBJECT_RULER

ANNOBJECT_STAMP

ANNOBJECT_TEXTPOINTER

In addition, the Automation object stores ROP2 settings along with the other object default settings

Note that L_AnnSetROP2 and L_AnnSetFillModeExt affect each other. If you set uFillMode to ANNMODE_OPAQUE, then uROP2 cannot be ANNROP2_AND. If you set uFillMode to ANNMODE_TRANSLUCENT, then uROP2 has to be ANNROP2_AND. If you set uFillMode to ANNMODE_TRANSPARENT, uROP2 can be anything.

Use the L_AnnGetROP2 function 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 L_AnnSetAutoHilightPen function for that automation object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetROP2, L_AnnGetFillMode, L_AnnSetFillMode, L_AnnSetBackColor, L_AnnSetForeColor, L_AnnGetSelected, L_AnnSetSelected, L_AnnGetTransparent, L_AnnSetTransparent, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Getting and Setting the ROP2 Property

Example

void TestAnnROP2(HANNOBJECT hAnnObject)
{
L_UINT uRop2; /* ROP2 code */

/* Get the current ROP2 code */
L_AnnGetROP2(hAnnObject, &uRop2);

/* if the code is not ANNROP2_AND, make it so */
if(uRop2 != ANNROP2_AND)
{
/* make sure the FillMode is set to Transparent */
L_AnnSetFillMode(hAnnObject, ANNMODE_TRANSPARENT, ANNFLAG_RECURSE);

/* set ROP2 code */
L_AnnSetROP2(hAnnObject, ANNROP2_AND, ANNFLAG_RECURSE);
}
return;
}


L_AnnSetRotateOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetRotateOptions(hObject, pRotateOptions, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNROTATEOPTIONS pRotateOptions; | /* pointer to the ANNROTATEOPTIONS structure */
L_UINT uFlags; | /* flags that indicate which objects to process */

Sets the rotation options for the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pRotateOptions | Pointer to an ANNROTATEOPTIONS structure that specifies the rotate options to set.
uFlags | Flags that indicate 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any sub containers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function to set the rotate options of any annotation object, including the automation object. To use this function, declare a variable of type ANNROTATEOPTIONS, and pass the address of this variable for pRotateOptions. For more information, refer to the documentation for the structure ANNROTATEOPTIONS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetRotateOptions
Topics: | Annotation Functions: Getting and Setting the Rotation Options
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnGetRotateOptions.


L_AnnSetScalarX

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetScalarX(hObject, dScalarX, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dScalarX; | /* horizontal scaling factor to apply */
L_UINT uFlags; | /* flags that determine which objects to process */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dScalarX | The horizontal scaling factor to apply.
uFlags | 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 ( | ).
 | Note: Normally, you set this property only on the root container. The flags are included only to give you the same level of control as with other properties.
 | The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Offset values, which are set by the L_AnnSetOffsetX and L_AnnSetOffsetY functions, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarY, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing a Non-automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetScalarY

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetScalarY(hObject, dScalarY, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_DOUBLE dScalarY; | /* vertical scaling factor to apply */
L_UINT uFlags; | /* flags that determine which objects to process */

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
dScalarY | The vertical scaling factor to apply.
uFlags | 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 ( | ).
 | Note: Normally, you set this property only on the root container. The flags are included only to give you the same level of control as with other properties.
 | The following are valid values:
 | Value | Meaning
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Offset values, which are set by the L_AnnSetOffsetX and L_AnnSetOffsetY functions, are applied after the scalar properties. For more information, refer to Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetScalarX, L_AnnGetScalarX, L_AnnGetScalarY, L_AnnSetOffsetX, L_AnnSetOffsetY, L_AnnGetOffsetX, L_AnnGetOffsetY, L_AnnGetFixed, L_AnnSetFixed, L_AnnPushFixedState, L_AnnPopFixedState, L_AnnIsFixedInRect
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker with Double Buffering
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing a Non-automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetSecondaryBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetSecondaryBitmap(hObject, pBitmap, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
pBITMAPHANDLE pBitmap; | /* pointer to a bitmap */
L_UINT uFlags; | /* flags that indicate which objects to process */

Sets the secondary bitmap used by the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pBitmap | Pointer to a bitmap handle that references the bitmap to be set as the secondary bitmap.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_SECONDARYFILE menu item has been selected.

Returns

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

Comments

Only PushPin objects use a secondary bitmap.

A pushpin object has a primary bitmap, (manipulated using L_AnnSetBitmap/L_AnnGetBitmap) when the text is shown, and a secondary bitmap, changed using L_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 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetSecondaryBitmap
Topics: | Annotation Functions: Object Properties
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Annotation Bitmap Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Example

L_INT EXT_CALLBACK annSecondCallback(HANNOBJECT hObject, pBITMAPHANDLE pBitmap)
{
BITMAPHANDLE OldBitmap;
L_INT nRet;
L_UINT Type;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_PUSHPIN:
nRet = L_AnnGetSecondaryBitmap(hObject, &OldBitmap, sizeof(BITMAPHANDLE));
if (nRet == SUCCESS)
{
MessageBox(NULL, TEXT("Secondary bitmap retrieved."), TEXT(""), MB_OK);
L_AnnSetSecondaryBitmap(hObject, pBitmap, 0);
}
else
MessageBox(NULL, TEXT("Error getting secondary bitmap."), TEXT(""), MB_OK);
break;
default:
MessageBox(NULL, TEXT("Object must be a push pin."), TEXT(""), MB_OK);
}
return SUCCESS;
}

HANNOBJECT hContainer; /* Container annotation object */

void TestAnnSetSecondaryBitmap ()

{

BITMAPHANDLE NewBitmap;

L_LoadBitmap( TEXT("ATest.bmp"), &NewBitmap, sizeof(BITMAPHANDLE), 0,ORDER_BGR, 0, NULL);

L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)annSecondCallback, &NewBitmap, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, 0);

}


L_AnnSetSelected

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetSelected(hObject, fSelected, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fSelected; | /* flag that indicates whether to select or deselect an object */
L_UINT uFlags; | /* flags that determine which objects to process */

Selects or deselects the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fSelected | Flag that indicates whether to select or deselect an object. Possible values are:
 | Value | Meaning
 | TRUE | Select the specified object and all objects that it contains.
 | FALSE | Deselect the object and all objects that it contains.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Most L_AnnSet... functions let you change properties of selected objects in a container. Therefore, if you set individual objects' selected properties to TRUE, you can then use the other L_AnnSet... functions on the container to change the properties of only those objects in the container that have been selected.

This function applies to multiple and selected objects based on values of the uFlags parameter. The possible flags are the same as for other L_AnnSet... functions.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSelectRect, L_AnnGetSelectRect, L_AnnGetSelectCount, L_AnnSelectPoint, L_AnnHitTest, L_AnnGetType, L_AnnGetSelected, L_AnnGetSelectItems, L_AnnGetROP2, L_AnnSetROP2, L_AnnSetTransparent, L_AnnGetTransparent, L_AnnShowLockedIcon, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

/* This example selects the specified object, if the object is not already selected. */
void TestAnnSelected(HANNOBJECT hAnnObject)
{
L_BOOL IsSelected; /* TRUE if the object is selected */
/* See if the object is selected */
L_AnnGetSelected(hAnnObject, &IsSelected);
/* If it is not already selected, select it */
if (IsSelected)
MessageBox (NULL, TEXT("Already selected"), TEXT("Notice"), MB_OK);
else
L_AnnSetSelected (hAnnObject, TRUE, 0);
return;
}


L_AnnSetShowFlags

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetShowFlags(hObject, uShowFlags, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uShowFlags; | /* flag that indicates how to display the rulers */
L_UINT uFlags; | /* flags that determine which objects to process */

Determines how the rulers will be displayed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uShowFlags | Flag that indicates how to display the rulers. Possible values are:
 | Value | Meaning
 | 0 | Do not display the ruler length or the ruler gauge or the tic marks. In this case, the ruler looks like a line.
 | ANNSHOW_LENGTH | Display the ruler length.
 | ANNSHOW_GAUGE | Display the ruler gauge.
 | ANNSHOW_TICMARKS | Display the tic marks.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_SHOWRULER menu item has been selected.

Returns

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

Comments

This function is valid for the following objects:

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_POLYRULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_RULER

In addition, the Automation object stores the show flag settings along with the other object default settings.

For Protractor objects, the default value for uShowFlags is 0. For the Ruler, PolyRuler, and Cross-Product objects the default value for uShowFlags is ANNSHOW_LENGTH | ANNSHOW_TICMARKS.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetShowFlags
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

L_INT EXT_CALLBACK annEnumCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_UINT Type, ShowFlags;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_PROTRACTOR:
case ANNOBJECT_RULER:
case ANNOBJECT_CROSSPRODUCT:
case ANNOBJECT_AUTOMATION:
L_AnnGetShowFlags(hObject, &ShowFlags);
if (ShowFlags != 0)
ShowFlags = 0;
else
ShowFlags = ANNSHOW_LENGTH|ANNSHOW_GAUGE;
L_AnnSetShowFlags(hObject, ShowFlags, 0);
break;
default:
MessageBox(NULL, TEXT("This object is not a protractor, ruler, cross-product or automation object."), TEXT("Notice"), MB_OK);
}
return SUCCESS;
}

void TestFunction1(void)
{
L_AnnEnumerate(hContainer, annEnumCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL);
}


L_AnnSetTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTag(hObject, uTag, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT32 uTag; | /* unsigned 32-bit integer to use as the object's tag */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the tag of one or more annotation objects. You can use this tag to identify objects when they are saved in a file. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uTag | The unsigned 32-bit integer to use as the object's tag.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTag
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to the TestCreateButtonAnn procedure in Using Non automated Annotations in Run Mode.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetText(hObject, pText, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pText; | /* character string to assign */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the text (character string) of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pText | The character string to assign to the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter.

This function 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 function can be used to load unformatted text into an ANNOBJECT_RTF object. To load rich text into an ANNOBJECT_RTF object, see the documentation for L_AnnSetTextRTF.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetText, L_AnnGetTextLen, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Text Properties

Example

void TestAnnSetText(HANNOBJECT hAnnObject)
{
L_TCHAR L_FAR * pText; /* The object’s text */
HGLOBAL hText; /* Handle for memory management */
L_UINT TextLength; /* Length of the object’s text */
/* Get the length of the current text */
L_AnnGetTextLen(hAnnObject, &TextLength);
/* Add six characters to the length for our new text */
TextLength = TextLength + 6;
/* Allocate and lock a zero-filled buffer for the text */
hText = GlobalAlloc(GPTR, TextLength * sizeof (L_TCHAR));
pText = (L_TCHAR L_FAR *)GlobalLock( hText );
/* Get the current text */
L_AnnGetText(hAnnObject, pText);
/* Add " - New" to the end of the current text */
lstrcat(pText, TEXT(" - New"));
L_AnnSetText (hAnnObject, pText, 0);
/* Free memory that we no longer need */
GlobalFree(hText);
return;
}


L_AnnSetTextAlign

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTextAlign(hObject, uTextAlign, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uTextAlign; | /* flag that specifies the object's text alignment */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the text alignment of an annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uTextAlign | Value that indicates the object's text alignment . Possible values are:
 | Value | Meaning
 | TEXTALIGN_LEFT | [1] Align text to left.
 | TEXTALIGN_CENTER | [2] Center the text.
 | TEXTALIGN_RIGHT | [3] Align text to the right.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function sets the text alignment of certain annotation objects that display text. The function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than those listed above will return ERROR_FEATURE_NOT_SUPPORTED.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTextAlign
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Text Properties

Example

For an example, refer to L_AnnGetTextAlign.


L_AnnSetTextExpandTokens

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTextExpandTokens(hObject, bTextExpandTokens, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bTextExpandTokens; | /* value that specifies whether text tokens will be expanded */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the text tokens will be expanded for the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bTextExpandTokens | Value that specifies whether the text tokens will be expanded for this object. Possible values are:
 | Value | Meaning
 | TRUE | Text tokens will be expanded for this object.
 | FALSE | Text tokens will not be expanded for this object.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

The function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_BUTTON

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_STAMP

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than those listed above will return ERROR_FEATURE_NOT_SUPPORTED.

If bTextExpandTokens is set to TRUE, then all tokens will be expanded.

For Example, if you have an ANNOBJECT_BUTTON object that will expand text tokens, and #D is defined to be the current day of the week (ANNTOKEN_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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnClearTextTokenTable, L_AnnDeleteTextTokenTable, L_AnnEnumerateTextTokenTable, L_AnnGetTextExpandTokens, L_AnnInsertTextTokenTable
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | The Annotation Text Token Table
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Text Properties

Example

For an example, refer to L_AnnGetTextExpandTokens.


L_AnnSetTextOptions

#include "l_bitmap.h"

EXT_FUNCTION L_AnnSetTextOptions (hObject, pTextOptions, uFlags);

HANNOBJECT hObject; | /* handle to the annotation object */
pANNTEXTOPTIONS pTextOptions; | /* pointer to a structure that specifies the text options */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the text options for the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pTextOptions | Pointer to an ANNTEXTOPTIONS structure that specifies the text options to set.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function to set the text options of any annotation object that uses text. To use this function, declare a variable of type ANNTEXTOPTIONS, and pass the address of this variable for pTextOptions. For more information, refer to the documentation for the structure ANNTEXTOPTIONS.

The hObject parameter must be one of the following types:

ANNOBJECT_CONTAINER

ANNOBJECT_AUTOMATION

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

ANNOBJECT_STAMP

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_BUTTON

Otherwise ERROR_FEATURE_NOT_SUPPORTED is returned.

Note: In Version 14.5, you need first to enable this function by calling L_AnnSetOptions with the OPTIONS_NEW_TEXT_OPTIONS flag.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTextOptions, L_AnnSetText, L_AnnGetText, L_AnnGetTextLen, L_AnnSetTextAlign, L_AnnGetTextAlign, L_AnnSetTextRotate, L_AnnGetTextRotate, L_AnnSetOptions, L_AnnGetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only): Getting and Setting Text Properties
 | Altering Annotation Object Settings
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Obtaining Annotation Object Information
 | Container Annotation Object
 | Annotation Automation Object
 | Text Annotation Object
 | Text Pointer Annotation Object
 | Stamp Annotation Object
 | Note Annotation Object
 | PushPin Annotation Object
 | Button Annotation Object

Example

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

L_VOID ExampleAnnSetTextOptions(HANNOBJECT hObject)
{
L_INT nRet = SUCCESS;
ANNTEXTOPTIONS TextOptions;
L_UINT uOptions = 0;
char szMsg[200];

L_AnnGetOptions(&uOptions);
uOptions |= OPTIONS_NEW_TEXT_OPTIONS;
nRet = L_AnnSetOptions(NULL, uOptions);
if (nRet != SUCCESS)
return;

memset(&TextOptions, 0, sizeof(ANNTEXTOPTIONS));
TextOptions.uStructSize = sizeof(ANNTEXTOPTIONS);
TextOptions.uFlags = ANNTEXT_SHOW_TEXT | ANNTEXT_SHOW_BORDER | ANNTEXT_TEXTCOLOR;
nRet = L_AnnGetTextOptions(hObject, &TextOptions, sizeof(ANNTEXTOPTIONS));
if (nRet != SUCCESS)
return;

wsprintf(szMsg, "Old Options: ShowText[%d], ShowBorder[%d], TextColor[0x%x]",
TextOptions.bShowText,
TextOptions.bShowBorder,
TextOptions.crText);

MessageBox(NULL, szMsg, "", MB_OK);

// Change some options
TextOptions.bShowBorder = !TextOptions.bShowBorder;
TextOptions.crText = RGB(0,0,255);
TextOptions.uFlags = ANNTEXT_SHOW_BORDER | ANNTEXT_TEXTCOLOR;
nRet = L_AnnSetTextOptions(hObject, &TextOptions, 0);
if (nRet != SUCCESS)
return;

memset(&TextOptions, 0, sizeof(ANNTEXTOPTIONS));
TextOptions.uStructSize = sizeof(ANNTEXTOPTIONS);
TextOptions.uFlags = ANNTEXT_SHOW_TEXT | ANNTEXT_SHOW_BORDER | ANNTEXT_TEXTCOLOR;
nRet = L_AnnGetTextOptions(hObject, &TextOptions, sizeof(ANNTEXTOPTIONS));
if (nRet != SUCCESS)
return;

wsprintf(szMsg, "New Options: ShowText[%d], ShowBorder[%d], TextColor[0x%x]",
TextOptions.bShowText,
TextOptions.bShowBorder,
TextOptions.crText);

MessageBox(NULL, szMsg, "", MB_OK);

}


L_AnnSetTextPointerFixed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTextPointerFixed(hObject, bPointerFixed, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object to insert */
L_BOOL bPointerFixed; | /* value that specifies whether the pointer of an ANNOBJECT_TEXTPOINTER is fixed */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the pointer of an ANNOBJECT_TEXTPOINTER object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bPointerFixed | Value that specifies whether the pointer of an ANNOBJECT_TEXTPOINTER is fixed. Possible values are:
 | Value | Meaning
 | TRUE | Fixes the pointer of an ANNOBJECT_TEXTPOINTER object.
 | FALSE | Makes the pointer of an ANNOBJECT_TEXTPOINTER move with the object.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

The function is valid only for the ANNOBJECT_TEXTPOINTER annotation object.

Passing TRUE for bPointerFixed fixes the pointer of the text pointer object. 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)

Passing FALSE for bPointerFixed frees the pointer of the text pointer object. This means that when the object is moved, the location the text pointer points to moves along with the object.

Calling this function on an object other the ANNOBJECT_TEXTPOINTER will return ERROR_FEATURE_NOT_SUPPORTED.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetFixed, L_AnnIsFixedInRect, L_AnnPopFixedState, L_AnnSetFixed, L_AnnSetTicMarkLength
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Text Properties

Example

For an example refer to L_AnnGetTextPointerFixed.


L_AnnSetTextRotate

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTextRotate(hObject, uTextRotate, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UINT uTextRotate; | /* flag that indicates whether the text is rotated */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the text of an annotation object is rotated. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uTextRotate | 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
 | TEXTROTATE_0 | [0] Do not rotate the text.
 | TEXTROTATE_90 | [90] Rotate the text 90 degrees counter clockwise.
 | TEXTROTATE_180 | [180] Rotate the text 180 degrees counter clockwise.
 | TEXTROTATE_270 | [270] Rotate the text 270 degrees counter clockwise.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function sets a value that indicates whether the text of certain annotation objects that display text will be rotated. The function is valid only for the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

ANNOBJECT_TEXTPOINTER

Calling this function on an object other than those listed above will return ERROR_FEATURE_NOT_SUPPORTED. Note that the ANNOBJECT_TEXT object does not support text rotation because it can be rotated ANY angle by calling L_AnnRotate.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTextRotate
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Text Properties

Example

For an example refer to L_AnnGetTextRotate.


L_AnnSetTextRTF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTextRTF(hObject, uFormat, pText, uFlags)

HANNOBJECT hObject; | /* handle to the ANNOBJECT_RTF object */
L_UINT uFormat; | /* text format type */
L_TCHAR pText; | /* pointer to the text
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the text (unformatted text or rich text) of one or more ANNOBJECT_RTF annotation objects. It can also set the rich text of an ANNOBJECT_AUTOMATION object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the ANNOBJECT_RTF object.
uFormat | Value that specifies the text format type. Possible values are:
 | Value | Meaning
 | RTFFORMAT_TEXT | [0x0001] Interpret the text as unformatted text.
 | RTFFORMAT_RTF | [0x0002] Interpret the text as rich text.
pText | Character string that contains the text to assign to the annotation object. This can be unformatted text, or rich text. This is a NULL terminated string.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

This function applies to multiple and selected objects based on values of the uFlags parameter. Only ANNOBJECT_RTF and ANNOBJECT_AUTOMATION objects are affected.

This function 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.

To get or set the text of other text objects, see the documentation for L_AnnGetTextLen, L_AnnGetText, and L_AnnSetText.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetText, L_AnnSetText, L_AnnGetTextLen, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText, L_AnnGetTextRTF
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an Example, see below, or refer to L_AnnSetText.

// This sample loads a rich text annotation object with text
// It illustrates how L_AnnSetTextRTF() 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
// RTFFORMAT_TEXT
// RTFFORMAT_RTF
#define RICH_STRING TEXT("{\\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}")

L_VOID SampleAnnSetTextRTF(HANNOBJECT hObject, L_UINT uFormat)
{
L_TCHAR *pszFormat;
L_TCHAR szMsg[200];
L_INT nRet;

switch(uFormat)
{
case RTFFORMAT_TEXT:
pszFormat = TEXT("RTFFORMAT_TEXT");
nRet = L_AnnSetTextRTF(hObject, uFormat, RICH_STRING, 0);
break;

case RTFFORMAT_RTF:
pszFormat = TEXT("RTFFORMAT_RTF");
nRet = L_AnnSetTextRTF(hObject, uFormat, RICH_STRING, 0);
break;

default:
return;
break;
}

wsprintf(szMsg, TEXT("L_AnnSetTextRTF returned %d\nFormat: %s"), nRet, pszFormat);
MessageBox(NULL, szMsg, TEXT (""), MB_OK);
}


L_AnnSetTicMarkLength

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTicMarkLength(hObject, dLength, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_DOUBLE dLength; | /* new length of the ruler tic marks */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the length of the tic mark of an ANNOBJECT_RULER or ANNOBJECT_POLYRULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
dLength | The new length of the ruler object's tic mark.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TEXT menu item has been selected.

Returns

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

Comments

The tic mark length applies only to the following annotation objects:

ANNOBJECT_AUTOMATION

ANNOBJECT_RULER

ANNOBJECT_POLYRULER

The dLength 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 shown in the figure below has tic marks with several different lengths. In this case, *pdLength represents the length of the longest tic mark.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnSetUnit, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnGetGaugeLength, L_AnnGetTicMarkLength
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This Example doubles the length of the tic mark of the hObject
L_VOID SampleAnnTicMarkLength(HANNOBJECT hObject)
{
L_INT nRet;
L_DOUBLE dLength;
L_TCHAR szMsg[200];

nRet = L_AnnGetTicMarkLength(hObject, &dLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Old Tic Mark Length: %f\nNew Tic Mark Length %f"),
dLength,
2 * dLength);

L_AnnSetTicMarkLength(hObject, 2 * dLength, 0);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}
}


L_AnnSetTool

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTool(hObject, uTool)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_UINT uTool; | /* constant that specifies the selected tool */

Sets the default tool, which is maintained by the automation object. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation automation object.

uTool

The constant that specifies the selected tool. Possible values are:

Value

Meaning

ANNTOOL_SELECT

[0] Selection pointer

ANNTOOL_LINE

[1] Line

ANNTOOL_RECT

[2] Rectangle

ANNTOOL_ELLIPSE

[3] Ellipse

ANNTOOL_POLYLINE

[4] Polyline

ANNTOOL_POLYGON

[5] Polygon

ANNTOOL_POINTER

[6] Pointer

ANNTOOL_FREEHAND

[7] Freehand line

ANNTOOL_HILITE

[8] Highlight

ANNTOOL_REDACT

[9] Redaction

ANNTOOL_TEXT

[10] Text

ANNTOOL_NOTE

[11] Note

ANNTOOL_STAMP

[12] Stamp

ANNTOOL_BUTTON

[13] Button

ANNTOOL_HOTSPOT

[14] Hot spot

ANNTOOL_AUDIO

[15] Audio clip

ANNTOOL_RULER

[16] Ruler clip

ANNTOOL_CROSSPRODUCT

[17] Cross product

ANNTOOL_POINT

[18] Point

ANNTOOL_PROTRACTOR

[19] Protractor

ANNTOOL_VIDEO

[20] Video

ANNTOOL_PUSHPIN

[21] Pushpin

ANNTOOL_FREEHANDHOTSPOT

[22] Freehand Hot Spot

ANNTOOL_STAMP_FIRST

[23] First rubber stamp

ANNTOOL_STAMP_APPROVED

[23] Approved rubber stamp

ANNTOOL_STAMP_ASSIGNED

[24] Assigned rubber stamp

ANNTOOL_STAMP_CHECKED

[25] Checked rubber stamp

ANNTOOL_STAMP_CLATPRV

[26] Client Attorney Privilege rubber stamp

ANNTOOL_STAMP_COPY

[27] Copy rubber stamp

ANNTOOL_STAMP_DRAFT

[28] Draft rubber stamp

ANNTOOL_STAMP_EXTENDED

[29] Extended rubber stamp

ANNTOOL_STAMP_FAX

[30] Fax rubber stamp

ANNTOOL_STAMP_FAXED

[31] Faxed rubber stamp

ANNTOOL_STAMP_IMPORTANT

[32] Important rubber stamp

ANNTOOL_STAMP_INVOICE

[33] Invoice rubber stamp

ANNTOOL_STAMP_NOTICE

[34] Notice rubber stamp

ANNTOOL_STAMP_OFFICIAL

[35] Official rubber stamp

ANNTOOL_STAMP_ONFILE

[36] Onfile rubber stamp

ANNTOOL_STAMP_PAID

[37] Paid rubber stamp

ANNTOOL_STAMP_PASSED

[38] Passed rubber stamp

ANNTOOL_STAMP_PENDING

[39] Pending rubber stamp

ANNTOOL_STAMP_PROCESSED

[40] Processed rubber stamp

ANNTOOL_STAMP_RECEIVED

[41] Received rubber stamp

ANNTOOL_STAMP_REJECTED

[42] Rejected rubber stamp

ANNTOOL_STAMP_RELEASE

[43] Release rubber stamp

ANNTOOL_STAMP_SENT

[44] Sent rubber stamp

ANNTOOL_STAMP_SHIPPED

[45] Shipped rubber stamp

ANNTOOL_STAMP_TOPSECRET

[46] Top Secret rubber stamp

ANNTOOL_STAMP_URGENT

[47] Urgent rubber stamp

ANNTOOL_STAMP_VOID

[48] Void rubber stamp

ANNTOOL_STAMP_LAST

[48] the last rubber stamp

ANNTOOL_LAST

[48] the last tool button

ANNTOOL_USER

[0x0100] the first user defined tool

ANNTOOL_USERLAST

[0x0200] the last allowed user defined tool

Returns

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

Comments

You can use the automation tool property 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.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetToolBarButtons

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetToolBarButtons(hwndToolBar, pTools, uTools)

HWND hwndToolBar; | /* window handle for the toolbar */
pANNBUTTON pTools; | /* ANNBUTTON structure that contains button information to be set */
L_UINT uTools; | /* number of buttons in the toolbar */

Sets the number and appearance of the toolbar buttons. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar.
pTools | Array of ANNBUTTON structures that contains information about the toolbar buttons to set.
uTools | Number of buttons in the toolbar.

Returns

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

Comments

Calling this function replaces the old buttons present in the toolbar.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible, L_AnnFreeToolBarButtons, L_AnnGetToolBarButtons, L_AnnGetToolBarInfo, L_AnnSetToolBarColumns, L_AnnSetToolBarRows, L_AnnSetOptions, L_AnnGetOptions
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings
 | New Annotation Features of Version 14.5

Example

For an example, refer to L_AnnFreeToolBarButtons.


L_AnnSetToolBarButtonVisible

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetToolBarButtonVisible(hwndToolBar, uButton, fVisible)

HWND hwndToolBar; | /* window handle for the toolbar */
L_UINT uButton; | /* constant that specifies the tool */
L_BOOL fVisible; | /* flag that indicates whether to make a tool visible */

Shows or hides the specified tool on the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
uButton | The constant that specifies the tool. Possible values are:
 | Value | Meaning
 | ANNTOOL_SELECT | [0] Selection tool
 | ANNTOOL_LINE | [1] Line
 | ANNTOOL_RECT | [2] Rectangle
 | ANNTOOL_ELLIPSE | [3] Ellipse
 | ANNTOOL_POLYLINE | [4] Polyline
 | ANNTOOL_POLYGON | [5] Polygon
 | ANNTOOL_POINTER | [6] Pointer
 | ANNTOOL_FREEHAND | [7] Freehand line
 | ANNTOOL_HILITE | [8] Highlight
 | ANNTOOL_REDACT | [9] Redaction
 | ANNTOOL_TEXT | [10] Text
 | ANNTOOL_NOTE | [11] Note
 | ANNTOOL_STAMP | [12] Stamp
 | ANNTOOL_BUTTON | [13] Button
 | ANNTOOL_HOTSPOT | [14] Hot spot
 | ANNTOOL_AUDIO | [15] Audio clip
 | ANNTOOL_RULER | [16] Ruler clip
 | ANNTOOL_CROSSPRODUCT | [17] Cross product
 | ANNTOOL_POINT | [18] Point
 | ANNTOOL_PROTRACTOR | [19] Protractor
 | ANNTOOL_VIDEO | [20] Video
 | ANNTOOL_PUSHPIN | [21] Pushpin
 | ANNTOOL_FREEHANDHOTSPOT | [22] Freehand Hot Spot
 | ANNTOOL_STAMP_FIRST | [23] First rubber stamp
 | ANNTOOL_STAMP_APPROVED | [23] Approved rubber stamp
 | ANNTOOL_STAMP_ASSIGNED | [24] Assigned rubber stamp
 | ANNTOOL_STAMP_CHECKED | [25] Checked rubber stamp
 | ANNTOOL_STAMP_CLATPRV | [26] Client Attorney Privilege rubber stamp
 | ANNTOOL_STAMP_COPY | [27] Copy rubber stamp
 | ANNTOOL_STAMP_DRAFT | [28] Draft rubber stamp
 | ANNTOOL_STAMP_EXTENDED | [29] Extended rubber stamp
 | ANNTOOL_STAMP_FAX | [30] Fax rubber stamp
 | ANNTOOL_STAMP_FAXED | [31] Faxed rubber stamp
 | ANNTOOL_STAMP_IMPORTANT | [32] Important rubber stamp
 | ANNTOOL_STAMP_INVOICE | [33] Invoice rubber stamp
 | ANNTOOL_STAMP_NOTICE | [34] Notice rubber stamp
 | ANNTOOL_STAMP_OFFICIAL | [35] Official rubber stamp
 | ANNTOOL_STAMP_ONFILE | [36] Onfile rubber stamp
 | ANNTOOL_STAMP_PAID | [37] Paid rubber stamp
 | ANNTOOL_STAMP_PASSED | [38] Passed rubber stamp
 | ANNTOOL_STAMP_PENDING | [39] Pending rubber stamp
 | ANNTOOL_STAMP_PROCESSED | [40] Processed rubber stamp
 | ANNTOOL_STAMP_RECEIVED | [41] Received rubber stamp
 | ANNTOOL_STAMP_REJECTED | [42] Rejected rubber stamp
 | ANNTOOL_STAMP_RELEASE | [43] Release rubber stamp
 | ANNTOOL_STAMP_SENT | [44] Sent rubber stamp
 | ANNTOOL_STAMP_SHIPPED | [45] Shipped rubber stamp
 | ANNTOOL_STAMP_TOPSECRET | [46] Top Secret rubber stamp
 | ANNTOOL_STAMP_URGENT | [47] Urgent rubber stamp
 | ANNTOOL_STAMP_VOID | [48] Void rubber stamp
 | ANNTOOL_STAMP_LAST | [48] the last rubber stamp
 | ANNTOOL_LAST | [48] the last tool button
 | ANNTOOL_USER | [0x0100] the first user defined tool
 | ANNTOOL_USERLAST | [0x0200] the last allowed user defined tool
fVisible | Flag that indicates whether to make the specified tool visible on the toolbar. Possible values are:
 | Value | Meaning
 | TRUE | Make the tool visible on the toolbar.
 | FALSE | Make the tool invisible.

Returns

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

Comments

When a tool is invisible, other tools in the toolbar are arranged so that no gaps are left, and so that their order is maintained (left-to-right and top-to-bottom, just as text would wrap).

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

/* This example hides the button, hot spot, and audio clip tools. */
void TestAnnSetButtonVisible(HWND hwndToolBar)
{
L_AnnSetToolBarButtonVisible(hwndToolBar, ANNTOOL_BUTTON, FALSE);
L_AnnSetToolBarButtonVisible(hwndToolBar, ANNTOOL_HOTSPOT, FALSE);
L_AnnSetToolBarButtonVisible(hwndToolBar, ANNTOOL_AUDIO, FALSE);
}


L_AnnSetToolBarChecked

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetToolBarChecked(hwndToolBar, uChecked)

HWND hwndToolBar; | /* window handle for the toolbar */
L_UINT uChecked; | /* constant that specifies the selected tool */

Selects a tool in the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter

Description

hwndToolBar

Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.

uChecked

The constant that specifies the selected tool. Possible values are:

Value

Meaning

ANNTOOL_SELECT

[0] Selection tool

ANNTOOL_LINE

[1] Line

ANNTOOL_RECT

[2] Rectangle

ANNTOOL_ELLIPSE

[3] Ellipse

ANNTOOL_POLYLINE

[4] Polyline

ANNTOOL_POLYGON

[5] Polygon

ANNTOOL_POINTER

[6] Pointer

ANNTOOL_FREEHAND

[7] Freehand line

ANNTOOL_HILITE

[8] Highlight

ANNTOOL_REDACT

[9] Redaction

ANNTOOL_TEXT

[10] Text

ANNTOOL_NOTE

[11] Note

ANNTOOL_STAMP

[12] Stamp

ANNTOOL_BUTTON

[13] Button

ANNTOOL_HOTSPOT

[14] Hot spot

ANNTOOL_AUDIO

[15] Audio clip

ANNTOOL_RULER

[16] Ruler clip

ANNTOOL_CROSSPRODUCT

[17] Cross product

ANNTOOL_POINT

[18] Point

ANNTOOL_PROTRACTOR

[19] Protractor

ANNTOOL_VIDEO

[20] Video

ANNTOOL_PUSHPIN

[21] Pushpin

ANNTOOL_FREEHANDHOTSPOT

[22] Freehand Hot Spot

ANNTOOL_STAMP_FIRST

[23] First rubber stamp

ANNTOOL_STAMP_APPROVED

[23] Approved rubber stamp

ANNTOOL_STAMP_ASSIGNED

[24] Assigned rubber stamp

ANNTOOL_STAMP_CHECKED

[25] Checked rubber stamp

ANNTOOL_STAMP_CLATPRV

[26] Client Attorney Privilege rubber stamp

ANNTOOL_STAMP_COPY

[27] Copy rubber stamp

ANNTOOL_STAMP_DRAFT

[28] Draft rubber stamp

ANNTOOL_STAMP_EXTENDED

[29] Extended rubber stamp

ANNTOOL_STAMP_FAX

[30] Fax rubber stamp

ANNTOOL_STAMP_FAXED

[31] Faxed rubber stamp

ANNTOOL_STAMP_IMPORTANT

[32] Important rubber stamp

ANNTOOL_STAMP_INVOICE

[33] Invoice rubber stamp

ANNTOOL_STAMP_NOTICE

[34] Notice rubber stamp

ANNTOOL_STAMP_OFFICIAL

[35] Official rubber stamp

ANNTOOL_STAMP_ONFILE

[36] Onfile rubber stamp

ANNTOOL_STAMP_PAID

[37] Paid rubber stamp

ANNTOOL_STAMP_PASSED

[38] Passed rubber stamp

ANNTOOL_STAMP_PENDING

[39] Pending rubber stamp

ANNTOOL_STAMP_PROCESSED

[40] Processed rubber stamp

ANNTOOL_STAMP_RECEIVED

[41] Received rubber stamp

ANNTOOL_STAMP_REJECTED

[42] Rejected rubber stamp

ANNTOOL_STAMP_RELEASE

[43] Release rubber stamp

ANNTOOL_STAMP_SENT

[44] Sent rubber stamp

ANNTOOL_STAMP_SHIPPED

[45] Shipped rubber stamp

ANNTOOL_STAMP_TOPSECRET

[46] Top Secret rubber stamp

ANNTOOL_STAMP_URGENT

[47] Urgent rubber stamp

ANNTOOL_STAMP_VOID

[48] Void rubber stamp

ANNTOOL_STAMP_LAST

[48] the last rubber stamp

ANNTOOL_LAST

[48] the last tool button

ANNTOOL_USER

[0x0100] the first user defined tool

ANNTOOL_USERLAST

[0x0200] the last allowed user defined tool

Returns

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

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetToolBarColumns

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetToolBarColumns(hwndToolBar, uColumns)

HWND hwndToolBar; | /* window handle for the toolbar */
L_UINT uColumns; | /* number of columns to set */

Sets the number of columns in the toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
uColumns | Number of columns to set in the toolbar.

Returns

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

Comments

If uColumns is greater than the number of buttons in the toolbar, the number of columns in the displayed toolbar will be equal to the number of buttons.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible, L_AnnFreeToolBarButtons, L_AnnSetToolBarButtons, L_AnnFreeToolBarButtons, L_AnnGetToolBarInfo, L_AnnSetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnFreeToolBarButtons.


L_AnnSetToolBarRows

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetToolBarRows(hwndToolBar, uRows)

HWND hwndToolBar; | /* window handle for the toolbar */
L_UINT uRows; | /* number of rows to set */

Sets the number of rows in the toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
hwndToolBar | Window handle for the toolbar. You get the window handle when you create the toolbar using the L_AnnCreateToolBar function.
uRows | Number of rows to set in the toolbar.

Returns

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

Comments

If uRows is greater than the number of buttons in the toolbar, the number of rows in the displayed toolbar will be equal to the number of buttons.

Buttons are arranged on the rows from left to right.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreateToolBar, L_AnnGetToolBarChecked, L_AnnSetToolBarChecked, L_AnnGetToolBarButtonVisible, L_AnnSetToolBarButtonVisible, L_AnnFreeToolBarButtons, L_AnnSetToolBarButtons, L_AnnFreeToolBarButtons, L_AnnGetToolBarInfo, L_AnnSetToolBarColumns
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnFreeToolBarButtons.


L_AnnSetTransparent

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTransparent(hObject, bTransparent, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bTransparent; | /* flag that indicates whether to make the bitmap transparent */
L_UINT uFlags; | /* flags to determine which objects to process */

Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bTransparent | Flag that indicates whether to make the bitmap transparent. Possible values are:
 | Value | Meaning
 | TRUE | Make the bitmap transparent
 | FALSE | Do not make the bitmap transparent. This is the default.

uFlags

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.

ANNFLAG_SELECTED

[0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.

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

ANNFLAG_RECURSE

[0x0008] Process objects within a container, and within any subcontainers, down to any level.

ANNFLAG_NOTCONTAINER

[0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.

ANNFLAG_NOINVALIDATE

[0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

ANNFLAG_CHECKMENU

[0x0020] Process objects only if the ANNAUTOTEXT_MENU_TRANSPARENT menu item has been selected.

Returns

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

Comments

Sets one or more bitmap objects to use a transparent color. A transparent color is not painted when the image is painted. The L_AnnSetTransparent function is valid only for the following object types when they are using a bitmap:

ANNOBJECT_POINT

ANNOBJECT_STAMP

In addition, the Automation object stores transparency settings along with the other object default settings.

Call the L_AnnSetTransparent function to set such objects to use a transparent color. By default the transparent color is white (0x00FFFFFF). In order for the transparent bitmaps to be painted properly the LTEFX14n.dll needs to be present for WIN32. If the appropriate DLL is not present, the transparent bitmap stamps will be painted as non-transparent bitmap stamps.

When this function is applied to an automation object, it indicates whether the next stamp 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 L_AnnSetTransparentColor function to set the color to be used as the transparent color. Call the L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the L_AnnGetTransparentColor function to get a value that indicates which color is being used as the transparent color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTransparent, L_AnnGetSelected, L_AnnSetSelected, L_AnnGetROP2, L_AnnSetROP2, L_AnnGetFillModeExt, L_AnnSetFillModeExt, L_AnnGetOptions, L_AnnSetOptions
Topics | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

Example

void TestAnnTransparent(HANNOBJECT hAnnObject)
{
L_BOOL bTransparent;

L_AnnGetTransparent(hAnnObject, &bTransparent);
/* toggle the transparency setting for STAMP objects */
if(bTransparent)
/* no transparency */
L_AnnSetTransparent(hAnnObject, FALSE, ANNFLAG_RECURSE);
else
/* white will be transparent */
L_AnnSetTransparent(hAnnObject, TRUE, ANNFLAG_RECURSE);
return;
}


L_AnnSetTransparentColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetTransparentColor(hObject, crTransparent, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
COLORREF crTransparent; | /* transparent color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the color to be used as a transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
crTransparent | The fill 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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter.
 | In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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 functions will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS function, refer to L_GetPixelColor.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_TRANSPARENTCOLOR menu item has been selected.

Returns

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

Comments

The L_AnnSetTransparentColor function is valid only for the following object types when they are using a bitmap:

ANNOBJECT_POINT

ANNOBJECT_STAMP

In addition, the Automation object stores transparency settings along with the other object default settings.

A transparent color is not painted when the image is painted. This transparent color is used only if the object is set to transparent using L_AnnSetTransparent.

By default, the transparent color is white (0x00FFFFFF).

If hObject is a container object, then uFlags 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 appear so that a color can be selected 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 L_AnnGetTransparent function to get a value that indicates whether the bitmap being used by the annotation object is using a transparent color. Call the L_AnnGetTransparentColor function to get a value that indicates which color is being used as the transparent color.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetTransparentColor, L_AnnSetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Color Values in LEADTOOLS
 | Annotation Functions (Document/Medical only): Getting and Setting the Transparency Property

Example

L_INT EXT_CALLBACK annEnumCallback(HANNOBJECT hObject, L_INT L_FAR *pUserData)
{
L_UINT Type;
COLORREF TransColor;
L_INT nRet;

L_AnnGetType(hObject, &Type);
switch(Type)
{
case ANNOBJECT_STAMP:
nRet = L_AnnGetTransparentColor(hObject, &TransColor);
if (nRet == SUCCESS)
{
if (TransColor != RGB(0, 0, 0))
{
MessageBox(NULL, TEXT("Transparent color set."), TEXT(""), MB_OK);
L_AnnSetTransparent(hObject, TRUE, 0);
TransColor = RGB(0, 0, 0);
L_AnnSetTransparentColor(hObject, TransColor, 0);
}
}
else
MessageBox(NULL, TEXT("Error getting transparent color."), TEXT(""), MB_OK);
break;
default:
MessageBox(NULL, TEXT("Object must be a stamp."), TEXT(""), MB_OK);
}
return SUCCESS;
}

HANNOBJECT hContainer;
void TestFunction1(void)
{
L_AnnEnumerate(hContainer, annEnumCallback, NULL, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL);
}


L_AnnSetUndoDepth

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetUndoDepth(hObject, uLevels)

HANNOBJECT hObject; | /* handle to the automation object */
L_UINT uLevels; | /* number of levels */

Specifies the number of user actions that can be reversed using the L_AnnUndo function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.
uLevels | The number of levels that can be undone.

Returns

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

Comments

This function is used only with the automated annotation functions, and there is only one undo depth value per root container. (Subcontainers do not have their own separate values.)

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnUndo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetUnit

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetUnit(hObject, uUnit, pUnitAbbrev, uPrecision, uFlags)

HANNOBJECT hObject; | /* handle to the annotation automation object */
L_UINT uUnit; | /* unit of measure */
L_TCHAR L_FAR *pUnitAbbrev; | /* Address of the character string containing the unit abbreviation string */
L_UINT uPrecision; | /* number of digits */
L_UINT uFlags; | /* flags that determine which objects to process*/

Sets the unit of measurement for the rulers used by those objects that use rulers. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation automation object.
uUnit | The unit of measure of the ruler. Possible values are:
 | Value | Meaning
 | ANNUNIT_INCH | [0x0000] inches
 | ANNUNIT_FEET | [0x0001] feet
 | ANNUNIT_YARDS | [0x0002] yards
 | ANNUNIT_MICROMETERS | [0x0003] micrometers
 | ANNUNIT_MILIMETERS | [0x0004] millimeters
 | ANNUNIT_CENTIMETERS | [0x0005] centimeters
 | ANNUNIT_METERS | [0x0006] meters
 | ANNUNIT_TWIPS | [0x0007] twips
 | ANNUNIT_POINTS | [0x0008] points
 | ANNUNIT_PIXELS | [0x0009] pixels
 | ANNUNIT_SMART_METRIC | [0x0010] Smart Metric
 | ANNUNIT_SMART_ENGLISH | [0x0011] Smart English
pUnitAbbrev | Address of the character string containing the unit abbreviation string to be displayed after the distance. You can pass NULL to get the default abbreviations for the current unit of measurement.
uPrecision | Number of digits to be displayed after the decimal place. Valid values are 0 – 200.
uFlags | Flags that determine which objects to process.
 | 0 | Process only the specified object.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_RULER menu item has been selected.

Returns

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

Comments

The following annotation objects utilize one or more rulers as part of the annotation:

ANNOBJECT_RULER

ANNOBJECT_POLYRULER

ANNOBJECT_PROTRACTOR

ANNOBJECT_CROSSPRODUCT

In addition, the Automation object (ANNOBJECT_AUTOMATION) stores default unit 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 L_AnnSetUnit function 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 L_AnnGetUnit function to get the unit of measurement and its precision for the ruler. The L_AnnGetDistance2 function gets the length of each ruler that makes up an object, and the total length of all rulers.

This function applies to multiple and selected objects based on the value of the uFlags parameter.

Only Automation and Ruler objects are affected. Refer to Annotation Automation Object.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetBitmapDpiX, L_AnnGetBitmapDpiX, L_AnnGetBitmapDpiY, L_AnnSetBitmapDpiY, L_AnnGetUnit, L_AnnGetUnitLen, L_AnnGetDistance, L_AnnSetGaugeLength, L_AnnGetGaugeLength, L_AnnGetTicMarkLength, L_AnnSetTicMarkLength, L_AnnGetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

void TestAnnSetUnit(HANNOBJECT hAnnObject, HWND hWnd)
{
/* get the current measurement unit settings and display them */
/* if unit is not inches, make it so */

L_UINT uLen;
L_UINT uUnit;
HGLOBAL hUnitAbbrev;
L_TCHAR L_FAR* pUnitAbbrev=NULL;
L_UINT uPrecision;
L_TCHAR buf[180];
L_TCHAR dis[180];
L_TCHAR format[180];
L_DOUBLE dDistance;
L_DOUBLE dDistance2;

/* first, get unit abbreviation string len */
L_AnnGetUnitLen(hAnnObject, &uLen);

/* allocate enough memory for the abbreviation string */
hUnitAbbrev = GlobalAlloc(GMEM_MOVEABLE, uLen * sizeof (L_TCHAR));
pUnitAbbrev = (L_TCHAR L_FAR*)GlobalLock(hUnitAbbrev);

/* get the settings */
L_AnnGetUnit(hAnnObject, &uUnit, pUnitAbbrev, &uPrecision);

/* and, get the distance */
L_AnnGetDistance(hAnnObject, &dDistance, &dDistance2);

/* display current settings & distance in current unit of measurement */
wsprintf(buf, TEXT("Object: %ld\nUnit: %d\nAbbrev: %s\nPrecision: %d\n"),
hAnnObject, uUnit, pUnitAbbrev, uPrecision);
wsprintf(format, TEXT("Distance: %%.%df\n"),uPrecision);
wsprintf(dis, format, dDistance);
lstrcat(buf, dis);

MessageBox(NULL, buf, TEXT("Units"), MB_OK);

/* if unit is not inches, make it so */
if(uUnit != ANNUNIT_INCHES)
L_AnnSetUnit(hAnnObject, ANNUNIT_INCHES, TEXT("in"), 2, 0);

GlobalUnlock(hUnitAbbrev);
GlobalFree(hUnitAbbrev);

return;
}


L_AnnSetUser

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetUser(hObject, pOldUser, pNewUser, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pOldUser; | /* old user string */
L_TCHAR L_FAR * pNewUser; | /* new user string */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the user string for the specified object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pOldUser | Character string that contains the old user string.
pNewUser | Character string that contains the new user string.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

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 uFlags 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 uFlags to ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, only those objects having user "YourObject" will be changed. Objects with other users, or with NULL users will not be modified.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnUnlock, L_AnnShowLockedIcon,
Topics | Annotation Functions (Document/Medical ): Security
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnGroup.


L_AnnSetUserData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetUserData(hObject, pUserData, uUserDataSize, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_UCHAR pUserData; | /* address of binary data to write */
L_UINT uUserDataSize; | /* length of binary data in bytes */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets user-defined data of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
pUserData | Buffer that contains the binary data to write.
uUserDataSize | Length (in bytes) of the binary data to write.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

Use this function 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 (L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset), the user data is saved.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnSetAutoCursor, L_AnnGetAutoCursor, L_AnnGetUserData, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor
Topics: | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnGetUserData.


L_AnnSetUserMode

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetUserMode(hObject, uMode)

HANNOBJECT hObject; | /* handle to the root container */
L_UINT uMode; | /* constant that specifies the user mode */

Sets the user mode for all objects. Design mode is for creating objects; run mode is for viewing them. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the root container.
uMode | The constant that specifies the user mode. Possible values are:
 | Value | Meaning
 | ANNUSER_DESIGN | [0] Design mode. Used for creating objects.
 | ANNUSER_RUN | [1] Run mode. Used for viewing or activating objects.

Returns

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

Comments

You set this property on the root container, and all objects in the container inherit the property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetUserMode
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to Implementing an Automated Annotation Program.

For complete sample code, refer to the ANNOTATE example.


L_AnnSetVisible

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetVisible(hObject, fVisible, uFlags, pUserList)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL fVisible; | /* flag that indicates whether to make the object or objects visible */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR *pUserList; | /* character string that contains the user list */

Sets one or more annotation objects to be visible or invisible. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
fVisible | Flag that indicates whether to make the object or objects visible or invisible. Possible values are:
 | Value | Meaning
 | TRUE | Make the object or objects visible.
 | FALSE | Make the object or objects invisible.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_USER | [] Process only those objects that have a user included in pUserList. If pUserList is NULL, process only those objects that do not have an associated user.
pUserList | Character string that contains the list of users associated with the specified object. pUserList 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 ANNFLAG_USER is set in uFlags.

Returns

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

Comments

When an object is not visible, it cannot be displayed and functions such as L_AnnHitTest will not detect its presence at a specified position. Some objects (notably containers) may be transparent, but if their visible-object property is TRUE, a user can select them with a mouse.

This function applies to multiple and selected objects based on values of the uFlags parameter.

To make objects belonging to a user visible, you must set ANNFLAG_USER in uFlags, pass the user name in pUserList, and set fVisible to TRUE.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetVisible
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For an example, refer to L_AnnCreate.


L_AnnSetWnd

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnSetWnd(hObject, hWnd)

HANNOBJECT hObject; | /* handle to the root container */
HWND hWnd; | /* window handle to assign to the object */

Sets the window handle for all objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the root container.
hWnd | The window handle to assign to the object.

Returns

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

Comments

You set this property on the root container, and all objects in the container inherit the property.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetWnd
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Altering Annotation Object Settings

Example

For complete sample code, refer to the ANNOTATE example.

/* This example updates the container object’s window handle if necessary. */
HANNOBJECT hContainer;
void TestAnnWnd(HWND hWnd)
{
HWND ObjectWnd; /* Container object's window */
/* Set the container's window to the current window, unless it is already current */
L_AnnGetWnd(hContainer, &ObjectWnd);
if (ObjectWnd == hWnd)
MessageBox (NULL, TEXT("Already using the current window"), TEXT("Notice"), MB_OK);
else
L_AnnSetWnd (hContainer, hWnd);
return;
}


L_AnnShowLockedIcon

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnShowLockedIcon (hObject, bShow, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_BOOL bShow; | /* flag that indicates whether to show the padlock icon */
L_UINT uFlags; | /* flags to determine which objects to process */

Enables and disables the displaying of the padlock icon on top of locked objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
bShow | Flag that indicates whether to show the padlock icon. Possible values are:
 | Value | Meaning
 | TRUE | Show the padlock icon on top of locked objects.
 | FALSE | Do not show the padlock icon on top of locked objects.

uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

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

Comments

A locked object will be displayed with a padlock on top if L_ShowLockedIcon has been called with bShow set to TRUE.

Note that this information will not be saved when calling L_AnnSave so you should call L_AnnShowLockedIcon with the desired value after calling any of the annotation loading functions, L_AnnLoad, L_AnnLoadMemory, L_AnnLoadOffset.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnUnlock, L_AnnShowLockedIcon, L_AnnUnrealize, L_AnnRealize, L_AnnLoad, L_AnnLoadMemory, L_AnnLoadOffset, L_AnnGetSelected, L_AnnSetSelected
Topics | Annotation Functions (Document/Medical ): Security
 | Implementing Annotation Security
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnGetLocked.


L_AnnTextEdit

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnTextEdit (hObject);

HANNOBJECT hObject;

/* handle to the text-based annotation object */

This function causes a text-based annotation to enter edit mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the text-based annotation object.

Returns

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

Comments

This function causes a text-based annotation to enter edit mode, which displays an edit window for direct entry of text. Calling this function 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:

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_RTF

A successful call to L_AnnSetText() 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 L_AnnTextEdit(), will get hObject2 out of the text edit mode, and put hObject into the text edit mode.

This function 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 function works only with the following objects:

ANNOBJECT_TEXT

ANNOBJECT_TEXTPOINTER

ANNOBJECT_NOTE

ANNOBJECT_PUSHPIN

ANNOBJECT_RTF

If you pass an object that is not one of these types, the function will return ERROR_INV_PARAMETER.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGetText, L_AnnGetTextLen, L_AnnGetAutoText, L_AnnGetAutoTextLen, L_AnnSetAutoText, L_AnnSetTextRTF, L_AnnGetTextRTF, L_AnnGetTextAlign, L_AnnSetTextAlign
Topics: | Annotation Objects - Automated Features
 | Annotation Functions (Document/Medical only): Getting and Setting Text Properties

Example

// This example programmatically makes an annotation text object
// hObject go into edit mode
// Note that hObject must be a text-based annotation
L_VOID ExampleAnnTextEdit(HANNOBJECT hObject)
{
L_INT nRet = SUCCESS;
L_UINT uType = 0;
L_CHAR *pszError = NULL;

nRet = L_AnnTextEdit(hObject);
switch(nRet)
{
case SUCCESS:
pszError = NULL;
break;
case ERROR_AUTOMATION_INV_HANDLE:
pszError = "L_AnnTextEdit failed because you are not in automated mode";
break;
case ERROR_INV_PARAMETER:
pszError = "L_AnnTextEdit failed because hObject was not text-based";
break;
default:
pszError = "L_AnnTextEdit failed";
break;
}

if (pszError)
MessageBox(NULL, pszError, "Error", MB_OK);
}


L_AnnUndo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnUndo(hObject)

HANNOBJECT hObject;

/* handle to the automation object */

Reverses the last user action that was executed using the automated annotation functions. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the automation object.

Returns

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

Comments

This function can be used repeatedly to reverse the number of actions specified by the L_AnnSetUndoDepth function. When the stack is empty, it returns an error.

There is only one undo depth value per root container. (Subcontainers do not have their own separate values.)

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnCreate, L_AnnSetAutoContainer, L_AnnGetAutoContainer, L_AnnSetDpiX, L_AnnSetDpiY, L_AnnGetDpiX, L_AnnGetDpiY, L_AnnSetTool, L_AnnGetTool, L_AnnGetUserMode, L_AnnSetUserMode, L_AnnSetUndoDepth, L_AnnAddUndoNode, L_AnnGetAutoUndoEnable, L_AnnSetAutoUndoEnable
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Implementing an Automated Annotation Program

Example

/* This example reverses the last user action in automation mode. */
HANNOBJECT hAutoObject; /* Automation object */
void TestAnnUndo(void)
{
L_UINT uUndoLevels;
L_AnnGetUndoDepth(hAutoObject, &uUndoLevels, NULL);
if(uUndoLevels)
L_AnnUndo(hAutoObject);
else
MessageBox(NULL, TEXT("No undo operation possible!"), TEXT("Undo"), MB_OK);
return;
}


L_AnnUngroup

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnUngroup(hObject, uFlags, pUserList)

HANNOBJECT hObject; | /* handle to the container object */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR * pUserList; | /* list of users */

Ungroups a group of objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_UNGROUP menu item has been selected.
 | ANNFLAG_USER | [0x0040] Ungroup only those objects with users listed in pUserList.
pUserList | Character string that contains the list of users associated with the specified object. pUserList 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 ANNFLAG_USER is set in uFlags.

Returns

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

Comments

The Ungroup automation menu item operates like L_AnnUngroup(hContainer, ANNFLAG_RECURSE|ANNFLAG_SELECTED, NULL).

If ANNFLAG_USER is included in uFlags, any user associated with an object to be "ungrouped" must be included in pUserList. The function checks pUserList before ungrouping the objects and any object that has a user not in pUserList will not be ungrouped.

If ANNFLAG_USER is not included in uFlags, the user list is ignored.

Please note that if you include ANNFLAG_SELECTED|ANNFLAG_USER, for example, in uFlags, the objects that will be ungrouped must have a user in pUserList AND must also be selected.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnGroup
Topics: | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Annotation Functions (Document/Medical only): Grouping and Ungrouping Objects
 | Grouping and Ungrouping Annotation Objects

Example

HANNOBJECT hContainer;
void TestFunction2(void)
{
L_INT nRet;
nRet = L_AnnUngroup(hContainer, ANNFLAG_RECURSE | ANNFLAG_NOTCONTAINER, TEXT("MyObject"));
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("Ungrouped."), TEXT(""), MB_OK);

}


L_AnnUnlock

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnUnlock(hObject, pUnlockKey, uFlags)

HANNOBJECT hObject; | /* handle to the annotation object */
L_TCHAR L_FAR * pUnlockKey; | /* character string containing the key */
L_UINT uFlags; | /* flags to determine which objects to process */

Unlocks one or more annotation objects with the specified key. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle to the annotation object
pUnlockKey | Character string containing the key used to unlock the annotation object.
uFlags | 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.
 | ANNFLAG_SELECTED | [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
 | ANNFLAG_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.
 | ANNFLAG_RECURSE | [0x0008] Process objects within a container, and within any subcontainers, down to any level.
 | ANNFLAG_NOTCONTAINER | [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
 | ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.
 | ANNFLAG_CHECKMENU | [0x0020] Process objects only if the ANNAUTOTEXT_MENU_UNLOCK menu item has been selected.

Returns

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

Comments

Only objects locked with the same key can be unlocked. If the object is still locked or if not all objects have been unlocked (in case you tried to unlock more than one object), ERROR_ANN_LOCKED is returned.

An object must be unlocked in order to change that object in automated mode.

Redact objects must be unlocked to be restored (unrealized). Refer to L_AnnUnrealize.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnLock, L_AnnShowLockedIcon, L_AnnUnrealize, L_AnnRealize
Topics | Annotation Functions (Document/Medical ): Security
 | Implementing Annotation Security
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

For an example, refer to L_AnnGetLocked.


L_AnnUnrealize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnUnrealize(pBitmap, prcBounds, hObject, fSelected)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT prcBounds; | /* pointer to the bounding rectangle for drawing */
HANNOBJECT hObject; | /* handle to the annotation object to restore */
L_BOOL fSelected; | /* flag that indicates which objects to restore*/

Restores redact objects that have a bitmap saved inside them. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to update.
prcBounds | Pointer to the Windows RECT structure that specifies the bounding rectangle where the annotations will be drawn.
 | You can pass NULL for the default, which matches the bitmap by specifying left = 0, top = 0, right = bitmap width, and bottom = bitmap height.
hObject | Handle to the annotation object to restore. The object can be a redact object or a container object (in which case, all the redact objects contained inside - or only the selected redact objects) are restored.
fSelected | Flag that indicates which objects to restore. Possible values are:
 | Value | Meaning
 | TRUE | Restore only the selected objects.
 | FALSE | Restore all objects.

Returns

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

Comments

Restores the background of a redact object. This function is valid only for redact objects or container objects (for more than one redact object).

If you realize a redact object, moving the redact object will leave the original location of the redact object hidden. When you call L_AnnRealize and specify RedactOnly, for every Redact object, the background of the image behind is saved inside the object. To restore the image under the redact object (so that when you move the redact object, the underlying image is not hidden), you must unrealize the redact object by calling L_AnnUnrealize. L_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 fSelected 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, fSelected is ignored. Locked redact objects are not restored. The background bitmap stored inside the redact object is destroyed after being restored.

The return value is SUCCESS if all objects have been restored, ERROR_ANN_LOCKED if one or more redact objects are not restored because they are still locked. Any other error code is an indication of a fatal error.

Encryptor objects cannot be realized. The encryptor is the only annotation object that cannot be realized.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AnnRealize, L_AnnLock, L_AnnUnlock
Topics | Annotation Functions (Document/Medical only)Realizing to a Bitmap
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program
 | Displaying and Manipulating Annotation Objects

Example

This example attempts to restore all redact objects within a container. If this is unsuccessful, a message is displayed.

HANNOBJECT hContainer; /* Container object */
BITMAPHANDLE LeadBitmap; /* bitmap handle */
void TestAnnUnrealize (void)
{
/* unrealize all of the redact objects */
if(L_AnnUnrealize(&LeadBitmap, NULL, hContainer, FALSE) == ERROR_ANN_LOCKED)
MessageBox(NULL, TEXT("Some redact objects are locked and cannot be restored"), TEXT("Warning"), MB_OK);
return;
}


L_AntiAliasBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AntiAliasBitmap(pBitmap, uThreshold, uDim, uFilter)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* threshold value */
L_UINT uDim; | /* mask size */
L_UINT uFilter; | /* anti-aliasing filter */

Applies an anti-aliasing filter to the specified bitmap.

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

Returns

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

Comments

This function can process the whole image or a region of the image.

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.

The best results for anti-aliasing text can be obtained with the filter ANTIALIAS_2.

The value of the uDim 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 function 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 function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Correcting Colors
 | Raster Image Function: Filtering Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and does anti-aliasing on it*/
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* do the anti-aliasing on the bitmap */
L_AntiAliasBitmap (&LeadBitmap, 128, 3, ANTIALIAS_1);


L_AppendPlayback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AppendPlayback(hPlayback, pBitmap)

HPLAYBACK hPlayback; | /* playback handle */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */

Appends a bitmap to a bitmap list during an animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.
pBitmap | Pointer to the bitmap handle that references the bitmap to append. The specified bitmap must be fully allocated, although the image data is not yet loaded when this function is called.

Returns

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

Comments

If you pass NULL in the hList parameter of the L_CreatePlayback function, you can use the L_AppendPlayback function to add bitmaps to the list during the playback. This is useful in the FILEREADCALLBACK function if you want to play an animated file as it is being loaded. If you need to reference the list after the playback, you can pass the address of an HBITMAPLIST variable when you call the L_DestroyPlayback function.

The L_ValidatePlaybackLines function lets you validate the lines that the animation playback engine will render to the target bitmap.

Required DLLs and Libraries

LTDIS
LTFIL

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback,
 | L_GetPlaybackDelay, L_CancelPlaybackWait,
 | L_ProcessPlayback, L_ClearPlaybackUpdateRect,
 | L_GetPlaybackIndex, L_GetPlaybackState,
 | L_GetPlaybackUpdateRect, L_SetPlaybackIndex,
 | L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

/****************************************************************************************
This example plays an animated GIF or AVI file as it loads the file. The example includes both
the calling function and the FILEREADCALLBACK function, which displays the image.
The sample code uses the following global declarations: */
BITMAPHANDLE Bitmap; /* bitmap for the playback bitmap */
BITMAPHANDLE Bitmap2; /* bitmap to hold loaded frames */
HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */

/* Structure used for the callback function's user data */
typedef struct tagPLAYCALLBACKDATA
{
HPALETTE hPalette; /* old palette saved from callback */
HWND hWnd; /* window to paint */
HDC hDC; /* hdc of window to paint */
RECT rcPaint; /* windows client rectangle */
HPLAYBACK hPlayback;
} PLAYCALLBACKDATA;

/* function prototypes */
static L_INT PlayWhileLoad (HWND hWndChild, L_TCHAR L_FAR*szFile);
/* Prototype for the FILEREADCALLBACK function */
L_INT L_FAR L_EXPORT PlayCallBack(pFILEINFO pFileInfo,
pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines,
PLAYCALLBACKDATA L_FAR * pData);

/***************** calling function *******************/
static L_INT PlayWhileLoad (HWND hWnd, L_TCHAR L_FAR*szFile)
{
L_INT nRet;
FILEREADCALLBACK lpfnCallBack;
PLAYCALLBACKDATA AnimData;
HPALETTE hOldPal=NULL;

AnimData.hWnd = hWnd;
AnimData.hDC = GetDC(hWnd);
AnimData.hPalette = NULL;
GetClientRect(hWnd, &AnimData.rcPaint);

/* load the first frame, so we have the palette and a target bitmap for playback */
L_LoadBitmap(szFile, &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
AnimData.hPalette = L_CreatePaintPalette(AnimData.hDC, &Bitmap);
if(AnimData.hPalette)
{
hOldPal = SelectPalette(AnimData.hDC, AnimData.hPalette, FALSE);
RealizePalette(AnimData.hDC);
}

nRet = L_CreatePlayback(&AnimData.hPlayback, &Bitmap, NULL);

lpfnCallBack = (FILEREADCALLBACK) MakeProcInstance ((FARPROC) PlayCallBack, hInst);

nRet = L_LoadFile (szFile, &Bitmap2, sizeof(BITMAPHANDLE), 24,
ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_ALLPAGES,
lpfnCallBack, &AnimData, NULL, NULL);

PlayProcessing(&AnimData);
FreeProcInstance ((FARPROC) lpfnCallBack);
if(AnimData.hPalette)
{
SelectPalette(AnimData.hDC, hOldPal, FALSE);
DeleteObject(AnimData.hPalette);
}
ReleaseDC (hWnd, AnimData.hDC);
L_DestroyPlayback(AnimData.hPlayback, NULL);

L_FreeBitmap(&Bitmap);
L_FreeBitmap(&Bitmap2);

return(nRet);
}

L_INT L_FAR L_EXPORT PlayCallBack(pFILEINFO pFileInfo,
pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines,
PLAYCALLBACKDATA L_FAR * pData)
{
L_UINT uState;
RECT rcUpdate;
L_INT nRet;

if (uFlags & FILEREAD_FIRSTROW)
{
nRet = L_AppendPlayback(pData->hPlayback, pBitmap);
if(nRet != SUCCESS)
return(nRet);
}
L_ValidatePlaybackLines(pData->hPlayback, nRow, nLines);

L_GetPlaybackState(pData->hPlayback, &uState);
while(uState != PLAYSTATE_END)
{
L_ProcessPlayback(pData->hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_WAITINPUT:
L_CancelPlaybackWait(pData->hPlayback);
break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
L_GetPlaybackUpdateRect(pData->hPlayback, &rcUpdate, TRUE);
L_PaintDC (pData->hDC, &Bitmap, NULL, &rcUpdate, &pData->rcPaint, NULL, SRCCOPY);
break;
}
break;
}
return(SUCCESS);
}


L_ApplyLinearModalityLUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyLinearModalityLUT (pBitmap, fIntercept, fSlope, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_DOUBLE fIntercept; | /* rescale intercept */
L_DOUBLE fSlope; | /* rescale slope */
L_UINT uFlags; | /* flags */

Remaps the bitmap pixels by applying a linear transformation described by a rescale slope and an intercept. This function is available in the Medical Toolkit only.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that will be changed.
fIntercept | "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".
fSlope | "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".
uFlags | Flags which determine the behavior of this function. Possible values are:
 | Value | Meaning
 | M_LUT_UPDATE_MIN_MAX | [0x0002] If set, the function will update pBitmap->MinVal with the new minimum intensity value in the bitmap and pBitmap->MaxVal with the new maximum intensity value.
 | M_LUT_ALLOW_RANGE_EXPANSION | [0x0008] If set, the function will adjust the high bit and/or low bit (if possible) inside the bitmap handle in order to be able to hold the range of pixel values after applying the modality LUT.

Returns

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

Comments

This function remaps the bitmap pixels by applying a linear transformation described by rescale slope and intercept. In the DICOM world, this is referred to as "applying a linear Modality LUT".

This function 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 function 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 function only works on grayscale bitmaps. Calling this function for non-grayscale bitmaps will return an error (ERROR_INV_PARAMETER).

It is recommended to always set the M_LUT_UPDATE_MIN_MAX flag.

This function 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, LowBit = 0.

For example, let’s say the bitmap is:

BitsPerPixel = 12

LowBit = 4

HighBit = 10

In this case, there are 10-4+1=7 valid bits. This means that there are 128 values to remap.

This function supports signed data images.

If M_LUT_ALLOW_RANGE_EXPANSION is set in uFlags, consider the following example:

If the dataset 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 fIntercept is set to –1024 and fSlope 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 function 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 function won’t be able to update the high bit and/or low bit if the number of bits stored was already equal to the bitmap bits per pixel.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RemapBitmapIntensity, L_ApplyLinearModalityLUT, L_ApplyVOILUT, L_ApplyLinearVOILUT, L_DicomGetModalityLUTAttributes , L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to L_ApplyModalityLUT.


L_ApplyLinearVOILUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyLinearVOILUT (pBitmap, fCenter, fWidth, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_DOUBLE fCenter; | /* window center */
L_DOUBLE fWidth; | /* window width */
L_UINT uFlags; | /* flags */

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. This function is available in the Document/Medical Toolkit only.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be leveled.
fCenter | Window Center for display.
fWidth | Window Width for display.
uFlags | Flags which determine the behavior of this function. Possible values are one or an OR-ed combination of the following:
 | Value | Meaning
 | VOI_LUT_UPDATE_MIN_MAX | [0x0001] If set, the function will recalculate pBitmap->MinVal based on the minimum intensity inside the bitmap and recalculate pBitmap->MaxVal based on the maximum intensity inside the bitmap.
 | VOI_LUT_REVERSE_ORDER | [0x0002] If set, the function will fill the bitmap display LUT in reverse order (light to dark instead of dark to light).

Returns

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

Comments

This function sets up the paint or paint & image processing functions' window leveling options for a specific bitmap through a linear transformation described by window center and width. In the DICOM world, this is referred to as "applying a linear VOI LUT".

This function 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 function does not 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.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ApplyVOILUT, L_RemapBitmapIntensity, L_ApplyModalityLUT, L_ApplyLinearModalityLUT, L_DicomGetWindow , L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to L_ApplyVOILUT.


L_ApplyMathLogicBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyMathLogicBitmap(pBitmap, nFactor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFactor; | /* operation factor */
L_UINT uFlags; | /* flag */

Performs specific mathematical or logical operations on the colors of a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the resulting bitmap on which the effect is applied.
nFactor | Mathematical or logical operation factor.
uFlags | 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 L_ApplyMathLogicBitmap Function for the list of flags.

Returns

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

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and multiplies the colors using a factor of 1.51 */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Multiply the colors of the bitmap using a factor of 1.51 */
L_ApplyMathLogicBitmap(&LeadBitmap, 151, AML_OP_MUL| CHANNEL_MASTER| AML_VALUE_NOP| AML_RES_NOP);


L_ApplyModalityLUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyModalityLUT (pBitmap, pLUT, pLUTDescriptor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_UINT16 L_FAR * pLUT; | /* pointer to the lookup table to be applied to the bitmap */
pDICOMLUTDESCRIPTOR pLUTDescriptor; | /* pointer to the structure describing the LUT parameters */
L_UINT uFlags; | /* flags */

Remaps the bitmap pixels through a lookup-table (LUT). This function is available in the Medical Toolkit only.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that will be changed.
pLUT | Pointer to the LUT which contains the lookup table. The length of the LUT is in pLUTDescriptor->uNumberOfEntries
pLUTDescriptor | Pointer to a structure describing the LUT. The following structure members are used:
 | Value | Meaning
 | nFirstStoredPixelValueMapped | Indicates the first index whose remapped value is stored in the LUT. All pixels that are less than this value will be remapped to pLUT[0].
 | uNumberOfEntries | The number of entries in pLUT. All the pixels that are greater than nFirstStoredPixelValueMapped + uNumberOfEntries will be set to the last entry in the LUT (pLUT[uNumberOfEntries – 1])
uFlags | Flags which determine the behavior of this function. Possible values may be one or an Or-ed combination of the following:
 | Value | Meaning
 | M_LUT_SIGNED | [0x0001] If set, the LUT entries are signed 16-bit values. If not set, the LUT entries are unsigned 16-bit values.
 | M_LUT_UPDATE_MIN_MAX | [0x0002] If set, the function will update pBitmap->MinVal with the new minimum intensity value in the bitmap and pBitmap->MaxVal with the new maximum intensity value.

Returns

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

Comments

This function remaps the bitmap pixels through a lookup-table (LUT). In the DICOM world, this is referred to as "applying a non-linear Modality LUT".

This function is similar to L_RemapBitmapIntensity because it remaps the bitmap pixel values through a LUT. The function differs from L_RemapBitmapIntensity as follows:

L_ApplyModalityLUT allows you to specify an incomplete LUT. Values less than the first mapped index will be mapped to the first entry in the palette. Values higher than "first mapped index" + "LUT length" will be mapped to the last entry in the LUT.

L_ApplyModalityLUT only works on grayscale bitmaps. Calling this function for non-grayscale bitmaps will return an error (ERROR_INV_PARAMETER).

L_ApplyModalityLUT can create signed bitmaps. The output bitmap will be signed (if M_LUT_SIGNED is set), or unsigned (M_LUT_SIGNED is not set).

The values in the LUT will be masked such that only the useful bits in the bitmap are considered. The values are considered as if the bitmap pixel values are normalized, LowBit = 0.

For example, let’s say the bitmap is:

BitsPerPixel = 12

LowBit = 4

HighBit = 10

In this case, there are 10-4+1=7 valid bits. This means that there are 128 values to remap. For every pixel, L_ApplyModalityLUT will do the following:

Take the pixel value, shift it to the right by 4 and mask out the high bits, producing a value (val = 0..127).

val is remapped according to the LUT (values smaller than nFirstStoredPixelValueMapped are mapped to first LUT entry, while values greater than nFirstStoredPixelValueMapped + uNumberOfEntries are mapped to the last LUT entry)

After remapping, val is shifted to the left by 4 and will replace bits 4 thru 10 from the original bitmap

If the bitmap is signed, the indices for the LUT are assumed to be signed and be between –32768 and +32767.

If the bitmap is unsigned, the indices are unsigned and are between 0..65535.

It is recommended to always set the M_LUT_UPDATE_MIN_MAX flag.

This function 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.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RemapBitmapIntensity , L_ApplyLinearModalityLUT, L_ApplyVOILUT, L_ApplyLinearVOILUT, L_DicomGetModalityLUTAttributes , L_DicomGetModalityLUTData , L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_INT TestModalityLUT(pBITMAPHANDLE pBitmap, L_BOOL bLinear)
{
L_INT nRet;
if(bLinear)
{
nRet = L_ApplyLinearModalityLUT (pBitmap, 0.0, 0.5, 0);
}
else
{
L_UINT16 L_FAR* pLUT;
L_INT i;
DICOMLUTDESCRIPTOR LUTDescriptor;

// allocate and initialize the LUT
pLUT = malloc(0x10000 * sizeof(L_UINT16));
if(!pLUT)
return ERROR_NO_MEMORY;

// set a LUT which reduces the intensity of each pixel to half
for(i = 0; i <= 0xFFFF; i++)
pLUT[i] = i / 2;

// fill the LUTDescriptor structure
SET_SIZE(&LUTDescriptor);
LUTDescriptor.nFirstStoredPixelValueMapped = 0;
LUTDescriptor.uEntryBits = 16;
LUTDescriptor.uNumberOfEntries = 0x10000;

// apply the LUT
nRet = L_ApplyModalityLUT(pBitmap, pLUT, &LUTDescriptor, 0);

// free the LUT
free(pLUT);
}
return nRet;
}


L_ApplyTransformationParameters

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyTransformationParameters (pBitmap, nXTranslation, nYTranslation,nAngle, uXScale, uYScale, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nXTranslation; | /* x-axis translation */
L_INT nYTranslation; | /* y-axis translation */
L_INT nAngle; | /* bitmap rotation angle */
L_UINT uXScale; | /* bitmap x-axis (Width) scaling factor */
L_UINT uYScale; | /* bitmap y-axis (Height) scaling factor */
L_UINT uFlags; | /* flags that specify resize behavior */

Corrects the image by removing the translation, rotation, and scaling deformations that have been applied on the image. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the transformed bitmap.
nXTranslation | The amount of bitmap translation along the x-axis (Width). This value is internally divided by 100. This value must be equal to the one returned from L_GetTransformationParameters function.
nYTranslation | The amount of bitmap translation (in pixels) along the y-axis (Height). This value is internally divided by 100. This value must be equal to the one returned from L_GetTransformationParameters function.
nAngle | Hundredths of degrees to rotate (+/-). This can be a number from 1 to 36,000. This value is internally divided by 100. A positive value means the image rotated in a clockwise rotation, while a negative value means the image rotated in a counter-clockwise rotation. This value must be equal to the one returned from L_GetTransformationParameters function.
uXScale | The amount of bitmap x-axis (Width) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from L_GetTransformationParameters function.
uYScale | The amount of bitmap y-axis (Height) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from L_GetTransformationParameters function.
uFlags | Flag that specifies the behavior when resizing the bitmap. Select one value. Possible values are:
 | 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.
 | 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. You can use a bitwise OR ( | ) to combine this flag with another one. 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.

Returns

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

Comments

This function 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 function is designed to work with L_GetTransformationParameters.

You can get the translation, rotation, and scaling parameters by using L_GetTransformationParameters function; the returned values must be passed as they are to L_ApplyTransformationParameters function.

The shift operation is performed first, followed by the rotation and resize operations.

If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_RotateBitmap, L_SizeBitmap, L_ResizeBitmap L_DeskewBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap, L_GetMarksCenterMassBitmap
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to L_GetTransformationParameters.


L_ApplyVOILUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ApplyVOILUT (pBitmap, pLUT, pLUTDescriptor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_UINT16 L_FAR * pLUT; | /* pointer to the lookup table */
pDICOMLUTDESCRIPTOR pLUTDescriptor; | /* pointer to the structure describing the LUT parameters */
L_UINT uFlags; | /* flags */

Sets up the paint or paint and image processing functions' window leveling options for a specific bitmap through a lookup-table (LUT). This function is available in the Document/Medical Toolkit only.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be leveled.
pLUT | Pointer to the LUT which contains the lookup table. The length of the LUT is in pLUTDescriptor->uNumberOfEntries
pLUTDescriptor | Pointer to a structure describing the LUT. The following structure members are used:
 | Value | Meaning
 | nFirstStoredPixelValueMapped | Indicates the first index whose remapped value is stored in the LUT. All bitmap display LUT entries which are less than this value will be remapped to pLUT[0].
 | uNumberOfEntries | The number of entries in pLUT all bitmap display LUT entries which are greater than nFirstStoredPixelValueMapped + uNumberOfEntries will be set to the last entry in the LUT (pLUT[uNumberOfEntries – 1])
uFlags | Flags which determine the behavior of this function. Possible values are one or an OR-ed combination of the following:
 | VOI_LUT_UPDATE_MIN_MAX | [0x0001] If set, the function will recalculate pBitmap->MinVal based on the minimum intensity inside the bitmap and recalculate pBitmap->MaxVal based on the maximum intensity inside the bitmap.
 | VOI_LUT_REVERSE_ORDER | [0x0002] If set, the function will fill the bitmap display LUT in reverse order (light to dark instead of dark to light).

Returns

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

Comments

This function sets up the paint or paint and image processing functions' window leveling options for a specific bitmap through a lookup-table (LUT). In the DICOM world, this is referred to as "applying a non-linear VOI LUT".

This function 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 function does not change the image data; it only updates the entries inside the bitmap display LUT.

It is 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.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ApplyLinearVOILUT, L_RemapBitmapIntensity , L_ApplyModalityLUT , L_ApplyLinearModalityLUT, L_DicomGetVOILUT , L_DicomGetVOILUTData , L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_INT TestVOILUT(pBITMAPHANDLE pBitmap, L_BOOL bLinear)
{

L_INT nRet;

if(bLinear)
{
// Apply "Abdomen T1" window-level , high bit is assumed
// to be "11" and low bit "0.
nRet = L_ApplyLinearVOILUT (pBitmap, 330.0, 600.0, 0);
}
else
{
L_UINT16 L_FAR* pLUT;
L_INT i;
DICOMLUTDESCRIPTOR LUTDescriptor;

// allocate and initialize the LUT
pLUT = malloc(0x1000 * sizeof(L_UINT16));
if(!pLUT)
return ERROR_NO_MEMORY;

for(i = 0; i <= 0x1000; i++)
{
if(i < 30)
{
pLUT[i] = 0;
}
else
if(i > 630)
{
pLUT[i] = 630;
}
else
{
pLUT[i] = i ;
}
}
// fill the LUTDescriptor structure
SET_SIZE(&LUTDescriptor);
LUTDescriptor.nFirstStoredPixelValueMapped = 0;
LUTDescriptor.uEntryBits = 16;
LUTDescriptor.uNumberOfEntries = 0x1000;

// apply the LUT
nRet = L_ApplyVOILUT(pBitmap, pLUT, &LUTDescriptor, 0);

// free the LUT
free(pLUT);
}
return nRet;
}


L_AutoBinaryBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AutoBinaryBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Applies binary segmentation to the bitmap using an automatically calculated threshold based on a two-peak method of statistical analysis of the histogram. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to segment.

Returns

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

Comments

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

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_BinaryFilterBitmap, L_ColorLevelBitmap, L_BinaryFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

/* The following example loads a bitmap and applies automatic binary segmentation on it: */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply Auto Binary Segment */
L_AutoBinaryBitmap (&LeadBitmap);


L_AutoColorLevelBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AutoColorLevelBitmap(pBitmap, pLvlClr, uBlackClip, uWhiteClip, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pLVLCLR pLvlClr; | /* pointer to a LVLCLR structure that specifies input level values for all channels */
L_UINT uBlackClip; | /* percentage of the bitmap’s black (Shadow) pixels to clip */
L_UINT uWhiteClip; | /* percentage of the bitmap’s white (Highlight) pixels to clip */
L_UINT uFlags; | /* a flag that indicates the type of leveling to perform */

Applies one of several types of automatic color leveling to an image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
pLvlClr | Pointer to a LVLCLR structure that specifies the color leveling information used by the function. If AUTO_NOPROCESS is not set in uFlags, you can pass NULL if you are not interested in using these values. If AUTO_NOPROCESS is set in uFlags, then this parameter cannot be NULL.
uBlackClip | 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.
uWhiteClip | 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.
uFlags | A flag that indicates the type of leveling to perform. Possible values are:
 | Value | Meaning
 | AUTO_LEVEL | [0x0001] 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 | [0x0002] Perform leveling on the MASTER channel (the grayscale values of the pixels). No color cast will be introduced.
 | AUTO_INTENSITY | [0x0003] Perform leveling on the RGB channel (the sum of the R, G, and B channels). No color cast will be introduced.
 | AUTO_NOPROCESS | [0x0004] 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.

Returns

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

Comments

This function 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.

Before you call L_AutoColorLevelBitmap, you need to initialize the size of the LVLCLR structure. The other fields in the structure will be updated with the uMinInput, uMaxInput, uMinOutput, uMaxOutput and uGamma values used by the function for the appropriate channel(s).

If you set the AUTO_NOPROCESS flag in uFlags, the pLvlClr parameter will be updated with the color leveling information used by the L_AutoColorLevelBitmap function. If you then pass the updated pLvlClr structure to the L_ColorLevelBitmap function, you will obtain the same result that you would have obtained if you had called the L_AutoColorLevelBitmap function with the leveling flag by itself.

If you set AUTO_NOPROCESS in uFlags and pass NULL to pLvlClr the function will return an error code.

If you pass only AUTO_NOPROCESS to uFlags then the function will return an error code.

If the image is a grayscale image, then AUTO_LEVEL, AUTO_CONTRAST and AUTO_INTENSITY give identical results. Also the member variables master, red, green and blue of the structure pLvlClr will have the same values.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 L_AutoColorLevelBitmap function using the AUTO_LEVEL flag.

The following figure shows what would happen if you start with the original image and apply the L_AutoColorLevelBitmap function using the AUTO_INTENSITY flag.

The following figure shows what would happen if you start with the original image and apply the L_AutoColorLevelBitmap function using the AUTO_CONTRAST flag.

This function 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 function.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgColor , L_WindowLevel, L_ColorLevelBitmap, L_SelectiveColorBitmap, L_GammaCorrectBitmapExt, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Correcting Colors
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and applies auto image leveling. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LVLCLR lc; /* Structure to hold the level values, used for display only */
L_TCHAR buffer[100];

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply "Auto Leveling" to the bitmap */
lc.uStructSize = sizeof(LVLCLR);
L_AutoColorLevelBitmap (&LeadBitmap, &lc, DEFAULT_BLACK_CLIP, DEFAULT_WHITE_CLIP, AUTO_LEVEL);
wsprintf (buffer, TEXT("Min and Max input values for the blue channel using auto level are %d and %d"), lc.blue.uMinInput, lc.blue.uMaxInput);


L_AutoTrimBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AutoTrimBitmap(pBitmap, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* delta value for detecting blank space */

Trims the current bitmap, removing blank space around the edges.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be trimmed.
uThreshold | 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 uThreshold is considered blank space. Valid values are 0 to 255.

Returns

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

Comments

Generally, this function is used for automatically trimming blank space from the edges of scanned documents.

Nevertheless, because this function uses changes in intensity to detect blank space, it can trim edges of any color or intensity.

If a region is defined for the bitmap, the region is also trimmed if necessary.

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

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetAutoTrimRect, L_TrimBitmap, L_CopyBitmapRect, L_WindowLevel
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image

Example

/* This example loads an image and then AutoTrims the bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* AutoTrim the bitmap with 0 tolerance */
L_AutoTrimBitmap ( &LeadBitmap, 0 );


L_AverageFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AverageFilterBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* size of the averaging neighborhood */

Changes the color of each pixel in a bitmap to the average color of pixels in its neighborhood. This results in a blur effect.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to average.
uDim | Size of the averaging neighborhood. It is the length, in pixels, of one side of a square.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You control the amount of blur by specifying the size of the neighborhood that is used for averaging.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgAverage , L_WindowLevel, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies an average filter. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Average with a neighborhood of 3x3 pixels */
L_AverageFilterBitmap(&LeadBitmap, 3 );


L_BalanceColors

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BalanceColors(pBitmapHndl, pRedFact, pGreenFact, pBlueFact)

pBITMAPHANDLE pBitmapHndl; | /* pointer to the bitmap handle */
BALANCING L_FAR * pRedFact; | /* pointer to a structure */
BALANCING L_FAR * pGreenFact; | /* pointer to a structure */
BALANCING L_FAR * pBlueFact; | /* pointer to a structure */

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

Parameter | Description
pBitmapHndl | Pointer to the bitmap handle that references the bitmap in which to balance the colors.
pRedFact | Pointer to a BALANCING structure that contains the values to use for redistributing the bitmap's red values.
pGreenFact | Pointer to a BALANCING structure that contains the values to use for redistributing the bitmap's green values.
pBlueFact | Pointer to a BALANCING structure that contains the values to use for redistributing the bitmap's blue values.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For each pixel in the bitmap, the red value is modified using the values pointed to by pRedFact. 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 pointed to by pGreenFact. 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 pointed to by pBlueFact. 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.

The Balancing structure has three components of type double: toRed, toGreen and toBlue. The possible values of each member must be within the range: 0.0 – 1.0.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ConvertToColoredGray, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

/* This example assumes there is a bitmap loaded into Bitmap, which is of type BITMAPHANDLE. */
BITMAPHANDLE Bitmap;
BALANCING RedFact, GreenFact, BlueFact;
RedFact.toRed=0.25;
RedFact.toGreen=0.50;
RedFact.toBlue=0.25;
GreenFact.toRed=0.30;
GreenFact.toGreen=0.40;
GreenFact.toBlue=0.30;
BlueFact.toRed=0.10;
BlueFact.toGreen=0.60;
BlueFact.toBlue=0.30;
L_BalanceColors(&Bitmap,&RedFact,&GreenFact,&BlueFact);


L_BendingBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BendingBitmap(pBitmap, nValue, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* stretch amount */
POINT CenterPt; | /* effect center */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Warps the active bitmap along a curved plane, centered on the pivot point. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nValue | Amount of stretching, where positive values stretch the pixels toward edges, and negative values stretch the pixels toward the center. Possible values are range in between -500 and 500.
CenterPt | A POINT structure that contains the center of the arc. This is ignored when either BND_HORZ or BND_VERT is set in the uFlags parameter.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | Flags that indicate how to handle peripherally exposed areas, how to handle centrally exposed areas and the type of bending. 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 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 nValue 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function bends the image around the specified CenterPt. 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgBending , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* bend the image around it is center */
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_BendingBitmap (&LeadBitmap, 100, CenterPt, 0, FILL_RPT | FILL_WOUTROT | BND_NORM);


L_BinaryFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BinaryFilterBitmap(pBitmap, pFilter)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPBINARYFLT pFilter; | /* pointer to the binary filter to use */

Imposes a binary filter on a bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
pFilter | 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 | [#define] Shrinks black objects in the image. The effect is biased in the specified direction.
 | BFLT_DILATION_OMNI BFLT_DILATION_HORZ BFLT_DILATION_VERT BFLT_DILATION_DIAG | [#define] Enlarges black objects in the image. The effect is biased in the specified direction.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap,
 | L_DlgErosionFilter , L_DlgDilationFilter , L_WindowLevel, L_HolesRemovalBitmapRgn, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and dilates its black objects. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Dilate black objects */
L_BinaryFilterBitmap(&LeadBitmap, BFLT_DILATION_OMNI );


L_BitmapHasRgn

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_BitmapHasRgn(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Determines whether the bitmap has a region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to test.

Returns

TRUE | The specified bitmap has a region.
FALSE | The specified bitmap does not have a region.

Comments

When a bitmap has a region, the LEADTOOLS functions that modify the pixel values (for example L_PosterizeBitmap) act on the region, rather than the whole bitmap. In addition, the LEADTOOLS functions that flip, reverse, rotate, shear, or resize a bitmap also transform the region to match the bitmap. For example, if you were to shear the bitmap that had a rectangular region, the region would become a parallelogram.

To remove a bitmap region, use the L_FreeBitmapRgn function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_FreeBitmapRgn,
 | L_GetBitmapRgnArea, L_IsPtInBitmapRgn
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For an example, refer to L_FrameBitmapRgn.


L_BorderRemoveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BorderRemoveBitmap(pBitmap, pBorderRemove, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPBORDERREMOVE pBorderRemove; | /* pointer to a structure */
BORDERREMOVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData | /* pointer to more parameters for the callback */

Removes the black borders in a 1-bit black and white image.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap from which to remove borders.
pBorderRemove | Pointer to the BORDERREMOVE structure that LEADTOOLS uses to remove borders.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in BORDERREMOVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function removes borders that commonly appear in scanned text documents. Any or all of the four borders can be detected and removed. The behavior of this function can be modified by using its callback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | BORDERREMOVECALLBACK, L_SmoothBitmap,
 | L_LineRemoveBitmap, L_InvertedTextBitmap,
 | L_DotRemoveBitmap, L_HolePunchRemoveBitmap, L_HolesRemovalBitmapRgn
Topics: | Cleaning Up 1-Bit Images

Example

//Border Remove
//This example returns a region corresponding to the borders of a bitmap
//For the example, windows regions are returned in the callback and combined.
//Inn practice it would easier and faster to just return a LEAD region representing the changes
//The border is removed from the image

L_INT L_EXPORT EXT_CALLBACK ExampleBorderRemoveCB(
HRGN hRgn,
L_UINT32 uBorderToRemove,
LPRECT pBoundingRect,
L_VOID L_FAR *pUserData
)
{
L_TCHAR szMsg[200];
L_TCHAR *pszBorder;
HRGN hRgnAll;

hRgnAll = (HRGN)(pUserData);
CombineRgn( hRgnAll, hRgnAll, hRgn, RGN_OR);
DeleteObject(hRgn);

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;
}
wsprintf(
szMsg,
TEXT("Border[%s]\tBounds[%d,%d][%d,%d]\n"),
pszBorder,
pBoundingRect->left,
pBoundingRect->top,
pBoundingRect->right,
pBoundingRect->bottom
);
OutputDebugString(szMsg);

return SUCCESS_REMOVE;
}

L_VOID ExampleBorderRemove(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
BORDERREMOVE br;
HRGN hRgnAll;

//Create a NULL region
hRgnAll = CreateRectRgn(0, 0, 0, 0);
br.uStructSize = sizeof(BORDERREMOVE);
br.iBorderPercent = 20;
br.iVariance = 2;
br.iWhiteNoiseLength = 5;
br.uBorderToRemove = BORDER_TOP | BORDER_BOTTOM | BORDER_LEFT | BORDER_RIGHT;
br.uFlags = BORDER_CALLBACK_REGION | BORDER_USE_VARIANCE;

nRet = L_BorderRemoveBitmap(
pBitmap,
&br,
(BORDERREMOVECALLBACK)(ExampleBorderRemoveCB),
(L_VOID L_FAR *)hRgnAll
);

if (nRet == SUCCESS)
{
RECT rectRgn;

GetRgnBox(hRgnAll, &rectRgn);
if (!IsRectEmpty(&rectRgn))
{
L_SetBitmapRgnHandle(pBitmap, NULL, hRgnAll, L_RGN_SET);
DeleteObject(hRgnAll);
}
}

}


L_BricksTextureBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BricksTextureBitmap(pBitmap, uBricksWidth, uBricksHeight, uOffsetX, uOffsetY, uEdgeWidth, uMortarWidth, uShadeAngle, uRowDifference, uMortarRoughness, uMortarRoughnessEvenness, uBricksRoughness, uBricksRoughnessEvenness, crMortarColor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBricksWidth; | /* width of the flat area of the brick */
L_UINT uBricksHeight; | /* height of the flat area of the brick */
L_UINT uOffsetX; | /* first brick X offset */
L_UINT uOffsetY; | /* first brick Y offset */
L_UINT uEdgeWidth; | /* perceived brick edge width */
L_UINT uMortarWidth; | /* mortar width */
L_UINT uShadeAngle; | /* shading angle */
L_UINT uRowDifference; | /* horizontal distance between the first brick in the first row and the first brick in the second row */
L_UINT uMortarRoughness; | /* mortar roughness */
L_UINT uMortarRoughnessEvenness; | /* mortar weathering factor */
L_UINT uBricksRoughness; | /* brick roughness */
L_UINT uBricksRoughnessEvenness; | /* brick weathering factor */
COLORREF crMortarColor; | /* mortar color */
L_UINT uFlags; | /* flags */

Creates a brick texture that makes the image look like it has been drawn on a brick wall. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uBricksWidth | Flat area of the brick width, in pixels. Valid range is from 0 to the bitmap width.
uBricksHeight | Flat area of the brick height, in pixels. Valid range is from 0 to the bitmap height.
uOffsetX | The X distance between the bitmap origin and the first brick origin, in pixels.
uOffsetY | The Y distance between the bitmap origin and the first brick origin, in pixels.
uEdgeWidth | 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:
uMortarWidth | Mortar width, or the space between two adjacent bricks.
uShadeAngle | 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 range is from 0 to 360.
uRowDifference | 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.
uMortarRoughness | Mortar roughness. Valid range is from 0 to 300. At 0, the mortar looks completely smooth. Use higher values to increase the roughness.
uMortarRoughnessEvenness | Weathering factor for the mortar. Valid range is from 0 to 10. The higher the value the more weathered the mortar looks.
uBricksRoughness | Brick roughness. Valid range is from 0 to 300. At 0, the brick looks completely smooth. Use higher values to increase the roughness of the brick surface.
uBricksRoughnessEvenness | Weathering factor for the bricks. Valid range is from 0 to 10. The higher the value the more weathered the bricks look.
crMortarColor | The COLORREF value that specifies the mortar color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | Flags that determine 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 pBitmap as the source image. You can obtain the best result by applying this function 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 L_BricksTextureBitmap function. The following settings apply to all of the following figures:

Parameter | Value
uOffsetX | 0
uOffsetY | 0
uRowDifference | 35
uBricksWidth | 60
uBricksHeight | 20

If you were to use the following additional settings:

Parameter | Value
uMortarRoughness | 0
uMortarRoughnessEvenness | 0
uBricksRoughness | 0
uBricksRoughnessEvenness | 0
uFlags | 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 uBricksRoughness, which is set to 196:

In the following figure, uBricksRoughness remains set to 196 and in addition, uBricksRoughnessEvenness 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
uMortarRoughness | 0
uMortarRoughnessEvenness | 0
uBricksRoughness | 250
uBricksRoughnessEvenness | 4
uEdgeWidth | 7
uMortarWidth | 4

In the following figure the BRICKS_SMOOTHEDOUT flag is set:

In the following figure, the BRICKS_SMOOTHEDIN flag is set:

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EmbossBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap.
Topics: | Applying Artistic Effects
 | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT ("IMAGE3.CMP"), &LeadBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply the Bricks Texture effect to the image*/
L_BricksTextureBitmap(&LeadBitmap, 60, 20, 0, 0, 3, 4, 315, 33, 20, 0, 10, 0, 0, BRICKS_SMOOTHEDOUT);


L_BrowseDir

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BrowseDir( pszPath, pszFilter, pThumbOptions, bStopOnError, bIncludeSubDirs, bExpandMultipage, lSizeDisk, lSizeMem, pfnBrowseDirCB, pUserData)

L_TCHAR L_FAR * pszPath; | /* directory to browse */
L_TCHAR L_FAR * pszFilter; | /* file filter, ex *.jpg */
THUMBOPTIONS L_FAR *pThumbOptions; | /* pointer to a thumbnail options structure */
L_BOOL bStopOnError; | /* stop on error flag */
L_BOOL bIncludeSubDirs; | /* True/False to recurse sub directories */
L_BOOL bExpandMultipage; | /* True/False to expand multi-page files */
L_INT32 lSizeDisk; | /* maximum size of file to load */
L_INT32 lSizeMem; | /* maximum size of image to load */
BROWSEDIRCALLBACK pfnBrowseDirCB; | /* required callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Browses the specified directory for supported images, and generates thumbnails for each image file that is found.

Parameter | Description
pszPath | Character string containing the name of the directory to browse for images
pszFilter | Character string containing the file filter to use for browsing. Ex. *.jpg
pThumbOptions | Pointer to a structure containing the thumbnail creation options for the browser.
bStopOnError | Flag that indicates whether or not to stop generating thumbnails when an error occurs. Possible values are:
 | Value | Meaning
 | TRUE | Stop generating thumbnails if an error occurs.
 | FALSE | Do not stop generating thumbnails if an error occurs.
bIncludeSubDirs | Flag that indicates whether or not to recurse subdirectories when looking for files. Possible values are:
 | Value | Meaning
 | TRUE | Recurse subdirectories.
 | FALSE | Do not recurse subdirectories.
bExpandMultipage | Flag that indicates whether or not to expand multi-page files. If True, each page from a multi-page file will be loaded. Possible values are:
 | Value | Meaning
 | TRUE | Expand multi-page files, loading each page from a multi-page file.
 | FALSE | Do not expand multi-page files.
lSizeDisk | Maximum size of file to load. Use this to limit the size of images that the browse will attempt to load. Pass 0 for no limit.
lSizeMem | Maximum size of image in memory to load. Use this to limit the size of images that the browse will attempt to load. Pass 0 for no limit.
pfnBrowseDirCB | Callback function required for handling each of the generated thumbnails. You must specify a callback in order to process the thumbnails.The callback function must adhere to the function prototype described in BROWSEDIRCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs. To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to browse a directory for image files that LEADTOOLS supports. Each supported file that is found will be loaded, and a thumbnail will be generated for the image. In the callback function, you can process the thumbnail in any manner your application requires. For example, you can add the thumbnails to the LEADTOOLS ImageList Control.

If 0 is specified for either nThumbHeight or nThumbWidth, the image will not be resized. The whole image will be returned in the BROWSEDIRCALLBACK function.

If –1 is specified for either the nThumbHeight or nThumbWidth, the image will not be loaded at all. The BROWSEDIRCALLBACK function will be called for each file, but will only receive file information, not a valid image.

Libraries

win32 | ltkrn14n.dll (ltkrn_n.lib import library)
 | lttmb14n.dll (lttmb_n.lib import library)
 | ltimg14n.dll (ltimg_n.lib import library)
 | ltfil14n.dll (ltfil_n.lib import library)file format DLLs described in Files To Be Included With Your Application

Required DLLs and Libraries

LTIMG
LTFIL
LTTMB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreateThumbnailFromFile, L_LoadBitmap, L_GetCompressFileStamp,
 | L_SetExtFileOption, L_SetLoadResolution,
 | L_SetPCDResolution, L_SetWMFResolution,
 | BROWSEDIRCALLBACK For Vector files: L_2DGetViewMode L_2DSetViewMode,, L_2DGetViewPort , L_2DSetViewPort
Topics: | Thumbnail Browser

Example

/* this is the callback function for processing the thumbnails */
L_INT L_FAR L_EXPORT BrowseDirCallback(pBITMAPHANDLE pBitmap, L_TCHAR L_FAR *pszFile, pFILEINFO pInfo, L_INT nStatusCode, L_INT nPercent, L_VOID L_FAR *pUserData)
{
L_TCHAR buf[200];
L_INT nRet;

if(nStatusCode == SUCCESS)/* successful thumbnail generation */
{
/* Do something with the thumbnail, i.e. insert into ImageList Control */
/* ... */
}
else if(nStatusCode == BROWSE_LOADING)/* in the process of loading an image */
return SUCCESS;
else if(nStatusCode == BROWSE_SKIPPED)/* skipped a large file */
{
/* report error to user */
wsprintf(buf, TEXT("Skipped File: %s !"), pszFile);
MessageBox(NULL, buf, TEXT("Skipped"), MB_OK);
}
else/* error during thumbnail generation */
{
/* report error to user */
wsprintf(buf, TEXT("Error: %d - Generating Thumbnail!\n%s\nPress OK to Continue!"), nRet, pszFile);
if(MessageBox(NULL, buf, TEXT("Error"), MB_OKCANCEL|MB_ICONERROR) == IDCANCEL)
return(ERROR_USER_ABORT);
}

return SUCCESS;
}

L_VOID TestFunc(L_TCHAR L_FAR* pszDir)
{
L_INT nRet;
THUMBOPTIONS Opt;
memset(&Opt, 0, sizeof(THUMBOPTIONS));
Opt.uStructSize = sizeof(THUMBOPTIONS);
Opt.nWidth = 115; /* thumbnail width */
Opt.nHeight = 115; /* thumbnail height */
Opt.nBits = 24; /* 24-bit */
Opt.uCRFlags = 0; /* ignored, b/c we specified 24-bit */
Opt.bMaintainAspect = TRUE; /* maintain aspect when creating thumbnails */
Opt.bForceSize = FALSE; /* don't force size */
Opt.crBackColor = RGB(0,0,0); /* background color is ignored */
Opt.bLoadStamp = TRUE; /* try to load stamp if present in file */
Opt.bResample = TRUE; /* resample, for better quality thumbnails */
nRet = L_BrowseDir( pszDir,
TEXT("*.*"),
&Opt,
FALSE, /* don't stop on error */
FALSE, /* do not recurse subdirectories */
FALSE, /* do not expand multi-page files */
0, /* no limit on file size */
4000*1024,/* set limit on image size to 4MB */
(BROWSEDIRCALLBACK) BrowseDirCallback,/* callback */
NULL );/* no user data */
return;
}


L_BumpMapBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_BumpMapBitmap(pBitmapDst, pBumpBitmap, pBumpData)

pBITMAPHANDLE pBitmapDst; | /* pointer to the bitmap handle */
pBITMAPHANDLE pBumpBitmap; | /* pointer to the bitmap handle */
LPBUMPDATA pBumpData; | /* pointer to a structure */

Adds a three-dimensional texture pattern created by applying the bump image to the destination image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap. This bitmap will be updated by the function.
pBumpBitmap | Pointer to the bitmap handle referencing the Bump bitmap.
pBumpData | Pointer to a BUMPDATA structure that contains information about the bump parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image
 | Raster Image Functions: Correcting Colors

Example

BUMPDATA BumpData;
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */

/* Load each bitmap, at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("ULAY4.BMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

BumpData.uStructSize = sizeof(BUMPDATA);
BumpData.bTile = TRUE;
BumpData.nAzimuth = 5;
BumpData.nBright = 50;
BumpData.nIntensity = 0;
BumpData.nXDst = 0;
BumpData.nYDst = 0;
BumpData.nXOffset = 0;
BumpData.nYOffset = 0;
BumpData.uDepth = 3;
BumpData.uElevation = 0;
BumpData.pLut = NULL;
L_BumpMapBitmap(&LeadBitmap, &TmpBitmap, &BumpData);


L_CancelPlaybackWait

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CancelPlaybackWait(hPlayback)

HPLAYBACK hPlayback;

/* playback handle */

Cancels the wait for user input and any delay during an animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPlaybackDelay, L_CreatePlayback,
 | L_DestroyPlayback, L_ProcessPlayback,
 | L_ClearPlaybackUpdateRect, L_GetPlaybackIndex,
 | L_GetPlaybackState, L_GetPlaybackUpdateRect,
 | L_SetPlaybackIndex, L_AppendPlayback,
 | L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_AppendPlayback. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_CanvasBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CanvasBitmap(pBitmap, pThumbBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE pThumbBitmap; | /* pointer to the bitmap handle */
L_UINT uTransparency; | /* the transparency amount */
L_UINT uEmboss; | /* image intensity */
L_INT nXOffset; | /* the x distance */
L_INT nYOffset; | /* the y distance */
COLORREF uTilesOffset; | /* the amount of shifting */
L_UINT uFlags; | /* flags */

Combines two bitmaps, superimposing one bitmap on another bitmap that is used like a canvas. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap that will be applied to the canvas bitmap.
pThumbBitmap | Pointer to the bitmap handle that references the canvas bitmap.
uTransparency | The transparency amount between the image and the canvas. Valid range is from 0 to 100. When set to 0, only the canvas image displays, and when set to 100, the canvas image is barely visible.
uEmboss | Apparent depth of the canvas image. Valid range is from 0 to 200. When uTransparency is at 100, and uEmboss is 0 only the image displays. Increasing uEmboss increases the apparent depth of the canvas image.
nXOffset | The X distance between the canvas origin point and the image origin point (in pixels). Valid range is from –Canvas bitmap width to +Canvas bitmap width.
nYOffset | The Y distance between the canvas origin point and the image origin point (in pixels). Valid range is from –Canvas bitmap height to +Canvas bitmap height.
uTilesOffset | The amount to shift every row of canvas image from the origin. This parameter is not used when uFlags is set to CANVAS_FIT.
uFlags | Flags that identifiy 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 uTilesOffset.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_CanvasBitmap function 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 L_CanvasBitmap using the following values:

Parameter | Value
uTransparency | 90
uEmboss | 117
nXOffset | 0
nYOffset | 0
uFlags | CANVAS_SHIFT
uTilesOffset | 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 functions that allow you to combine images include:

L_BumpMapBitmap

L_CombineBitmap

L_CombineBitmapWarp

L_TextureAlphaBlendBitmap

L_UnderlayBitmap

For more information on this and other functions that can be used to combine bitmaps, refer to Processing an Image.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EmbossBitmap, L_AddShadowBitmap, L_AllocFTArray, L_BumpMapBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_CombineBitmap, L_CombineBitmapWarp, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_TextureAlphaBlendBitmap, L_UnderlayBitmap, L_UserFilterBitmap.
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
BITMAPHANDLE CanvasBitmap; /*Bitmap handle for the canvas image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT ("IMAGE3.CMP"), &LeadBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT ("ULAY1.bmp"), &CanvasBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply the Canvas bitmap effect to the image*/
L_CanvasBitmap(&LeadBitmap, &CanvasBitmap, 100, 100, 0, 0, 10, CANVAS_SHIFT);


L_ChangeBitmapCompression

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapCompression(pBitmap, nComp)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nComp; | /* compression type */

Compresses of decompresses a bitmap. This function is available only in Document/Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to compress or decompress.
nComp | Flag that indicates the type of compression to use on the bitmap. Possible values are:
 | Value | Meaning
 | COMP_NONE | [0] No compression. This option can be used to decompress compressed or super compressed bitmaps.
 | COMP_RLE | [1] 1-bit RLE compression. This compression is very fast and Lossless. For more information, refer to Speeding Up 1-Bit Documents. This is the same as passing TYPE_COMPRESSED to L_AllocateBitmap.
 | COMP_SUPER | [2] 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be used instead of L_ToggleBitmapCompression

Required DLLs and Libraries

LTKRN
LFCMP (for 24-bit Super compression)
LFFAX (for 1-bit Super compression)

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AllocateBitmap, L_CreateBitmap
Topics: | Super Compressed Bitmaps
 | Speeding up 1-Bit Documents
 | Raster Image Functions: Compression Functions

Example

/* This function toggles bitmap compression */
void ToggleCompression(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_TCHAR s[100];
if(pBitmap->BitsPerPixel == 1 || pBitmap->BitsPerPixel == 8 || pBitmap->BitsPerPixel == 24)
{
wsprintf(s, TEXT("BEFORE - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.SuperCompressed ? TEXT("SUPERCOMP") : TEXT("UNCOMP")));
MessageBox(hWnd, s, TEXT("ChangeBitmapCompression"), MB_OK);
if(L_ChangeBitmapCompression(pBitmap, pBitmap->Flags.SuperCompressed ? COMP_NONE : COMP_SUPER) == SUCCESS)
wsprintf(s, TEXT("AFTER - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.SuperCompressed ? TEXT("SUPERCOMP") : TEXT("UNCOMP")));
else
wsprintf(s, TEXT("L_ChangeBitmapCompression Failed"));
MessageBox(hWnd, s, TEXT("ChangeBitmapCompression"), MB_OK);
}
}


L_ChangeBitmapContrast

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapContrast(pBitmap, nChange)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nChange; | /* amount of contrast change */

Increases or decreases the contrast of the image in a bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
nChange | Amount of contrast change. Valid values are -1000 to +1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_DlgContrast , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_GammaCorrectBitmapExt

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and increases its contrast. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Increase the contrast by 25 percent of the possible range */
L_ChangeBitmapContrast(&LeadBitmap, 250 );


L_ChangeBitmapHeight

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapHeight(pBitmap, nHeight)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nHeight; | /* new height in pixels */

Increases or decreases the allocated height of a bitmap. You can use this function in a callback routine to adjust the allocation when loading an image of unknown height.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be adjusted.
nHeight | New height in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates the fields in the bitmap handle to reflect the change.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartFeedLoad, L_FeedLoad, L_StopFeedLoad
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

/* This FILEREADCALLBACK example uses L_ChangeBitmapHeight to ensure that the
final bitmap height is the same as the total number of loaded lines.
This can be especially useful when you are loading fax files and you don’t know how many
lines are in the file. Normally, you know the width of the raw fax files but not the height. So
you can start by allocating a small bitmap and increase its height while decoding the file. */
L_UINT TotalLines; /* Total number of loaded lines */
L_INT L_EXPORT EXT_CALLBACK LoadImageCB( pFILEINFO pFileInfo, pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData )
{
UNREFERENCED_PARAMETER(pFileInfo);
UNREFERENCED_PARAMETER(pBuffer);
UNREFERENCED_PARAMETER(uFlags);
UNREFERENCED_PARAMETER(nRow);
UNREFERENCED_PARAMETER(pUserData);
/* Increment the current row by the number of lines in the buffer */
TotalLines += nLines;
/* Set the bitmap height to the total number of lines */
L_AccessBitmap(pBitmap);
if( TotalLines > (L_UINT)pBitmap->Height )
{
L_ReleaseBitmap(pBitmap);
L_ChangeBitmapHeight(pBitmap, TotalLines );
L_AccessBitmap(pBitmap);
}
L_PutBitmapRow(pBitmap, pBuffer, nRow, pBitmap->BytesPerLine * nLines);
L_ReleaseBitmap(pBitmap);
return( SUCCESS );
}


L_ChangeBitmapHue

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapHue(pBitmap, nAngle)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* angular amount to change the hue, in degrees */

Changes the hue of colors in a bitmap by rotating the color wheel.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
nAngle | Angular amount to change the hue, in degrees.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap,
 | L_ChangeBitmapContrast, L_HistoContrastBitmap,
 | L_StretchBitmapIntensity, L_RemapBitmapIntensity,
 | L_InvertBitmap, L_ChangeBitmapSaturation,
 | L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor,
 | L_PutPixelColor, L_GetBitmapHistogram,
 | L_DlgHue , L_ChannelMix, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_SelectiveColorBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ContBrightIntBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and changes its hue. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Change each color to its complement */
L_ChangeBitmapHue(&LeadBitmap, 180 );


L_ChangeBitmapIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapIntensity(pBitmap, nChange)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nChange; | /* amount to change the intensity */

Changes the intensity (brightness) of the image in a bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.
nChange | Amount to change the intensity. The intensity ranges from -1000 to 1000. A positive value increases (or lightens) the brightness of the bitmap image. A negative values decreases (or darkens) the brightness of the bitmap image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GammaCorrectBitmap, L_ChangeBitmapContrast,
 | L_HistoContrastBitmap, L_StretchBitmapIntensity,
 | L_RemapBitmapIntensity, L_InvertBitmap,
 | L_ChangeBitmapHue, L_ChangeBitmapSaturation,
 | L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor,
 | L_PutPixelColor, L_GetBitmapHistogram,
 | L_DlgIntensityDetect , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a bitmap and increases its intensity. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Increase the brightness by 25 percent of the possible range */
L_ChangeBitmapIntensity(&LeadBitmap, 250 );


L_ChangeBitmapSaturation

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapSaturation(pBitmap, nChange)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nChange; | /* amount to change saturation */

Increases or decreases the saturation of colors in a bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
nChange | Amount to change saturation. Values are percentages between -1000 and +1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap,
 | L_ChangeBitmapContrast, L_HistoContrastBitmap,
 | L_StretchBitmapIntensity, L_RemapBitmapIntensity,
 | L_InvertBitmap, L_ChangeBitmapHue,
 | L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor,
 | L_PutPixelColor, L_GetBitmapHistogram,
 | L_DlgSaturation , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and increases its color saturation. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Increase the color saturation by 25 percent of the possible range */
L_ChangeBitmapSaturation(&LeadBitmap, 250 );


L_ChangeBitmapViewPerspective

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeBitmapViewPerspective(pDstBitmap, pSrcBitmap, uStructSize, ViewPerspective)

pBITMAPHANDLE pDstBitmap; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pDstBitmap */
L_INT ViewPerspective; | /* desired view perspective */

Rotates and flips the bitmap data as necessary to achieve the desired view perspective. The ViewPerspective field in the bitmap handle is changed, and thus, the display is unchanged.

Parameter | Description
pDstBitmap | Pointer to the bitmap handle referencing the converted bitmap data. Pass NULL to convert the source bitmap in place.
pSrcBitmap | Pointer to the bitmap handle referencing the bitmap to convert.
uStructSize | Size in bytes, of the structure pointed to by pDstBitmap, for versioning. Use sizeof(BITMAPHANDLE).
ViewPerspective | Desired view perspective. The following are possible values:
 | Constant | Meaning
 | TOP_LEFT | [0] Top-left of image is first in memory.
 | BOTTOM_LEFT180 | [1] (Document/Medical only) Same as TOP_RIGHT, which is BOTTOM_LEFT rotated clockwise by 180 degrees.
 | BOTTOM_LEFT | [2] Bottom-left of image is first in memory.
 | TOP_LEFT180 | [3] (Document/Medical only) Same as BOTTOM_RIGHT, which is TOP_LEFT rotated clockwise by 180 degrees.
 | RIGHT_TOP | [4] (Document/Medical only) First row is the right side, first column is top side.
 | TOP_LEFT90 | [4] (Document/Medical only) Same as RIGHT_TOP, which is TOP_LEFT rotated clockwise by 90 degrees.
 | LEFT_TOP | [5] (Document/Medical only) First row is the left side, first column is the top side
 | BOTTOM_LEFT90 | [5] (Document/Medical only) Same as LEFT_TOP, which is BOTTOM_LEFT rotated clockwise by 90 degrees
 | RIGHT_BOTTOM | [7] (Document/Medical only) First row is the right side, first column is the bottom side
 | BOTTOM_LEFT270 | [7] (Document/Medical only) Same as RIGHT_BOTTOM, which is BOTTOM_LEFT rotated clockwise by 270 degrees
 | LEFT_BOTTOM | [8] (Document/Medical only) First row is the left side, first column is top side.
 | TOP_LEFT270 | [8] (Document/Medical only) Same as LEFT_BOTTOM, which is TOP_LEFT rotated clockwise by 270 degrees.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to change the data and the ViewPerspective field in the bitmap handle. This function does not affect the image display. This can be used to simplify calculations that involve bitmap coordinates. For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PointFromBitmap, L_PointToBitmap,
 | L_RectFromBitmap, L_RectToBitmap,
 | L_RotateBitmapViewPerspective
Topics: | Accounting for View Perspective

Example

/* This example checks the ViewPerspective and if it is not TOP_LEFT, changes it */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */

L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
if ( LeadBitmap.ViewPerspective != TOP_LEFT)
L_ChangeBitmapViewPerspective ( NULL, &LeadBitmap, sizeof(BITMAPHANDLE), TOP_LEFT );


L_ChangeFromDDB

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeFromDDB(hDC, pBitmap, uStructSize, hBitmap, hPalette)

HDC hDC; | /* handle to the device responsible for the conversion */
pBITMAPHANDLE pBitmap; | /* address of the LEAD bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HBITMAP hBitmap; | /* handle to the DDB to be changed */
HPALETTE hPalette; | /* handle to the palette */

Changes a Windows device dependent bitmap (DDB) to a LEAD bitmap. This function results in only one copy of the bitmap, and it invalidates the DDB handle.

Parameter | Description
hDC | Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
pBitmap | Address of the LEAD bitmap handle.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hBitmap | Handle to the DDB to be changed.
hPalette | Handle to the palette. This value can be NULL if the hDC parameter refers to a device that is greater than 8 bits, or if the bitmap will use the system palette.

Returns

SUCCESS | The function was successful.
< 0 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare the LEAD bitmap handle, but you should not allocate the bitmap, because the new bitmap handle will point to the previous DDB data after the function is called. (If the bitmap is already allocated, you must free it.)

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB, L_ConvertToDDB, L_ConvertToDIB, L_ChangeFromDIB, L_ChangeToDDB, L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to L_ChangeToDDB.


L_ChangeFromDIB

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeFromDIB(pBitmap, uStructSize, hDIB)

pBITMAPHANDLE pBitmap; | /* address of the LEAD bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HGLOBAL hDIB; | /* DIB handle to be changed */

Changes a Windows device independent bitmap (DIB) to a LEAD bitmap. This function results in only one copy of the bitmap, and it invalidates the DIB handle.

Parameter | Description
pBitmap | Address of the LEAD bitmap handle.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hDIB | The DIB handle to be changed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare the LEAD bitmap handle, but you should not allocate the bitmap, because the new bitmap handle will point to the previous DIB data after the function is called. (If the bitmap is already allocated, you must free it.)

This function supports the standard DIB formats (BI_RGB and BI_BITFIELDS) as well as some FOURCC (Four Character Code) formats that some capture cards output.

These are the FOURCC that LEADTOOLS supports at the moment:

YVU9 (YUV9), I420 (YUV12), YUV2 , YV12 , IF09 , IYUV , UYVY , cyuv, YUY2, YVYU, Y41P, Y211, Y41T, Y42T

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB, L_ConvertToDDB, L_ConvertToDIB, L_ChangeFromDDB, L_ChangeToDDB, L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to L_ChangeToDIB.


L_ChangeFromEMF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeFromEMF(pBitmap, uStructSize, hWmf, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HENHMETAFILE hWmf; | /* handle to the EMF to be changed */
L_UINT uWidth; | /* width */
L_UINT uHeight; | /* height */

Changes a Windows enhanced metafile (EMF) into a LEAD Technologies bitmap and, if successful, frees the enhanced metafile.

Parameter | Description
pBitmap | Pointer to the bitmap to be updated with the changed file.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hWmf | Handle to the EMF to be changed.
uWidth | Amount by which to scale the enhanced metafile’s original width.
UHeight | Amount by which to scale the enhanced metafile’s original height.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If this function is successful, hWmf is freed.

The enhanced metafile can be loaded at the original dimension or scaled by using the uWidth and uHeight parameters.

If uWidth == 0 and uHeight == 0 - the enhanced metafile is loaded at the size present in the file

If uWidth == 0 and uHeight > 0 - the enhanced metafile is stretched so that it has the height uHeight (preserving the aspect ratio)

If uWidth > 0 and uHeight == 0 - the enhanced metafile is stretched so that it has the width uWidth (preserving the aspect ratio)

If uWidth > 0 and uHeight > 0 - the enhanced metafile is stretched so that it has the width uWidth and height uHeight (the aspect ratio is ignored)

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeToEMF, L_ChangeFromWMF,
 | L_ChangeToWMF, L_ConvertFromEMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

/* This example loads a bitmap, converts it to a EMF, then converts
the EMF back to a bitmap
Note that in this example, we didn't have to free the bitmap and the metafile,
like we did in ChangeEMFToLead
*/

void ChangeEMFToLead(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
BITMAPHANDLE Bitmap; /* Bitmap handle for the initial image */
HENHMETAFILE hEMF;

/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a EMF */
hEMF = L_ChangeToEMF( &Bitmap );

/* Convert the EMF to create a new LEAD bitmap and preserve the size */
L_ChangeFromEMF(pLeadBitmap, sizeof(BITMAPHANDLE), hEMF, 0, 0);
}


L_ChangeFromWMF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeFromWMF(pBitmap, uStructSize, hWmf, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HMETAFILE hWmf; | /* handle to the WMF to be converted */
L_UINT uWidth; | /* width */
L_UINT uHeight; | /* height */

Changes a Windows metafile (WMF) into a LEAD Technologies bitmap and, if successful, frees the metafile.

Parameter | Description
pBitmap | Pointer to the bitmap to be updated with the changed file.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hWMF | Handle to the WMF to be changed.
uWidth | Amount by which to scale the metafile’s original width.
UHeight | Amount by which to scale the metafile’s original height.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If this function is successful, hWmf is freed.

The metafile can be loaded at the original dimension or scaled by using the uWidth and uHeight parameters.

If uWidth == 0 and uHeight == 0 - the metafile is loaded at the size present in the file

If uWidth == 0 and uHeight > 0 - the metafile is stretched so that it has the height uHeight (preserving the aspect ratio)

If uWidth > 0 and uHeight == 0 - the metafile is stretched so that it has the width uWidth (preserving the aspect ratio)

If uWidth > 0 and uHeight > 0 - the metafile is stretched so that it has the width uWidth and height uHeight (the aspect ratio is ignored)

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeToEMF, L_ChangeFromEMF,
 | L_ChangeToWMF, L_ConvertFromEMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

/* This example loads a bitmap, converts it to a WMF, then converts
the WMF back to a bitmap
Note that in this example, we didn't have to free the bitmap and the metafile,
like we did in ChangeWMFToLead
*/

void ChangeWMFToLead(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
BITMAPHANDLE Bitmap; /* Bitmap handle for the initial image */
HMETAFILE hWmf;

/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a WMF */
hWmf = L_ChangeToWMF( &Bitmap );

/* Convert the WMF to create a new LEAD bitmap and preserve the size */
L_ChangeFromWMF(pLeadBitmap, sizeof(BITMAPHANDLE), hWmf, 0, 0);
}


L_ChangeHueSatIntBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChangeHueSatIntBitmap(pBitmap, nHue, nSaturation, nIntensity, pHsiData, uHsiDataCount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nHue; | /* angular amount to change the hue */
L_INT nSaturation; | /* amount to change saturation */
L_INT nIntensity; | /* amount to change the intensity */
LPHSIDATA pHsiData | /* pointer to array of HSIDATA structures */
L_UINT uHsiDataCount; | /* number of structures in pHsiData array */

Changes the hue, saturation and brightness of all or specified colors in the image.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nHue | Angular amount to change the hue, in hundredths of degrees. Valid values range from –18000 through 18000. This value is divided internally by 100.
nSaturation | 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).
nIntensity | 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.
pHsiData | Pointer to array of HSIDATA structures for each color range to be changed.
uHsiDataCount | Count of structures in the pHsiData array.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function combines the basic functionality found in the L_ChangeBitmapHue, L_ChangeBitmapSaturation, and L_ChangeBitmapIntensity functions. In addition, special options can be specified in the LPHSIDATA structure.

The pHsiData ->uStructSize must be set to sizeof(HSIDATA) before calling this function. For an array of structures, only the first structure in the array needs to have uStructSize member set.

To change the overall hue, saturation and intensity all at one time, pass NULL for the pHsiData and 0 for the uHsiDataCount in the main function. To adjust the parameters separately, or to make adjustments in successive passes, use the structures and pass 0 for the nHue, nSaturation, and nIntensity parameters in the main function.

For detailed information about using the ranges in the HSIDATA structure, refer to HSIDATA.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChangeBitmapHue, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HSIDATA HsiData; /*Color Range Information structure*/

/* Load a bitmap at 24 bits per pixel */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

/*Change bitmap hue, saturation, and brightness */
HsiData.uStructSize = sizeof(HSIDATA);
HsiData.nHue =18000;
HsiData.nSaturation = 0;
HsiData. nIntensity = 0;
HsiData.nOuterLow =315;
HsiData.nOuterHigh = 45;
HsiData.nInnerLow = 345;
HsiData.nInnerHigh = 15;
/* change the red color to green */
L_ChangeHueSatIntBitmap (&LeadBitmap, 0, 0, 0, &HsiData, 1);


L_ChangeToDDB

#include "l_bitmap.h"

HBITMAP EXT_FUNCTION L_ChangeToDDB(hDC, pBitmap)

HDC hDC; | /* handle to the device responsible for the conversion */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */

Changes a LEAD bitmap handle to a Windows Device Dependent Bitmap (DDB). This function results in only one copy of the bitmap, and it invalidates the LEAD bitmap handle.

Parameter | Description
hDC | Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.

Returns

>0 | HBITMAP.
0 | An error occurred.

Comments

If you want to load another image using the same bitmap handle, you must initialize the bitmap handle again.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB,
 | L_ConvertToDDB, L_ConvertToDIB,
 | L_ChangeFromDDB, L_ChangeFromDIB,
 | L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

/* This example loads a bitmap, changes it to a DDB, then changes
the DDB back to a bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
HBITMAP hDDB; /* Handle for the DDB */
HPALETTE hPalette; /* Palette handle */
HDC hDC; /* Handle to the device context for the current window */
/* Get the device context for the current window */
hDC = GetDC( hWnd );
/* Load a bitmap at 8 bits per pixel so that we can demonstrate palette handling */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);
/* Duplicate the palette */
hPalette = L_DupBitmapPalette(&TmpBitmap);
/* Change the initial bitmap to a DDB */
hDDB = L_ChangeToDDB( hDC, &TmpBitmap );
/* Change the DDB to a new LEAD bitmap */
L_ChangeFromDDB(hDC, &LeadBitmap, sizeof(BITMAPHANDLE), hDDB, hPalette);
/* Clean up */
ReleaseDC( hWnd, hDC );
DeleteObject(hPalette);
return;
}


L_ChangeToDIB

#include "l_bitmap.h"

HGLOBAL EXT_FUNCTION L_ChangeToDIB(pBitmap, uType)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
L_UINT uType; | /* type of DIB */

Changes a LEAD bitmap handle to a Windows Device Independent Bitmap (DIB). This function results in only one copy of the bitmap, and it invalidates the LEAD bitmap handle. The DIB will have a BITMAPINFOHEADER, a BITMAPV4HEADER, or a BITMAPV5HEADER depending on the uType argument.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.
uType | Type of DIB to create. Possible values are:
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)

Returns

>0 | Global memory handle to DIB.
0 | An error occurred.

Comments

The orientation of the image and color order will depend on how the image was loaded into the LEAD bitmap.

A DIB consists of one of the following:

a BITMAPFILEHEADER,

a BITMAPV4HEADER (introduced in Windows 95 and Windows NT 4.0),

or a 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 uType flag.

The orientation of the image and color order will depend on how the image was loaded into the LEAD bitmap.

If you want to load another image using the same bitmap handle, you must initialize the bitmap handle again.

When you no longer need the DIB, you can free it using the Windows GlobalFree function.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB, L_ConvertToDDB, L_ConvertToDIB, L_ChangeFromDDB, L_ChangeFromDIB, L_ChangeToDDB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

//This example takes a LEAD bitmap, changes it to a V5 DIB and writes
//out the DIB as a bitmap file
#include <io.h>
#include <fcntl.h>

int MySaveFile(HGLOBAL hDIB, L_TCHAR L_FAR* pszFileName)
{
int fp, nSize;
unsigned char *pDIB;
BITMAPFILEHEADER bfh;
PBITMAPINFOHEADER pbih;
int nDIBsize;

nDIBsize = GlobalSize(hDIB);

bfh.bfType = 0x4d42; //"BM";
bfh.bfSize = sizeof(BITMAPFILEHEADER) + nDIBsize;
bfh.bfReserved1 = 0;
bfh.bfReserved2 = 0;

pDIB = (L_UCHAR *)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);

#ifdef UNICODE

fp = _wopen(pszFileName, _O_RDWR | _O_CREAT | _O_BINARY, 0);//_S_IREAD | _S_IWRITE );
#else

fp = _open(pszFileName, _O_RDWR | _O_CREAT | _O_BINARY, 0);//_S_IREAD | _S_IWRITE );

#endif
if (fp == 0)
return FALSE;

nSize = _write( fp, &bfh, sizeof(BITMAPFILEHEADER));
nSize = _write( fp, pDIB, nDIBsize);
_close(fp);

GlobalUnlock(hDIB);
return TRUE;
}

L_VOID ExampleChangeToDIB(pBITMAPHANDLE pBitmap, L_TCHAR L_FAR* pszFileName)
{
HGLOBAL hDIB;
hDIB = L_ChangeToDIB(pBitmap, sizeof(BITMAPHANDLE));

//At this point, the original pBitmap is now invalid
MySaveFile(hDIB, TEXT("e:\\erase\\dib2.bmp"));
GlobalFree(hDIB);
}


L_ChangeToEMF

#include "l_bitmap.h"

HENHMETAFILE EXT_FUNCTION L_ChangeToEMF(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to a bitmap */

Changes a LEAD Technologies bitmap into a Windows enhanced metafile (EMF) and, if successful, frees the bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy.

Returns

This function will return a handle to an enhanced metafile.

Comments

If this function is successful, pBitmap is freed.

This function allocates an enhanced metafile bitmap and copies the LEAD bitmap to the enhanced metafile.

When you no longer need the enhanced metafile, you can free it using the Windows DeleteEnhMetaFile function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToWMF, L_ConvertFromEMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

For an example, refer to L_ChangeFromEMF.


L_ChangeToWMF

#include "l_bitmap.h"

HMETAFILE EXT_FUNCTION L_ChangeToWMF(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to a bitmap */

Changes a LEAD Technologies bitmap into a Windows metafile (WMF) and, if successful, frees the bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy.

Returns

This function will return a handle to a Metafile.

Comments

If this function is successful, pBitmap is freed.

This function allocates a Metafile bitmap and copies the LEAD bitmap to the Metafile.

When you no longer need the Metafile, you can free it using the Windows DeleteMetaFile function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToEMF, L_ConvertFromEMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

For an example, refer to L_ChangeFromWMF.


L_ChannelMix

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ChannelMix(pBitmap, pRedFactor, pGreenFactor, pBlueFactor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORDATA L_FAR *pRedFactor; | /* pointer to a structure */
COLORDATA L_FAR *pGreenFactor; | /* pointer to a structure */
COLORDATA L_FAR * pBlueFactor; | /* pointer to a structure */

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap which will undergo color redistribution.
pRedFactor | Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's red values.
pGreenFactor | Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's green values.
pBlueFactor | Pointer to a COLORDATA structure that contains the values to use for redistributing the bitmap's blue values.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to rebalance the colors in a bitmap. It can be used to make color adjustments and corrections.

This function 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ConvertToColoredGray, L_BalanceColors, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and then applies the L_ChannelMix function to it: */

BITMAPHANDLE Bitmap;
COLORDATA RedFact, GreenFact, BlueFact;

L_LoadBitmap(TEXT("IMAGE1.CMP"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

RedFact.uStructSize = sizeof(COLORDATA);
RedFact.nRedFactor = 50;
RedFact.nGreenFactor = 0;
RedFact.nBlueFactor = 0;
RedFact.nConstant = 0;

GreenFact.uStructSize = sizeof(COLORDATA);
GreenFact.nRedFactor = 100;
GreenFact.nGreenFactor = 100;
GreenFact.nBlueFactor = 0;
GreenFact.nConstant = 0;

BlueFact.uStructSize = sizeof(COLORDATA);
BlueFact.nRedFactor = 0;
BlueFact.nGreenFactor = 0;
BlueFact.nBlueFactor = 100;
BlueFact.nConstant = 0;

L_ChannelMix(&Bitmap,&RedFact,&GreenFact,&BlueFact);


L_ClearBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ClearBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Sets all bits to 0 in the specified bitmap, making it a black bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to clear.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_GetBitmapRow,
 | L_PutBitmapRow, L_GetBitmapRowCol,
 | L_PutBitmapRowCol, L_GetPixelColor,
 | L_PutPixelColor, L_ClearNegativePixels
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For complete sample code, refer to the COMPCB example.

/* This example loads a bitmap and clears it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Clear the bitmap */
L_ClearBitmap(&LeadBitmap);


L_ClearNegativePixels

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ClearNegativePixels(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Sets all pixels with negative color values to 0.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that holds the image data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If ELO_SIGNED flag has been set using LOADFILEOPTION, when a file is loaded, the bitmap may contain negative pixel values and LEADTOOLS will paint/process the image incorrectly. In order to use this bitmap correctly, you must call L_ClearNegativePixels. If the ELO_SIGNED flag has not been set, all negative pixels are cleared internally, during the load process. Since some TIFF files are saved with negative values for pixel colors, you should call L_ClearNegativePixels if, after loading a bitmap, pBitmap->Flags.Signed is TRUE.

L_ClearNegativePixels does nothing if Flags.Signed is not set.

PROGRAMMING TIP: call L_ClearNegativePixels right after L_LoadBitmap.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmap, L_ClearBitmap
Topics | Raster Image Functions: Getting and Setting Pixel Values

Example

This example sets the ELO_SIGNED flag in LOADFILEOPTION, loads a tif file and clears the negative pixels.

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, &LoadFileOption, NULL);

/* clear negative pixels if signed */
if(LeadBitmap.Flags.Signed)
L_ClearNegativePixels(&LeadBitmap);


L_ClearPlaybackUpdateRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ClearPlaybackUpdateRect(hPlayback)

HPLAYBACK hPlayback;

/* playback handle */

Clears the update rectangle used for an animation playback, leaving an empty rectangle.

Parameter | Description
hPlayback | Handle that references the animation playback.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback,
 | L_GetPlaybackDelay, L_CancelPlaybackWait,
 | L_ProcessPlayback, L_GetPlaybackIndex,
 | L_GetPlaybackState, L_GetPlaybackUpdateRect,
 | L_SetPlaybackIndex, L_AppendPlayback,
 | L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/* This example uses L_ClearPlaybackUpdateRect to avoid painting odd numbered bitmaps. */
void TestPlayback(HWND hWnd, pBITMAPHANDLE pTargetBitmap, HBITMAPLIST hList)
{
HPALETTE hpalPaint = NULL; /* Paint palette handle */
HPLAYBACK hPlayback; /* Animation playback */
L_UINT uState; /* Next state in the playback */
RECT rcUpdate; /* Source clipping rectangle used in playback */
RECT rcDisplay; /* Display rectangle used in playback */
HDC hdc; /* Device context of the current window */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
L_UINT uIndex = 0; /* Current index to the bitmap list */
/* Use the client area as the display rectangle */
GetClientRect(hWnd,&rcDisplay);
/* Create and run the playback */
L_CreatePlayback(&hPlayback, pTargetBitmap, hList);
do
{
L_ProcessPlayback(hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_POSTRENDER:
L_GetPlaybackIndex(hPlayback, (L_INT L_FAR *)&uIndex);
if(uIndex % 2)
L_ClearPlaybackUpdateRect(hPlayback);
L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE);
hdc = GetDC(hWnd);
if (hpalPaint)
{
hPalette = SelectPalette (hdc, hpalPaint, TRUE);
RealizePalette(hdc);
}
L_PaintDC(hdc, pTargetBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY);
if (hpalPaint)
SelectPalette (hdc, hPalette, TRUE);
ReleaseDC(hWnd, hdc);
break;
}
} while(uState != PLAYSTATE_END);
/* Clean up */
L_DestroyPlayback(hPlayback, NULL);
}


L_ClipboardReady

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_ClipboardReady(L_VOID)

Determines whether the Windows clipboard contains an image that can be copied using the L_CopyFromClipboard function.

Returns

TRUE | The clipboard contains an image that can be copied.
FALSE | The clipboard does not contain an image that can be copied.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyFromClipboard, L_CopyToClipboard,
 | L_CopyToClipboard
Topics: | Using DIBs, DDBs, and the Clipboard

Example

For a short example, refer to L_CopyFromClipboard. For complete sample code, refer to the FRAME.C module of the DEMO example.


L_CloudsBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CloudsBitmap(pBitmap, uSeed, uFrequency, uDensity, uOpacity, crBackColor, crCloudsColor, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uSeed; | /* randomization factor */
L_UINT uFrequency; | /* number of clouds */
L_UINT uDensity; | /* cloud density */
L_UINT uOpacity; | /* transparency percentage */
COLORREF crBackColor; | /* background color */
COLORREF crCloudsColor; | /* cloud's color */
L_UINT uFlag; | /* flags */

Applies cloud effects to a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uSeed | Seed value that controls the cloud creation process. Possible values are those values that are 0 or greater.
uFrequency | Value that controls the number of clouds inside the image. Valid values are 0 or greater.
uDensity | 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.
uOpacity | Value that indicates the transparency, in percent, between the cloud's image and the original image. Possible values range from 0 to 100. This parameter is used if the CLD_OPACITY or CLD_DIFFERENCE flag is set. A value of 0 indicates that no clouds are being used and a value of 100 represents a mix of clouds and image.
crBackColor | The COLORREF value that specifies the fill color for the areas outside the cloud. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crCloudsColor | The COLORREF value that specifies the fill color for the cloud. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlag | Flag that specifies how to apply the effect. 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 uOpacity value.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uSeed 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 uSeed parameter. Each uSeed parameter value produces a different cloud effect from the other uSeed 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
uFrequency | 16
uDensity | 1
crBackColor | Black
crCloudsColor | White
uSeed | 0
Flags | CLD_PURE

This figure was obtained by using the following settings:

Parameter | Value
uFrequency | 1
uDensity | 16
crBackColor | Black
crCloudsColor | White
uSeed | 0
Flags | CLD_PURE

The following two figures show the effects of the function using the CLD_OPACITY flag. If you use the following image

and call this function using the following values:

Parameter | Value
uFrequency | 16
uDensity | 16
crBackColor | Black
crCloudsColor | White
uSeed | 0
Flags | CLD_OPACITY
uOpacity | 50

The following figure results:

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Use this function in order to use Perlin equations to generate pseudo-random noise, and then procedurally transform that noise into a cloud-like texture. This function applies equations to the Perlin noise that are different than those used by the L_PerlinBitmap function.

Use the L_AddBitmapNoise function in order to add random noise to a bitmap.

Use the L_PerlinBitmap function to use a pseudo-random number generator in order to create a Perlin noise, and then procedurally transform that noise into a texture. Depending 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 L_PerlinBitmap function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

/*Apply the difference clouds effect, with white background and black foreground clouds*/
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap TEXT("Image1.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
L_CloudsBitmap(&LeadBitmap, 1000, 4, 10, 10, RGB(255,255,255), RGB(0,0,0), CLD_DIFFERENCE);


L_ColorBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorBitmapRgn(hDC, pBitmap, pXForm, crRgnColor)

HDC hDC; | /* handle to the device context for display */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */
COLORREF crRgnColor; | /* color value */

Highlights a region by displaying a filled, color representation of the region.

Parameter | Description
hDC | Handle to a device context where the image is displayed and where the frame is to appear.
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
crRgnColor | Color value to 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)

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is particularly useful when displaying regions with black and white images. All black pixels in a region are displayed with color crRgnColor, and all white pixels are displayed ~(crRgnColor). For example, suppose that crRgnColor is light green (BGR 0x80FF40). All black pixels in the region are displayed as crRgnColor. All white pixels in the region are displayed as 0xFFFFFF XOR 0x80FF40 = 0x7F00BF, which is purple.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn()
Topics: | Raster Image Functions: Displaying Images
 | Defining and Using a Bitmap Region
 | Using Color Values in LEADTOOLS

Example

//The following should be part of the WM_PAINT processing
L_VOID ColorRegionExample(HWND hWnd, pBITMAPHANDLE pBitmap)
{
HDC hdcDraw;
COLORREF crRgnColor = RGB(255,0,0);

if(L_BitmapHasRgn(pBitmap))
{
hdcDraw = GetDC(hWnd);
L_ColorBitmapRgn(hdcDraw, pBitmap, NULL, crRgnColor);
ReleaseDC(hWnd, hdcDraw);
}
}


L_ColoredBallsBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColoredBallsBitmap(pBitmap, uNumBalls, uSize, uSizeVariation, nHighLightAng, crHighLight, crBkgColor, crShadingColor, pBallColors, uNumOfBallColors, uAvrBallClrOpacity, uBallClrOpacityVariation, uRipple, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uNumBalls; | /* number of balls */
L_UINT uSize; | /* average ball size */
L_UINT uSizeVariation; | /* ball size variation */
L_INT nHighLightAng; | /* light source direction of the highlight on the ball */
COLORREF crHighLight; | /* highlight color on the ball */
COLORREF crBkgColor; | /* background color */
COLORREF crShadingColor; | /* gradient color of the background */
COLORREF L_FAR * pBallColors | /* pointer to an array of ball colors */
L_UINT uNumOfBallColors; | /* size of the ball color array */
L_UINT uAvrBallClrOpacity; | /* ball color opacity */
L_UINT uBallClrOpacityVariation; | /* ball color opacity variation */
L_UINT uRipple; | /* gradient frequency */
L_UINT uFlags; | /* flags */

This function adds colored balls to the bitmap. Various parameters control the color and appearance of the balls. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uNumBalls | Number of balls that will be drawn in the image.
uSize | Average ball size, in pixels.
uSizeVariation | 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.
nHighLightAng | 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. Possible values range from –36000 to + 36000.
crHighLight | Highlight color.
crBkgColor | Background color.
crShadingColor | Shade (or gradient) color.
pBallColors | Pointer to an array of ball colors.
uNumOfBallColors | The number of ball colors.
uAvrBallClrOpacity | Average ball color opacity. Valid values range from 0 to 255 for 8-bit , 0 to 4095 for 12-bit and 0 to 65535 for 16-bit.
uBallClrOpacityVariation | 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 uAvrBallClrOpacity.
uRipple | The number of shades that are used to produce the background. This value is divided internally by 100. For example, if uRipple = 200 the actual frequency is 2. This value is ignored if the CLRBALLS_SHADING_SINGLE flag is set.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_ColoredBallsBitmap function using the following values:

Parameter | Value
uNumBalls | 500
uSize | 10
uSizeVariation | 90
nHighLightAng | 315
crHighLight | White
crBkgColor | Blue
crShadingColor | Black
uAvrBallClrOpacity | 0
uBallClrOpacityVariation | 0
uRipple | 4250
uFlags | CLRBALLS_SHADING_TOPBOTTOM | CLRBALLS_STICKER | CLRBALLS_IMAGE | CLRBALLS_ BALLCLR_OPACITY

The following figure will result:

As another example, if you call the function using the following settings:

Parameter | Value
uNumBalls | 1500
uSize | 4
uSizeVariation | 0
nHighLightAng | 315
crHighLight | White
crBkgColor | Blue
crShadingColor | Black
uAvrBallClrOpacity | 108
uBallClrOpacityVariation | 13
uRipple | 1000
uFlags | 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:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_DrawStarBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

/* The following example loads a bitmap, and applies the colored ball effect: */
BITMAPHANDLE LeadBitmap;
COLORREF pBallColors[7];
pBallColors[0] = RGB(230,50,50);
pBallColors[1] = RGB(230,200,160);
pBallColors[2] = RGB(255,255,128);
pBallColors[3] = RGB(240,50,100);
pBallColors[4] = RGB(255,255,180);
pBallColors[5] = RGB(170,240,100);
pBallColors[6] = RGB(255,255,255);
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR,
NULL, NULL);

/*Apply the effect*/
L_ColoredBallsBitmap(&LeadBitmap, 1000, 25, 15, 31500, RGB(255,255,255),
RGB(255,0,0), RGB(255,255,0), pBallColors, 7, 64, 10, 100,
CLRBALLS_SHADING_CIRCULAR|CLRBALLS_STICKER|
CLRBALLS_IMAGE|CLRBALLS_BALLCLR_OPACITY);


L_ColoredPencilBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColoredPencilBitmap(pBitmap, uRatio, uDim);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uRatio; | /* color adjustment percentage */
L_UINT uDim; | /* size of the pencil coloring neighborhood */

Applies an effect to a bitmap that makes it look like it has been drawn with colored pencils. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uRatio | 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.
uDim | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_ColoredPencilBitmap function using the following values:

Parameter | Value
uRatio | 90
uDim | 3

The following figure will result:

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ImpressionistBitmap, L_DryBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Applying Artistic Effects

Example

/* The following example loads a bitmap and applies the colored pencil effect: */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */

L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* pencil color the bitmap with Ratio value of 50 and with a neighborhood of 3x3 pixels*/
L_ColoredPencilBitmap(&LeadBitmap, 50, 3);


L_ColorHalfToneBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorHalfToneBitmap(pBitmap, uMaxRad, nCyanAngle, nMagentaAngle, nYellowAngle, nBlackAngle)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uMaxRad; | /* maximum dot size */
L_INT nCyanAngle; | /* cyan screen angle */
L_INT nMagentaAngle; | /* magenta screen angle */
L_INT nYellowAngle; | /* yellow screen angle */
L_INT nBlackAngle; | /* black screen angle */

Creates an enlarged halftone screen for each image channel. This function is available only in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uMaxRad | Maximum dot (i.e. circle) size, in pixels. This value should not be less than 5.
nCyanAngle | 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.
nMagentaAngle | 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.
nYellowAngle | 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.
nBlackAngle | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_ColorHalfToneBitmap using the following values:

Parameter | Value
uMaxRad | 8
nCyanAngle | 108
nMagentaAngle | 163
nYellowAngle | 90
nBlackAngle | 45

The following figure results:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DefaultDithering, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_HalfToneBitmap, L_ColorSeparateBitmap, L_ColorMergeBitmap, L_DesaturateBitmap, L_HalfTonePatternBitmap, L_GetBitmapStatisticsInfo, L_GetBitmapHistogram, L_GetBitmapColorCount, L_GetBitmapColors, L_GetMinMaxBits, L_GetMinMaxVal, L_ConvertToColoredGray, L_ColorizeGrayBitmap, L_GetBitmapAlpha, L_ShiftBitmapData, L_SelectBitmapData, L_AnnSetAutoHilightPen, L_AnnSetAutoCursor, L_GetBitmapHistogramGray, L_IsGrayScaleBitmap, L_WindowLevel, L_WindowLevelBitmap, L_WindowLevelFillLUT
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and applies the color halftone filter to it*/

BITMAPHANDLE LeadBitmap;
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/*Apply the filter*/
L_ColorHalfToneBitmap(&LeadBitmap, 15, 10800, 16200, 9000,4500);


L_ColorIntensityBalance

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorIntensityBalance(pBitmap, pShadows, pMidTone, pHighLight, bLuminance)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPBALANCEDATA pShadows; | /* pointer to Shadows information */
LPBALANCEDATA pMidTone; | /* pointer to Midtones information */
LPBALANCEDATA pHighLight; | /* pointer to Highlights information */
L_BOOL bLuminance; | /* value that indicates whether to preserve luminance */

Changes the distribution of the red, green, or blue channels. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pShadows | Pointer to structure used to adjust the dark tones.
pMidTone | Pointer to structure used to adjust the medium tones (midtones).
pHighLight | Pointer to structure used to adjust the bright tones (highlights).
bLuminance | Value that indicates whether to preserve luminance. Possible values are:
 | Value | Meaning
 | TRUE | Preserve luminance.
 | FALSE | Do not preserve luminance.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 BALANCEDATA structures. Positive values from BALANCEDATA for a component cause that particular component to become brighter, whereas negative values cause the component to become darker. A value of 0 leaves the component unchanged.

The preserve luminance option aims to minimize the luminance change in the image.

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 Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback .

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ConvertToColoredGray, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap. L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_SelectiveColorBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
BALANCEDATA Shadows;
BALANCEDATA MidTone;
BALANCEDATA HighLight;

Shadows.uStructSize = sizeof(BALANCEDATA);
Shadows.nRed = 60;
Shadows.nGreen = 0;
Shadows.nBlue = 0;

MidTone.uStructSize = sizeof(BALANCEDATA);
MidTone.nRed = 40;
MidTone.nGreen = 0;
MidTone.nBlue = 0;

HighLight.uStructSize = sizeof(BALANCEDATA);
HighLight.nRed = 70;
HighLight.nGreen = 0;
HighLight.nBlue = 0;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Balance the colors by increasing the red channel values */
L_ColorIntensityBalance(&LeadBitmap, &Shadows, &MidTone, &HighLight,
FALSE);


L_ColorizeGrayBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorizeGrayBitmap (pDstBitmap, pSrcBitmap, pGrayColors, uCount)

pBITMAPHANDLE pDstBitmap; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
pGRAYCOLOR pGrayColors; | /* pointer to an array of structures */
L_UINT uCount; | /* number of elements in the pGrayColors array */

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. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pDstBitmap | Pointer to the destination bitmap that will contain the result of the function. The user should free the bitmap before passing it to the function.
pSrcBitmap | Pointer to the bitmap handle referencing the 8, 12 or 16-bit grayscale bitmap. pSrcBitmap will not be affected.
pGrayColors | Pointer to an array of GRAYCOLOR structures. The user specifies number of entries of the array. You can automatically color the bitmap by passing NULL value in this variable (in this case uCount will be ignored).
uCount | Number of entries in pGrayColors array. It can be any number as long as it represents pGrayColors correctly. 1 means there is one entry, 2 means there is two entries. If you set it as 0 then the function will return an error code.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function can be used as a visualization aid. More precisely, this function can be used to show variations in a bitmap’s intensity values.

This function colors the grayscale bitmap by converting specified ranges of grayscale intensities into corresponding RGB values. Use the pGrayColors variable to set the intensity ranges and the RGB values.

Using this function 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.

The pDstBitmap is assumed to be uninitialized. If pDstBitmap contains a bitmap, you should free it prior to calling this function. The function will allocate and store a 24-bit bitmap in pDstBitmap.

If you pass NULL in the pGrayColors variable then the function 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 uCount variable will be ignored if pGrayColors is NULL.

You do not have to fill uStructSize for all the elements of the pGrayColors array. You only need to fill uStructSize for the first element in the pGrayColors array.

The sample below shows you how to color a 16-bit grayscale bitmap using pGrayColors.

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 uThreshold value is ignored for the last entry in the pGrayColors array.)

For more information on filling the pGrayColors array to obtain this result, refer to the example.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowLevel, L_WindowLevelBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_ShiftBitmapData, L_SelectBitmapData, GRAYCOLOR, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Removing Noise
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a 16-bit grayscale bitmap and then colors it. */ BITMAPHANDLE GrayBitmap; /* Bitmap handle to hold the source grayscale image. */ BITMAPHANDLE ColorBitmap; /* Bitmap handle to hold the destination color bitmap. */ pGRAYCOLOR pGrayColors;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &GrayBitmap, 0, sizeof(BITMAPHANDLE), ORDER_BGRORGRAY, NULL, NULL);

pGrayColors = (pGRAYCOLOR) malloc (sizeof(GRAYCOLOR) * 6);

pGrayColors[0].uStructSize = sizeof(GRAYCOLOR);
pGrayColors[0].uThreshold = 9999;
pGrayColors[0].crColor.rgbRed = 255;
pGrayColors[0].crColor.rgbGreen = 0;
pGrayColors[0].crColor.rgbBlue = 0;

pGrayColors[1].uThreshold = 19999;
pGrayColors[1].crColor.rgbRed = 0;
pGrayColors[1].crColor.rgbGreen = 255;
pGrayColors[1].crColor.rgbBlue = 0;

pGrayColors[2].uThreshold = 29999;
pGrayColors[2].crColor.rgbRed = 0;
pGrayColors[2].crColor.rgbGreen = 0;
pGrayColors[2].crColor.rgbBlue = 255;

pGrayColors[3].uThreshold = 39999;
pGrayColors[3].crColor.rgbRed = 0;
pGrayColors[3].crColor.rgbGreen = 255;
pGrayColors[3].crColor.rgbBlue = 255;

pGrayColors[4].uThreshold = 49999;
pGrayColors[4].crColor.rgbRed = 255;
pGrayColors[4].crColor.rgbGreen = 0;
pGrayColors[4].crColor.rgbBlue = 255;

pGrayColors[5].uThreshold = 59999; // This value will be ignored
pGrayColors[5].crColor.rgbRed = 255;
pGrayColors[5].crColor.rgbGreen = 255;
pGrayColors[5].crColor.rgbBlue = 0;

// Call the function
L_ColorizeGrayBitmap (&ColorBitmap, &GrayBitmap, pGrayColors, 6);

free (pGrayColors);

L_FreeBitmap (&GrayBitmap);

// Now we have the resulting image in color


L_ColorLevelBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorLevelBitmap(pBitmap, pLvlClr, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pLVLCLR pLvlClr; | /* pointer to a LVLCLR structure */
L_UINT uFlags; | /* a flag that indicates the channel being color leveled */

Applies color leveling to an image. It changes the image shadows, midtones and highlights. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
pLvlClr | Pointer to a LVLCLR structure that contains several LVLCLRINF structures, which in turn contain information on the shadows, midtones and highlights for the Red, Green, Blue and Master channels.
uFlags | 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

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before you call the L_ColorLevelBitmap function, you need to initialize the size and all remaining fields of the LVLCLRINF structures within the LVLCLR structure. These fields tell L_ColorLevelBitmap 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 uMinInput, uMaxInput, uMinOutput, uMaxOutput, and uGamma members of the LVLCLRINF structure contained in the pLvlClr parameter.

The uMinInput member of an LVLCLRINF structure defines what the function interprets as shadows for that color channel. Any value less than or equal to uMinInput is considered a shadow.

The uMaxInput member of an LVLCLRINF structure defines what the function interprets as highlights for that color channel. Any value greater than or equal to uMaxInput is considered a highlight.

The value of the uMaxInput member must be greater than the value of the uMinInput member by at least 2.

Midtones are those values between uMinInput and uMaxInput.

The uMinOutput member is the value to which the shadows will be mapped.

The uMaxOutput member is the value to which the highlights will be mapped.

The uGamma member is used to modify the midtone values

If only LEVEL_MASTER is set in uFlags then the rest of the channels will still be affected.

If the image is a grayscale image, then you must set LEVEL_MASTER in uFlags, otherwise the function will not have any effect.

If uMinOutput > uMaxOutput then the bitmap’s shadows and highlights will be inverted.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 image has a region, the effect will be applied on the region only.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgColor , L_WindowLevel, L_AutoColorLevelBitmap, L_SelectiveColorBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Correcting Colors
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies image leveling to it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LVLCLR lvlClr;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

lvlClr.uStructSize = sizeof(LVLCLR);
/* Specify Image levels */
lvlClr.blue.uMinInput = 20;
lvlClr.blue.uMaxInput = 200;
lvlClr.blue.uMinOutput = 0;
lvlClr.blue.uMaxOutput = 255;
lvlClr.blue.uGamma = DEFAULT_GAMMA;

// Master will cause the image to be Inversed
lvlClr.master.uMinInput = 0;
lvlClr.master.uMaxInput = 255;
lvlClr.master.uMinOutput = 255;
lvlClr.master.uMaxOutput = 0;
lvlClr.master.uGamma = DEFAULT_GAMMA;

/* Level the Blue and Master channels */
L_ColorLevelBitmap (&LeadBitmap, &lvlClr, LEVEL_BLUE | LEVEL_MASTER);


L_ColorMergeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorMergeBitmap(pBitmap, ppBitmap, uStructSize, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE L_FAR * ppBitmap; | /* bitmaps to be merged */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_UINT32 uFlags; | /* type of separation */

Creates a color bitmap by merging grayscale bitmaps that were created as color separations. You can use this to recombine the bitmaps that the L_ColorSeparateBitmap function creates.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
ppBitmap | An array of pointers to the bitmap handles referencing the bitmaps to be merged.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
 | The pointers in the array should be in the appropriate order, which in most cases is the order of the letters in the name. For example, for CMY separation, the first pointer should be for the cyan plane, the second for magenta, and the third for yellow. The only exception is RGB, which should be in BGR (blue, green, red) order.
uFlags | The type of separation that was used to create the grayscale images. Valid values are:
 | Value | Meaning
 | COLORSEP_RGB | [0x00] Merge images from three RGB planes.
 | COLORSEP_CMYK | [0x01] Merge images from four CMYK planes.
 | COLORSEP_CMY | [0x04] Merge images from three CMY planes.
 | COLORSEP_HSV | [0x02] Merge images from three HSV planes.
 | COLORSEP_HLS | [0x03] Merge images from three HLS planes.
 | COLORSEP_YUV | [0x0005] Merge images from three YUV planes.
 | COLORSEP_XYZ | [0x0006] Merge images from three XYZ planes.
 | COLORSEP_LAB | [0x0007] Merge images from three LAB planes.
 | COLORSEP_YCrCb | [0x0008] Merge images form three YCrCb planes.
 | COLORSEP_SCT | [0x0009] Merge images form three SCT planes.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The supported color-space models are RGB, CMYK, CMY, HSV, HLS, YUV, XYZ, LAB, YCrCb and SCT.

If all the bitmaps of ppBitmap array are 16 bits grayscale bitmaps then the resulting bitmap is 48 bits per pixel, otherwise the resulting bitmap is 24 bits per pixel.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ColorSeparateBitmap, L_ConvertColorSpace,
 | L_DlgColorRes , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap
Topics: | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Color Halftone and Halftone Images
 | Raster Image Functions: Processing an Image

Example

For a short example, refer to L_ColorSeparateBitmap. For complete sample code, refer to the FRAME.C module of the DEMO example.


L_ColorReplaceBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorReplaceBitmap(pBitmap, pColorReplace, uColorCount, nHue, nSaturation, nBrightness)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPCOLORREPLACE pColorReplace; | /* array of COLORREPLACE structures */
L_UINT uColorCount; | /* number of colors */
L_INT nHue; | /* angular amount to change the hue, in degrees */
L_INT nSaturation; | /* amount to change saturation */
L_INT nBrightness; | /* amount to change the brightness */

Replaces specified colors by adjusting values of hue, saturation and brightness.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pColorReplace | An array of COLORREPLACE structures, one for each color to be replaced.
uColorCount | The number of colors to be replaced.
nHue | Angular amount to change the hue, in hundredths of degrees. Valid values range from –18000 to 18000. This value is divided internally by 100.
nSaturation | Amount to change saturation, in tenths of 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).
nBrightness | Amount to change the brightness, in tenths of 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function replaces specified colors by adjusting their value of hue, saturation and brightness. The value of the uFuzziness member of the COLORREPLACE structure determines the range around each color where the pixels will be changed according to nHue, nSaturation and nBrightness.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

The pColorReplace->uStructSize must be set to sizeof(COLORREPLACE) before calling this function. For an array of structures, only the first structure in the array needs to have uStructSize member set.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChangeBitmapHue, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
COLORREPLACE ColorReplace; /*replaced color structure information*/
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Change the red color by rotating its hue 90 degree*/
ColorReplace.uStructSize = sizeof(COLORREPLACE);
ColorReplace.crColor = RGB(200, 0, 35);
ColorReplace. uFuzziness = 100;
L_ColorReplaceBitmap(&LeadBitmap, &ColorReplace, 1, 9000, 0, 0);


L_ColorResBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorResBitmap(pBitmapSrc, pBitmapDst, uStructSize, nBitsPerPixel, uFlags, pPalette, hPalette, uColors, pfnCallback, pUserData)

pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* target bits per pixel */
L_UINT32 uFlags; | /* processing options */
LPRGBQUAD pPalette; | /* custom palette to use */
HPALETTE hPalette; | /* custom palette handle to use */
L_UINT uColors; | /* number of colors in the palette */
COLORRESCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Converts a bitmap from any bits-per-pixel to any bits-per-pixel. This function provides flexibility in specifying the output destination and in specifying the palette to use.

Parameter | Description
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap. You can convert the bitmap in place by specifying the same one as the destination.
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap. The following are valid values:
 | Value | Meaning
 | Same as pBitmapSrc | Convert the bitmap in place.
 | New pBITMAPHANDLE | Create a new bitmap to contain the converted data. The source bitmap remains unchanged.
 | NULL | Rely on the callback function to direct the output. The source bitmap remains unchanged.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | 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, 32, 48 and 64.
uFlags | Processing options. Note that the palette and dithering options are useful only when the resulting bitmap requires a palette (when it is 8 bits per pixel or less). You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:
 | Value | Meaning
 | CRF_FIXEDPALETTE | [0x01] Use the fixed palette.
 | CRF_OPTIMIZEDPALETTE | [0x02] Create an optimized palette, or if you supply a palette in the pPalette or hPalette parameter, but not both, supply optimized colors for specified entries in the palette.
 | CRF_NETSCAPEPALETTE | [0x40] Use the fixed palette that is employed by Netscape Navigator and by Microsoft Internet Explorer.
 | CRF_USERPALETTE | [0x10] Use the palette specified in the pPalette parameter, without supplying optimized colors. Please note that this cannot Or-ed with CRF_USERHPALETTE.
 | CRF_USERHPALETTE | [0x0100] Use the palette specified in the hPalette parameter, without supplying optimized colors. Please note that this cannot Or-ed with CRF_USERPALETTE.
 | CRF_IDENTITYPALETTE | [0x08] Insert the Windows system palette.
 | CRF_FASTMATCHPALETTE | [0x20] Use a predefined table to speed conversion using your own palette. Refer to L_CreateUserMatchTable.
 | CRF_BYTEORDERBGR | [0x04] Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
 | CRF_BYTEORDERRGB | [0x00] Use RGB color. This flag only has meaning when going to 16 bits per pixel or higher.
 | CRF_BYTEORDERGRAY | [0x80] Grayscale.Destination bitmap should be 12 or 16-bit grayscale. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | CRF_SLOWMATCH | [0x0200] Use with the CRF_OPTIMIZEDPALETTE flag to use a slower but more accurate matching process.
 | CRF_FAVORPURECOLORS | [0x0400] Give colors that occur frequently in the image palette entries of their own in the optimized palette.
 | CRF_NODITHERING | [0x00000000] Use nearest color matching.
 | CRF_FLOYDSTEINDITHERING | [0x00010000] Use Floyd-Steinberg dithering.
 | CRF_STUCKIDITHERING | [0x00020000] Use Stucki dithering.
 | CRF_BURKESDITHERING | [0x00030000] Use Burkes dithering.
 | CRF_SIERRADITHERING | [0x00040000] Use Sierra dithering.
 | CRF_STEVENSONARCEDITHERING | [0x00050000] Use Stevenson Arce dithering.
 | CRF_JARVISDITHERING | [0x00060000] Use Jarvis dithering.
 | CRF_ORDEREDDITHERING | [0x00070000] Use ordered dithering, which is faster but less accurate than other dithering methods.
 | CRF_CLUSTEREDDITHERING | [0x00080000] Use clustered dithering.
 | CRF_BYTEORDERROMM | [0x0800] Use ROMM color. This flag only has meaning when going to 24 or 48 bits per pixel.
pPalette | The custom palette to use. Specify this parameter as follows:
 | If you want to use the fixed palette or a fully optimized palette, pass NULL in this parameter and in hPalette.
 | If you want to supply the entire palette, specify CRF_USERPALETTE in the uFlags parameter and pass the address of your palette. Click here to see how to fill in the palette.
 | If you want the function to fill part of your palette with optimized colors, specify CRF_OPTIMIZEDPALETTE in the uFlags parameter and pass the address of your palette in pPalette and NULL in hPalette. Click here to see how to fill in the palette.
hPalette | The custom palette to use. Specify this parameter as follows:
 | If you want to use the fixed palette or a fully optimized palette, pass NULL in this parameter and in pPalette.
 | If you want to supply the entire palette, specify CRF_USERHPALETTE in the uFlags parameter and pass the handle of your palette. Click here to see how to fill in the palette.
 | If you want the function to fill part of your palette with optimized colors, specify CRF_OPTIMIZEDPALETTE in the uFlags parameter and pass NULL for pPalette and the handle of your palette in hPalette. Click here to see how to fill in the palette.
uColors | The number of colors in the palette. Pass 0 to get the default (such as 256 for 8 bits per pixel). Otherwise, do one of the following:
 | If you specify a palette in the pPalette or hPalette parameter, pass the number of entries in your palette (including reserved entries).
 | If you specify NULL in the pPalette and in the hPalette parameters and you specify CRF_OPTIMIZEDPALETTE in the uFlags parameter, you can use this parameter to limit the number of colors that the function maps in the optimized palette.
pfnCallback | Optional callback function for additional processing. (The bitmap is modified the same way, whether you provide a callback function or not.)
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | L_ColorResBitmap processes a few lines at a time in an internal loop. It calls this callback function in the loop. The callback function must adhere to the function syntax described in COLORRESCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For general information about dithering, refer to Color Resolution and Dithering.

In specifying the output destination, you can convert the bitmap in place, create a new converted bitmap, or let your callback function handle the output.

In specifying a palette, you can use simple palette options, or you can specify a palette that is tailored to your needs. The tailored palette can be any size that you specify. It can include specific colors, reserved blank entries, and open entries that this function fills with optimized colors.

If you use the same tailored palette more than once, you can improve performance by creating a table, as explained in L_CreateUserMatchTable.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmapList, L_DefaultDithering,
 | L_CreateUserMatchTable, L_SetUserMatchTable,
 | L_FreeUserMatchTable, L_DlgColorRes
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes
 | Color Resolution and Dithering

Example

For complete sample code, refer to the COLOR example.

/****************************************************************************************
This example uses L_ColorResBitmap with a callback function to
paint the changed image as it is processed. Refer to the COLORRESCALLBACK
function to see how the callback function paints the image data.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
L_INT nRow; /* First row in the input buffer */
} IMAGECBPARM;

/* Prototype for the COLORRESCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK ColorResCallback (pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer, L_INT nLines,
IMAGECBPARM L_FAR* pUserData);
/****************************************************************************************/

void TestFunction(HWND hWnd)
{

IMAGECBPARM UserData; /* Structure used for the callback function's user data */
COLORRESCALLBACK lpfnColorCallBack;
RECT rLeadDest;
/* Set the user data used for the callback in the L_ColorResBitmap function */
UserData.hwnd = hWnd; /* Current window */
UserData.hdc = GetDC( hWnd ); /* Device context for the current window */
UserData.nRow = 0; /* First row in the buffer for the callback function */
/* Set the callback function for the L_ColorResBitmap function.*/
lpfnColorCallBack = (COLORRESCALLBACK) MakeProcInstance(
(FARPROC) ColorResCallback, hInst );

/* Change the color resolution to 4 bits per pixel using and optimized palette and
with a callback function that paints the image as it is processed */
L_ColorResBitmap(&LeadBitmap, &LeadBitmap, sizeof(BITMAPHANDLE), 4,
CRF_FLOYDSTEINDITHERING|CRF_OPTIMIZEDPALETTE,
NULL, NULL, 0, lpfnColorCallBack, &UserData );
FreeProcInstance ((FARPROC) lpfnColorCallBack);

/* Avoid an unnecessary repaint */
ValidateRect(hWnd, &rLeadDest);

return;
}


L_ColorResBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorResBitmapList(hList, nBitsPerPixel, uFlags, pPalette, hPalette, uColors)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_INT nBitsPerPixel; | /* target bits per pixel */
L_UINT32 uFlags; | /* processing options */
LPRGBQUAD pPalette; | /* custom palette to use */
HPALETTE hPalette; | /* custom palette handle to use */
L_UINT uColors; | /* number of colors in the palette */

Converts all bitmaps in a list from any bits-per-pixel to any bits-per-pixel.

Parameter | Description
hList | Handle to the list of bitmaps.
nBitsPerPixel | The number of bits per pixel to increase or decrease the bitmaps to. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, and 64.
uFlags | Processing options. Note that the palette and dithering options are useful only when the resulting bitmaps require a palette (when they are 8 bits per pixel or less). You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:
 | Value | Meaning
 | CRF_FIXEDPALETTE | [0x01] Use LEAD's fixed palette.
 | CRF_OPTIMIZEDPALETTE | [0x02] Create an optimized palette.
 | CRF_NETSCAPEPALETTE | [0x40] Use the fixed palette that is employed by Netscape Navigator and by Microsoft Internet Explorer.
 | CRF_USERPALETTE | [0x10] Use the palette specified in the pPalette parameter.
 | CRF_USERHPALETTE | [0x0100] Use the palette specified in the hPalette parameter, without supplying optimized colors. Please note that this cannot Or-ed with CRF_USERPALETTE.
 | CRF_IDENTITYPALETTE | [0x08] Insert the Windows system palette. You can combine this flag with CRF_OPTIMIZEDPALETTE.
 | CRF_FASTMATCHPALETTE | [0x20] Use a predefined table to speed conversion using your own palette. Refer to L_CreateUserMatchTable.
 | CRF_BYTEORDERBGR | [0x04] Use BGR color order. This flag only has meaning when going to 16 bits per pixel or higher.
 | CRF_BYTEORDERRGB | [0x00] Use RGB color. This flag only has meaning when going to 16 bits per pixel or higher.
 | CRF_BYTEORDERGRAY | [0x80] Grayscale.Destination bitmap should be 12 or 16-bit grayscale. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | CRF_SLOWMATCH | [0x0200] Use with the CRF_OPTIMIZEDPALETTE flag to use a slower but more accurate matching process.
 | CRF_FAVORPURECOLORS | [0x0400] Give colors that occur frequently in the image palette entries of their own in the optimized palette.
 | CRF_NODITHERING | [0x00000000] Use nearest color matching.
 | CRF_FLOYDSTEINDITHERING | [0x00010000] Use Floyd-Steinberg dithering.
 | CRF_STUCKIDITHERING | [0x00020000] Use Stucki dithering.
 | CRF_BURKESDITHERING | [0x00030000] Use Burkes dithering.
 | CRF_SIERRADITHERING | [0x00040000] Use Sierra dithering.
 | CRF_STEVENSONARCEDITHERING | [0x00050000] Use Stevenson Arce dithering.
 | CRF_JARVISDITHERING | [0x00060000] Use Jarvis dithering.
 | CRF_ORDEREDDITHERING | [0x00070000] Use ordered dithering, which is faster but less accurate than other dithering methods.
 | CRF_CLUSTEREDDITHERING | [0x00080000] Use clustered dithering.
 | CRF_BYTEORDERROMM | [0x0800] Use ROMM color. This flag only has meaning when going to 24 or 48 bits per pixel.
pPalette | The custom palette to use. Specify this parameter as follows:
 | If you want to use the fixed palette or a fully optimized palette, pass NULL in this parameter and in hPalette.
 | If you want to supply the entire palette, specify CRF_USERPALETTE in the uFlags parameter and pass the address of your palette. Click here to see how to fill in the palette.
 | If you want the function to fill part of your palette with optimized colors, specify CRF_OPTIMIZEDPALETTE in the uFlags parameter and pass the address of your palette in pPalette and NULL in hPalette. Click here to see how to fill in the palette.
hPalette | The custom palette to use. Specify this parameter as follows:
 | If you want to use the fixed palette or a fully optimized palette, pass NULL in this parameter and in pPalette.
 | If you want to supply the entire palette, specify CRF_USERHPALETTE in the uFlags parameter and pass the handle of your palette. Click here to see how to fill in the palette.
 | If you want the function to fill part of your palette with optimized colors, specify CRF_OPTIMIZEDPALETTE in the uFlags parameter and pass NULL for pPalette and the handle of your palette in hPalette. Click here to see how to fill in the palette.
uColors | The number of colors in the palette. Pass 0 to get the default (such as 256 for 8 bits per pixel). Otherwise, do one of the following:
 | If you specify a palette in the pPalette or hPalette parameter, pass the number of entries in your palette (including reserved entries).
 | If you specify NULL in the pPalette and in the hPalette parameters and you specify CRF_OPTIMIZEDPALETTE in the uFlags parameter, you can use this parameter to limit the number of colors that the function maps in the optimized palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You can use this function to create an optimized palette for all bitmaps in the list.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

`See Also

Functions: | L_TranslateBitmapColor, L_ColorResBitmap,
 | L_DefaultDithering, L_CreateUserMatchTable,
 | L_SetUserMatchTable, L_FreeUserMatchTable,
 | L_DlgColorRes
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Playing Animated Images
 | Raster Image Functions: Palettes
 | Color Resolution and Dithering
 | Implementing Animation

Example

For a short example, refer to L_GetBitmapListItem. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_ColorSeparateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorSeparateBitmap(pBitmap, ppBitmap, uStructSize, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the source bitmap handle */
pBITMAPHANDLE L_FAR * ppBitmap; | /* pointers to the grayscale bitmaps */
L_UINT uStructSize; | /* size in bytes, of the structures pointed to by ppBitmap */
L_UINT32 uFlags; | /* type of separation */

Separates the specified bitmap by color plane to produce one grayscale image per plane. You can specify any of several color-space models, including CMYK.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to separate.
ppBitmap | An array of pointers to the bitmap handles that will reference the grayscale bitmaps when they are created.
uStructSize | Size in bytes, of the structures pointed to by ppBitmap, for versioning. Use sizeof(BITMAPHANDLE).
 | The pointers in the array should be in the appropriate order, which in most cases is the order of the letters in the name. For example, for CMY separation, the first pointer should be for the cyan plane, the second for magenta, and the third for yellow. The only exception is RGB, which should be in BGR (blue, green, red) order.
uFlags | The type of separation. Valid values are:
 | Value | Meaning
 | COLORSEP_RGB | [0x00] Create images for three RGB planes.
 | COLORSEP_CMYK | [0x01] Create images for four CMYK planes.
 | COLORSEP_CMY | [0x04] Create images for three CMY planes.
 | COLORSEP_HSV | [0x02] Create images for three HSV planes.
 | COLORSEP_HLS | [0x03] Create images for three HLS planes.
 | COLORSEP_YUV | [0x0005] Create images for three YUV planes.
 | COLORSEP_XYZ | [0x0006] Create images for three XYZ planes.
 | COLORSEP_LAB | [0x0007] Create images for three LAB planes.
 | COLORSEP_YCrCb | [0x0008] Create images for three YCrCb planes.
 | COLORSEP_SCT | [0x0009] Create images for three SCT planes.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The supported color-space models are RGB, CMYK, CMY, HSV, HLS, YUV, XYZ, LAB, YCrCb and SCT.

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 pBitmap is a 48 or 64 bit bitmap, then the created bitmaps are 16 bit grayscale. Otherwise the created bitmaps are 8 bit grayscale.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ColorMergeBitmap, L_ConvertColorSpace,
 | L_DlgColorRes , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap
Topics: | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Color Halftone and Halftone Images
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example creates color separations and merges them */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE ColorPlanes[4]; /* Array of bitmap handles */
pBITMAPHANDLE pColorPlanes[4]; /* Array of pointers to bitmap handles */

/* Assign bitmap handle addresses to the pointers */
pColorPlanes[0] = &ColorPlanes[0];
pColorPlanes[1] = &ColorPlanes[1];
pColorPlanes[2] = &ColorPlanes[2];
pColorPlanes[3] = &ColorPlanes[3];

/* Load the bitmap, at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Separate the color planes */
L_ColorSeparateBitmap(&LeadBitmap, pColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmap */
L_FreeBitmap(&LeadBitmap);
/* Merge the color planes */
L_ColorMergeBitmap(&LeadBitmap, pColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmaps used for color planes */
L_FreeBitmap(pColorPlanes[0]);
L_FreeBitmap(pColorPlanes[1]);
L_FreeBitmap(pColorPlanes[2]);
L_FreeBitmap(pColorPlanes[3]);


L_ColorThresholdBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ColorThresholdBitmap (pBitmap, uColorSpace, pCompData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uColorSpace; | /* color space */
LPCOMPDATA pCompData; | /* pointer to an array of structures */

Using any one of eight color spaces, resets those bitmap’s pixel component values that fall inside or outside of a specified range.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uColorSpace | Color space which the threshold is based on. Possible values are
 | Value | Meaning
 | CLTH_RGB_SPACE | [0x00000000] RGB color space
 | CLTH_HSV_SPACE | [0x00000001] HSV color space
 | CLTH_HLS_SPACE | [0x00000002] HLS color space
 | CLTH_XYZ_SPACE | [0x00000003] XYZ color space
 | CLTH_YCrCb_SPACE | [0x00000004] YCrCb color space
 | CLTH_YUV_SPACE | [0x00000005] YUV color space
 | CLTH_LAB_SPACE | [0x00000006] LAB color space
 | CLTH_CMY_SPACE | [0x00000007] CMY color space
pCompData | Pointer to an array of 3 COMPDATA structures that contains the parameters used to compare and modify each component.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is similar to the L_ConvertColorSpace function but provides greater flexibility by allowing the specification of a range and different options for handling those values that fall outside of the range. Please note that every color space component may have a different range.

Color Component | Range for 8-bit components | Range for 16-bit components
RGB |  |
R | 0 – 255 | 0 - 65535
G | 0 – 255 | 0 - 65535
B | 0 – 255 | 0 - 65535
HSV |  |
H | 0 - 360 | 0 - 36000
S | 0 - 100 | 0 - 10000
V | 0 - 255 | 0 - 65535
HLS |  |
H | 0 - 360 | 0 - 36000
L | 0 - 255 | 0 - 65535
S | 0 - 100 | 0 - 10000
XYZ |  |
X | 0 - 255 | 0 - 65535
Y | 0 - 255 | 0 - 65535
Z | 0 - 255 | 0 - 65535
YCrCb |  |
Y | 0 - 255 | 0 - 65535
Cr | -128 - 127 | -32768 - 32767
Cb | -128 - 127 | -32768 - 32767
YUV |  |
Y | 0 - 255 | 0 - 65535
U | -112 - 111 | -28567 - 28566
V | -138 - 137 | -35337 - 35336
LAB |  |
L | 0 - 100 | 0 - 10000
A | -128 - 127 | -32768 - 32767
B | -128 - 127 | -32768 - 32767
CMY |  |
C | 0 - 255 | 0 - 65535
M | 0 - 255 | 0 - 65535
Y | 0 - 255 | 0 - 65535

This function works as follows:

1. | The bitmap is converted to the required color space.
2. | For every pixel, the following operations are performed: Each component is compared with the nMinRange and nMaxRange ranges of the appropriate COMPDATA structure.
 | a. | If it is inside the range, the component is considered to have "passed" the test.
 | b. | If it is outside the range, the component has been rejected". The CLTH_TYP_BANDREJECT flag inverts this by making "rejected" components "passed" and viceversa.
3. | 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:
 | a. | If CLTH_VALUE_MIN is passed, the rejected pixel/component is set to 0.
 | b. | If CLTH_VALUE_MAX is passed, the rejected pixel/component is set to 255.
 | c. | If CLTH_VALUE_CLAMP is passed, components less that nMin go to 0 and components greater than nMax go to 255. This would work only with the CLTH_MOD_CHANNEL and CLTH_TYP_BANDPASS flag.

This function 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:

pCompData[0] structure is used for the Blue component

pCompData[1] structure is used for the Green component

pCompData[2] structure is used for the Red component

The pCompData[0].uStructSize must be set to sizeof(COMPDATA) before calling this function. For an array of structures, only the first structure in the array needs to have uStructSize member set.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_BinaryFilterBitmap, L_ConvertColorSpace, L_ColorSeparateBitmap, L_ColorMergeBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Getting and Setting Pixel Values
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
COMPDATA pCompData[3];
L_INT nI;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

pCompData[0].uStructSize = sizeof(COMPDATA);
for (nI = 0; nI < 3; nI++)
{
pCompData[nI].nMinRange = 128;
pCompData[nI].nMaxRange = 255;
pCompData[nI].uFlags = 0;
}

/* Apply color Threshold effect on the image*/
L_ColorThresholdBitmap(&LeadBitmap, CLTH_RGB_SPACE, pCompData);


L_CombineBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CombineBitmap(pBitmapDst, nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, uFlags)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
L_INT nXDst; | /* x coordinate of the origin of the destination rectangle */
L_INT nYDst; | /* y coordinate of the origin of the destination rectangle */
L_INT nWidth; | /* width of the rectangle, measured in pixels */
L_INT nHeight; | /* height of the rectangle, measured in pixels */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
L_INT nXSrc; | /* x coordinate of the origin of the source rectangle */
L_INT nYSrc; | /* y coordinate of the origin of the source rectangle */
L_UINT32 uFlags; | /* operation flags */

Combines image data from two bitmaps, letting you specify the areas to be combined and the operations to be performed when combining the data.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
nWidth | The width of the rectangle, measured in pixels. The same number is used for both source and destination rectangles.
nHeight | The height of the rectangle, measured in pixels. The same number is used for both source and destination rectangles.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap, which is combined with the destination bitmap.
nXSrc | The X coordinate of the origin of the source rectangle.
nYSrc | The Y coordinate of the origin of the source rectangle.
uFlags | The flags are combined into 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. Refer to Flags for the L_CombineBitmap Function for the list of flags.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For example, suppose you use the L_SpatialFilterBitmap function to apply an edge detection filter. You can then use this function to combine the resulting bitmap with the original one to produce an image with hard edges.

This function 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.

This function uses Windows-style coordinates (with a top-left origin) to specify the areas to be combined.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

If a region is defined for either the source or destination bitmap, or both bitmaps, the combine applies only to the intersection of regions.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_UnderlayBitmap, L_SkeletonBitmap, L_CorrelationBitmap, L_TextureAlphaBlendBitmap, L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_VignetteBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap, L_DiffuseGlowBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Copying Images
 | Processing an Image
 | Removing Noise
 | Detecting and Enhancing Edges and Lines
 | Implementing Transparency
 | Raster Image Functions: Document Imaging
 | Detecting Registration Marks
 | Raster Image Functions: Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example uses the flags for a simple paste when combining
the source bitmap with the destination bitmap. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */
L_INT XDst; /* Column offset of the destination */
L_INT XSize; /* Pixel width of the rectangle to combine */
L_INT YDst; /* Row offset of the destination */
L_INT YSize; /* Pixel height of the rectangle to combine */
L_INT XSrc; /* Column offset of the source */
L_INT YSrc; /* Column offset of the source */
/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("ULAY4.BMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Specify a position in the top left part of the displayed image */
XDst = BITMAPWIDTH(&LeadBitmap) / 8;
YDst = BITMAPHEIGHT(&LeadBitmap) / 8;
/* Use the full size of the source bitmap */
YSize = BITMAPHEIGHT(&TmpBitmap);
XSize = BITMAPWIDTH(&TmpBitmap);
XSrc = 0;
YSrc = 0;
/* Combine TmpBitmap with LeadBitmap, using flags for an ordinary paste */
L_CombineBitmap(&LeadBitmap, XDst, YDst, XSize, YSize,
&TmpBitmap, XSrc, YSrc, CB_OP_ADD | CB_DST_0);
/* Free the temporary bitmap */
L_FreeBitmap (&TmpBitmap);


L_CombineBitmapExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CombineBitmapExt(pBitmapDst, nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, uFlag)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
L_INT nXDst; | /* x coordinate of the origin of the destination rectangle */
L_INT nYDst; | /* y coordinate of the origin of the destination rectangle */
L_INT nWidth; | /* width of the rectangle, measured in pixels */
L_INT nHeight; | /* height of the rectangle, measured in pixels */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
L_INT nXSrc; | /* x coordinate of the origin of the source rectangle */
L_INT nYSrc; | /* y coordinate of the origin of the source rectangle */
L_UINT32 uFlag; | /* operation flags */

Combines image data from two bitmaps (source and destination), letting you 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.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
nWidth | The width of the rectangle, measured in pixels. The same number is used for both source and destination rectangles.
nHeight | The height of the rectangle, measured in pixels. The same number is used for both source and destination rectangles.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap, which is combined with the destination bitmap.
nXSrc | The X coordinate of the origin of the source rectangle.
nYSrc | The Y coordinate of the origin of the source rectangle.
uFlag | The flags are combined into seven 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. Refer to Flags for the L_CombineBitmapExt Function for the list of flags.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For example, suppose you use the L_SpatialFilterBitmap function to apply an edge detection filter. You can then use this function to combine the resulting bitmap with the original one to produce an image with hard edges.

This function combines the data byte-by-byte. The two images can be any color resolution. Images that are 24-bits per pixel are the easiest and fastest to combine. This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

If a region is defined for either the source or destination bitmap, or both bitmaps, the combine applies only to the intersection of 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 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* This example uses the flags for a simple paste when combining
the source bitmap with the destination bitmap. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */
L_INT XDst; /* Column offset of the destination */
L_INT XSize; /* Pixel width of the rectangle to combine */
L_INT YDst; /* Row offset of the destination */
L_INT YSize; /* Pixel height of the rectangle to combine */
L_INT XSrc; /* Column offset of the source */
L_INT YSrc; /* Column offset of the source */
/* Load both bitmaps, at different bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("ULAY4.BMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);
/* Specify a position in the top left part of the displayed image */
XDst = BITMAPWIDTH(&LeadBitmap) / 8;
YDst = BITMAPHEIGHT(&LeadBitmap) / 8;
/* Use the full size of the source bitmap */
YSize = BITMAPHEIGHT(&TmpBitmap);
XSize = BITMAPWIDTH(&TmpBitmap);
XSrc = 0;
YSrc = 0;
/* Combine TmpBitmap with LeadBitmap, using flags for an ordinary paste */
L_CombineBitmapExt(&LeadBitmap, XDst, YDst, XSize, YSize,
&TmpBitmap, XSrc, YSrc, CB_OP_ADD | CB_DST_0
|CB_SRC_RED|CB_DST_GREEN
|CB_RES_BLUE);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);


L_CombineBitmapWarp

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CombineBitmapWarp(pBitmapDst, ptDstArray, pBitmapSrc, ptSrc, nSrcWidth, nSrcHeight, uFlags)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
POINT ptDstArray; | /* array of points */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
POINT ptSrc; | /* point of origin of the source bitmap */
L_INT nSrcWidth; | /* width of the source area to be warped */
L_INT nSrcHeight; | /* height of the source area to be warped */
L_UINT uFlags; | /* operation flags */

Combines image data from the source bitmap (the slave) and the destination bitmap (the master), using a perspective warp.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap. This is the master bitmap and is the bitmap that the function updates.
ptDst | An array of POINT structures that contain the four points that define the warp area in the destination bitmap.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap. This is the slave bitmap, which is combined with the destination bitmap.
ptSrc | POINT structure that contains the point of origin of the source bitmap. This is the upper left corner. This point, along with nSrcWidth and nSrcHeight define the area of the source bitmap to be warped.
nSrcWidth | The width of the area in the source bitmap to be warped to the destination bitmap. This value, along with ptSrc and nSrcHeight define the area of the source bitmap to be warped.
nSrcHeight | The height of the area in the source bitmap to be warped to the destination bitmap. This value, along with ptSrc and nSrcWidth define the area of the source bitmap to be warped.
uFlags | Flags that indicate the type of interpolation to use, if interpolation is used. Possible values are:
 | Value | Meaning
 | 0 | No interpolation
 | CBW_BILINEAR | Bilinear interpolation. This value is only valid if the bits per pixel of the image is 1-bit, 8-bit grayscale, 12-bit without a lookup table, 16-bit without a lookup table, 24, 32, 48, or 64.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You can warp the entire source bitmap, or a portion of the source bitmap. To warp a portion of the source bitmap, set ptSrc, nSrcWidth and nSrcHeight accordingly. To warp the entire source bitmap, set the following:

ptSrc.x = 0;
ptSrc.y = 0;
nSrcWidth = pBitmapSrc.BitmapWidth;
nSrcHeight = pBitmapSrc.BitmapHeight;

The warp area in the destination bitmap is specified in ptDstArray. The polygon specified in ptDstArray must:

be concave.

fit entirely on the destination bitmap.

If either of these conditions is FALSE, this function will return an error.

The ordering of the points in ptDstArray can affect the resulting warp. For example, if the source bitmap is the following:

then ordering the points in ptDstArray as shown below results in the following warp:

while ordering the points in ptDstArray as shown below, results in the following warp:

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CombineBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE Master;
BITMAPHANDLE Slave;

void TestFunction()
{
L_INT nRet;
POINT ptSrc = {0,0};
POINT aptsDest[4]=
{
{100,100},
{200,75},
{200,250},
{100,200}
};

//load images as 24-bit, so we don't have to worry about palettes
L_LoadBitmap(TEXT("d:\\temp\\golf.jpg"), &Master, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap(TEXT("d:\\temp\\golf2.jpg"), &Slave, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

nRet = L_CombineBitmapWarp(&Master,
aptsDest,
&Slave,
ptSrc,
Slave.Width, Slave.Height,
CBW_BILINEAR);

L_SaveBitmap(TEXT("d:\\temp\\output.jpg"), &Master, FILE_JPEG, 0, 2, NULL);
L_FreeBitmap(&Master);
L_FreeBitmap(&Slave);
}


L_CompactFile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CompactFile(pszSrcFile, pszDstFile, uPages, pLoadFileOption, pSaveFileOption)

L_TCHAR L_FAR * pszSrcFile; | /* name of the source file being compacted */
L_TCHAR L_FAR * pszDstFile; | /* name of the file in which the data will be written */
L_UINT uPages; | /* number of pages to copy */
pLOADFILEOPTION pLoadFileOption; | /* optional pointer to the LOADFILEOPTION structure */
pSAVEFILEOPTION pSaveFileOption; | /* optional pointer to the SAVEFILEOPTION structure */

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.

Parameter | Description
pszSrcFile | Character string containing the name of the file being compacted. All the pages will be read from this file.
pszDstFile | Character string containing the name of the file in which all the pages will be written. This cannot be NULL. If this is NULL, the function will return an error. The pages can be added to this file using the pSaveFileOption parameter.
uPages | Value that represents the number of pages to copy. Use 0 to copy all the pages. If uPages is > 0, only uPages will be copied to pszDstFile.
pLoadFileOption | Optional pointer to the LOADFILEOPTION structure, which can be used to specify a starting page. You can also speed up the access to the starting page using the IFD. You can pass NULL, which is equivalent to starting from the first page and to use the default load options.
pSaveFileOption | Optional pointer to the SAVEFILEOPTION structure, which can be used to specify where to save the data or how to modify an existing file. You can modify whether the new pages should appended, inserted or whether they should replace existing pages. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
ERROR_COMPACT_ABORTED | The function encountered an error while reading a page from the source file. Not all the pages have been copied to the destination file.
< 1 | An error occurred. Refer to Return Codes.

Comments

The following members of the LOADFILEOPTION structure are important for this function:

PageNumber: 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.

Flags: specifies whether to use the IFD.

IFD: used only if Flags contains the ELO_USEIFD flag. If ELO_USEIFD is not set, the PageNumber references the beginning of the file.

If pSaveFileOption is NULL, then if pszDstFile exists, it will be overwritten regardless of its format. Also, defaults will be used when saving the file (it will be saved in Intel format). Refer to the SAVEFILEOPTION documentation. TIF files are saved in two possible byte orders: Intel or Motorola (see SAVEFILEOPTIONS.Flags and ESO_MOTOROLAORDER flag.

If pSaveFileOption is not NULL, the following members of the SAVEFILEOPTION structure are important for this function:

PageNumber: specifies the start page. This parameter is used as follows:

If ESO_INSERTPAGE is set in Flags, all the pages are inserted before this page.

If ESO_REPLACEPAGE is set in Flags, this page and the remaining uPages – 1 will be replaced.

If none of the above parameters are set, then:

If PageNumber is 0, the file will be overwritten.

If PageNumber is <> 0, the pages will be appended to the end of the file.

IFD: can be used to speed up the file access for TIFF files with many pages. Used only if ESO_USEIFD is set in Flags.

Flags: can be used to specify one or more options:

ESO_NOSUBFILETYPE – if this flag is set, then the TGSUBFILETYPE tag will be stripped from all the pages.

ESO_REPLACEPAGE – if this is set, pages in pszDstFile are replaced starting with page PageNumber.

ESO_INSERTPAGE - if this is set, all the pages are inserted before page PageNumber.

ESO_USEIFD – if this is set, the first page in pszDstFile is at offset IFD. All pages will be relative to that page. (Note that this might not be the first physical page in the file). This is a common technique for manipulating files with thousands of pages.

ESO_MOTOROLAORDER – if this is set and you are creating a new file, the pages will be saved in Motorola byte order. If the flag is not set, the pages will be saved in Inter 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.

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SaveFile, L_LoadFile, L_FileInfo, L_GetDefaultLoadFileOption, L_GetDefaultSaveFileOption
Topics: | Loading and Saving Large TIFF Files
 | Raster Image Functions: Loading Files
 | Raster Image Functions: Saving Files

Example1

/* This example will compact all the pages in a TIFF file. It will create a new file called dstfile.tif */
L_INT nRet;
nRet = L_CompactFile("srcfile.tif", "dstfile.tif", 0, NULL, NULL);
if(nRet != SUCCESS)
MessageBox(NULL, "Error compacting file!", "ERROR", MB_OK);

Example2

/* This example will compact all the pages in a TIFF file. It will append all the pages to an existing file called dstfile.tif */

L_INT nRet;
SAVEFILEOPTION SaveFileOption;
L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SaveFileOption));
SaveFileOption.PageNumber = 2;

nRet = L_CompactFile("srcfile.tif", "dstfile.tif", 0, NULL, &SaveFileOption);
if(nRet != SUCCESS)
MessageBox(NULL, "Error compacting file!", "ERROR", MB_OK);


L_CompressBitmapWithStamp

This function has been removed. You can achieve the same functionality using L_SaveFile.


L_CompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CompressBuffer(pBuffer)

L_UCHAR L_FAR * pBuffer;

/* pointer to the input buffer */

Does buffer-to-buffer JPEG or LEAD CMP compression. Call this function to compress raw 24-bit BGR or 8-bit grayscale data using input and output buffers that your program allocates.

Parameter | Description
pBuffer | Pointer to the buffer that holds the data to be compressed. The data in this buffer must not be padded; so you should strip any padding bytes when loading the buffer. The BytesPerLine field in the bitmap handle may include padding. When getting data from a bitmap, it is better to calculate the bytes to get based on the Width and BitsPerPixel fields.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note that you must call the L_StartCompressBuffer function before using this function, and you must call the L_EndCompressBuffer function to end the compression process. For a description of how these functions work together, refer to L_StartCompressBuffer.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartCompressBuffer, L_EndCompressBuffer
Topics: | Raster Image Functions: Saving Files

Example

For a short example, refer to L_StartCompressBuffer. For complete sample code, refer to the COMPCB example.


L_CompressRow

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CompressRow(pRunBuffer, pBuffer, nCol, nWidth)

L_UINT16 L_HUGE * pRunBuffer; | /* pointer to the output buffer */
L_UCHAR L_HUGE * pBuffer; | /* pointer to the input buffer */
L_INT nCol; | /* column offset within the row to process */
L_INT nWidth; | /* number of pixels to process */

Does buffer-to-buffer RLE compression of 1-bit image data. Use this function to process all or part of a single line of image data. This function is available in the Document/Medical Toolkits.

Parameter | Description
pRunBuffer | Pointer to the output buffer, which will be filled with 1-bit compressed image data. Calculate the required size of this buffer as follows: bytes required = (nWidth + 3) * 2.
pBuffer | Pointer to the input buffer, which contains the 1-bit image data to be compressed. Use integer math to calculate the required size of this buffer as follows: bytes required = (nCol + nWidth + 7) / 8.
nCol | Column offset within the row to be processed. The function skips this many pixels before it begins processing.
nWidth | The number of pixels to process.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

The output buffer must be larger than the input buffer to accommodate the worst possible case with run-length encoding, where there are alternating black and white pixels. In most cases, however, the actual compressed data will be much smaller than the input data.

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ExpandRow, L_CompressRows, L_ExpandRows,
 | L_GetBitmapRowColCompressed,
 | L_PutBitmapRowColCompressed,
 | L_GetBitmapRowCompressed,
 | L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to L_PutBitmapRowColCompressed.


L_CompressRows

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CompressRows(pRunBuffer, pBuffer, nWidth, nRows)

L_UINT16 L_HUGE * pRunBuffer; | /* pointer to the output buffer */
L_UCHAR L_HUGE * pBuffer; | /* pointer to the input buffer */
L_UINT nWidth; | /* number of pixels in each row */
L_UINT nRows; | /* number of rows */

Does buffer-to-buffer RLE compression of 1-bit image data. Use this function to process multiple lines of image data. This function is available in the Document/Medical Toolkits.

Parameter | Description
pRunBuffer | Pointer to the output buffer, which will be filled with 1-bit compressed image data. Calculate the required size of this buffer as follows: bytes required = ((nWidth + 3) * 2) * nRows.
pBuffer | Pointer to the input buffer, which contains the 1-bit image data to be compressed. The size of each row must be rounded up to a multiple of 4 bytes. Use integer math to calculate the required size of this buffer as follows: bytes required = (((nWidth + 31) &~31)/ 8) * nRows.
nWidth | The number of pixels in each row.
nRows | The number of rows to process.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

The output buffer must be larger than the input buffer to accommodate the worst possible case with run-length encoding, where there are alternating black and white pixels. In most cases, however, the actual compressed data will be much smaller than the input data.

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CompressRow, L_ExpandRow, L_ExpandRows,
 | L_GetBitmapRowColCompressed,
 | L_PutBitmapRowColCompressed,
 | L_GetBitmapRowCompressed,
 | L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to L_GetBitmapRowCompressed.


L_ContBrightIntBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ContBrightIntBitmap (pBitmap, nContrast, nBrightness, nIntensity);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nContrast; | /* amount of contrast change */
L_INT nBrightness; | /* amount of brightness change */
L_INT nIntensity; | /* amount of intensity change */

Applies contrast, brightness and intensity adjustments to enhance the image tonal range. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.
nContrast | 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.
nBrightness | 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.
nIntensity | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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. 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 functions to be called separately, then after each function 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 function, the values are accumulative and the final result would be clamped. In addition, this function is faster than calling each function separately.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapContrast, L_ChangeBitmapIntensity, L_ChangeBitmapSaturation, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_ColorLevelBitmap, L_AutoColorLevelBitmap, L_SelectBitmapData, L_ColorizeGrayBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

/* This example loads a bitmap and performs the adjustments. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);

L_ContBrightIntBitmap (&LeadBitmap, -146, 385, 240);


L_ContourFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ContourFilterBitmap(pBitmap, nThreshold, nDeltaDirection, nMaximumError, nOption)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_INT16 nThreshold; | /* threshold value */
L_INT16 nDeltaDirection; | /* maximum angle */
L_INT16 nMaximumError; | /* maximum error */
L_INT nOption; | /* flag that controls the resulting image */

Performs a contour segment filter on the source bitmap. This function is available in the Medical Toolkits.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the bitmap that will be affected.
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.
nDeltaDirection | Maximum angle for the thinning algorithm. Values can be from 1 to 64. Default is 35.
nMaximumError | Maximum error for approximation algorithm. Values can be from 0 to 255. Default is 5. This parameter is only valid if nOption is CONTOUR_APPROX_COLOR.
nOption | 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

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bits per pixel of the affected bitmap will change according to the value of nOption.

If nOption is: | Bits per pixel will be:
CONTOUR_THIN | 8 bits per pixel grayscale
CONTOUR_LINK_BLACKWHITE | 1 bit per pixel
CONTOUR_LINK_GRAY | 8 bits per pixel grayscale
CONTOUR_LINK_COLOR | 8 bits per pixel color
CONTOUR_APPROX_COLOR | 8 bits per pixel color

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DlgColorRes , L_DlgOpen , L_DlgSave
 | L_DlgContourFilter , L_DlgResize
 | L_DlgGammaAdjustment , L_DlgAddNoise , L_DlgEmboss , L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap

Example

For an example, refer to L_DlgContourFilter .


L_ConvertBitmapSignedToUnsigned

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertBitmapSignedToUnsigned(pBitmap, uShift)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uShift; | /* shifting option */

Converts a signed bitmap to unsigned.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
uShift | 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. (Achieves the same result as L_ClearNegativePixels).
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If the ELO_SIGNED flag has been set using LOADFILEOPTION, when a file is loaded, the bitmap may contain negative pixel values and LEADTOOLS will paint/process the image incorrectly. To use this bitmap correctly the negative pixels should be converted, if it contains negative pixels (if pBitmap->Flags.Signed is TRUE).

If the pBitmap->Flags.Signed is set to TRUE, this function will shift the color values in the Bitmap according to the uShift parameter.

The function will also update the MinVal and MaxVal members of the BITMAPHANDLE.

This function supersedes L_ClearNegativePixels.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ClearNegativePixels, L_ConvertBitmapUnsignedToSigned
Topics: | Processing an Image
 | Raster Image Functions: Getting and Setting Pixel Values

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

/* clear negative pixels if signed */
if(LeadBitmap.Flags.Signed)
L_ConvertBitmapSignedToUnsigned(&LeadBitmap, SHIFT_NEG_TO_ZERO);


L_ConvertBitmapUnsignedToSigned

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertBitmapUnsignedToSigned(pBitmap, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlag; | /* flag */

Converts an unsigned bitmap to signed.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates pBitmap->MaxVal and pBitmap-> MinVal with new values that reflect the bitmap's new signed data. In addition, the pBitmap->Flags.Signed value will be set to one.

This function supports 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ClearNegativePixels, L_ConvertBitmapSignedToUnsigned
Topics: | Processing an Image
 | Raster Image Functions: Getting and Setting Pixel Values

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.TIF"), &LeadBitmap,sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

/* convert bitmap to signed */
if(!LeadBitmap.Flags.Signed)
L_ConvertBitmapUnsignedToSigned(&LeadBitmap, PROCESS_RANGE_ONLY);


L_ConvertBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertBuffer(pBuffer, nWidth, nBitsPerPixelSrc, nBitsPerPixelDst, nOrderSrc, nOrderDst, pPaletteSrc, pPaletteDst)

L_UCHAR, L_FAR * pBuffer; | /* pointer to the input buffer */
L_INT nWidth; | /* image width, in pixels */
L_INT nBitsPerPixelSrc; | /* input bits per pixel */
L_INT nBitsPerPixelDst; | /* output bits per pixel */
L_INT nOrderSrc; | /* input color order */
L_INT nOrderDst; | /* output color order */
LPRGBQUAD pPaletteSrc; | /* pointer to the palette for the existing data */
LPRGBQUAD pPaletteDst; | /* pointer to the palette for the converted data */

Converts data in the specified buffer to the specified bits per pixel and color order. You can convert from any bits per pixel to any bits per pixel.

Parameter | Description
pBuffer | Pointer to the input buffer.
nWidth | Image width, in pixels.
nBitsPerPixelSrc | Input bits per pixel. Possible values are 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, and 64.
nBitsPerPixelDst | Output bits per pixel. Use 0 for 8-bit grayscale.
nOrderSrc | The input color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] The input colors are in red-green-blue order.
 | ORDER_BGR | [1] The input colors are in blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_ROMM | [5] The input colors are in ROMM order. ROMM only supports 24 and 48-bit images.
nOrderDst | The output color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] The output colors are in red-green-blue order.
 | ORDER_BGR | [1] The output colors are in blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_ROMM | [5] The output colors are in ROMM order. ROMM only supports 24 and 48-bit images.
pPaletteSrc | Pointer to the palette for the existing data, before conversion. If the data is converted from 16 or 24 bits per pixel, use NULL for no palette.
pPaletteDst | Pointer to the palette for the converted data. If the data is converted to 16 or 24 bits per pixel, use NULL for no palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

The conversion uses only one buffer, which must be large enough to hold the data before and after conversion.

Image data that is 8 bits per pixel or less must use a palette, and this function can use such data as input, output, or both. Therefore, you may need to specify the palette for the input, or for the output, or both.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartDithering, L_DitherLine, L_StopDithering,
 | L_ConvertBufferExt
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

/* This example loads a temporary bitmap at 8 bits per pixel, creates a new
bitmap at 16 bits per pixel, and uses L_ConvertBuffer to convert data from
the temporary bitmap to the new one. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
void TestFunction(HWND hWnd)
{
RGBQUAD FixedPalette[256]; /* Temporary palette */
BITMAPHANDLE TmpBitmap; /* Bitmap handle to hold the input image */
L_UCHAR L_FAR *pBuf; /* Buffer to hold the row */
HGLOBAL hBuf; /* Handle to the buffer */
int i; /* Loop counter */
/* Load the bitmap, at 8 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, 0, NULL, NULL);
/* Create a new 16-bit bitmap */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE), TYPE_CONV, TmpBitmap.Width, TmpBitmap.Height,
16, ORDER_BGR, NULL, TmpBitmap.ViewPerspective, NULL, 0);
/* Get the LEAD fixed palette for an 8-bit image */
L_GetFixedPalette(FixedPalette, 8);
/* Allocate and lock the buffer */
hBuf = GlobalAlloc(GMEM_MOVEABLE,LeadBitmap.BytesPerLine);
pBuf = (L_UCHAR L_FAR *)GlobalLock( hBuf );
/* Process each row from TmpBitmap to LeadBitmap */
L_AccessBitmap(&LeadBitmap);
L_AccessBitmap(&TmpBitmap);
for(i=0; i < TmpBitmap.Height; i++)
{
L_GetBitmapRow(&TmpBitmap, pBuf, i, TmpBitmap.BytesPerLine);
L_ConvertBuffer(pBuf, TmpBitmap.Width,
TmpBitmap.BitsPerPixel, LeadBitmap.BitsPerPixel,
TmpBitmap.Order, LeadBitmap.Order, FixedPalette, NULL);
L_PutBitmapRow(&LeadBitmap, pBuf, i, LeadBitmap.BytesPerLine);
}
L_ReleaseBitmap(&LeadBitmap);
L_ReleaseBitmap(&TmpBitmap);
/* Free memory that we no longer need */
GlobalUnlock(hBuf);
GlobalFree(hBuf);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
/* Force paint palette creation */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_ConvertBufferExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertBufferExt(pBuffer, nWidth, nBitsPerPixelSrc, nBitsPerPixelDst, nOrderSrc, nOrderDst, pPaletteSrc, pPaletteDst, uFlags, uLowBit, uHighBit)

L_UCHAR L_FAR * pBuffer; | /* pointer to the input buffer */
L_INT nWidth; | /* image width, in pixels */
L_INT nBitsPerPixelSrc; | /* input bits per pixel */
L_INT nBitsPerPixelDst; | /* output bits per pixel */
L_INT nOrderSrc; | /* input color order */
L_INT nOrderDst; | /* output color order */
LPRGBQUAD pPaletteSrc; | /* pointer to the palette for the existing data */
LPRGBQUAD pPaletteDst; | /* pointer to the palette for the converted data */
L_UINT uFlags; | /* option flags */
L_INT uLowBit; | /* low bit */
L_INT uHighBit; | /* high bit */

Converts data in the specified buffer to the specified bits per pixel and color order. You can convert from any bits per pixel to any bits per pixel.

Parameter | Description
pBuffer | Pointer to the input buffer.
nWidth | Image width, in pixels.
nBitsPerPixelSrc | Input bits per pixel. Possible values are 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, and 64.
nBitsPerPixelDst | Output bits per pixel. Use 0 for 8-bit grayscale.
nOrderSrc | The input color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] The input colors are in red-green-blue order.
 | ORDER_BGR | [1] The input colors are in blue-green-red order.
 | ORDER_GRAY | [2] The input is grayscale.
 | ORDER_ROMM | [5] The input colors are in ROMM order. ROMM only supports 24 and 48-bit images.
 | 0 | The data is 8 bits per pixel or less.
nOrderDst | The output color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] The output colors are in red-green-blue order.
 | ORDER_BGR | [1] The output colors are in blue-green-red order.
 | ORDER_GRAY | [2] The output is grayscale.
 | ORDER_ROMM | [5] The output colors are in ROMM order. ROMM only supports 24 and 48-bit images.
 | 0 | The data is 8 bits per pixel or less.
pPaletteSrc | Pointer to the palette for the existing data, before conversion. If the data is converted from 16 or 24 bits per pixel, use NULL for no palette.
pPaletteDst | Pointer to the palette for the converted data. If the data is converted to 16 or 24 bits per pixel color, use NULL for no palette.
uFlags | Flags indicating whether to treat 16 bit data as grayscale or color. Possible values are:
 | Value | Meaning
 | CVT_SRCGRAY | [0x0001] Source buffer has grayscale data.
 | CVT_DSTGRAY | [0x0002] Destination buffer has grayscale data.
 | CVT_SRCUSEBITS | [0x0003] uLowBit and uHighBit apply to the source bitmap.
 | CVT_DSTUSEBITS | [0x0004] uLowBit and uHighBit apply to the destination bitmap.
uLowBit | Value indicating the low bit in the source buffer, if the source buffer contains grayscale data.
uHighBit | Value indicating the high bit in the source buffer, if the source buffer contains grayscale data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note: This function will also work for 12 and 16-bit grayscale images, but only in the Document/Medical Imaging editions . If you attempt to use this function with a 12 or 16-bit grayscale image, but you do not have a Medical Imaging edition , you will receive an error.

The conversion uses only one buffer, which must be large enough to hold the data before and after conversion.

Image data that is 8 bits per pixel or less must use a palette, and this function can use such data as input, output, or both. Therefore, you may need to specify the palette for the input, or for the output, or both.

If either nBitsPerPixelSrc or nBitsPerPixelDst is 16, uFlags is used to determine whether the data should be treated as color or grayscale.

If nBitsPerPixelSrc is 12, it is assumed to be grayscale. However, the uFlags parameter should also reflect that it is grayscale for future compatibility.

If the source is grayscale, pPaletteSrc can be set to a palette. The palette should contain N entries. If the source uses uLowBit and uHighBit, then N equals 2 raised to the power of (uHighBit - uLowBit + 1). Otherwise, N equals 2 raised to the power of nBitsPerPixelSrc.

uFlags supersedes nOrderSrc and nOrderDst. If you specify ORDER_BGR for nOrderSrc, but use CVT_SRCGRAY in uFlags, it will be assumed that the source buffer contains grayscale data.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertBuffer
Topics: | Raster Image Functions: Doing Color Space Conversions, Raster Image Functions: Doing Color Expansion or Reduction

Example

This example loads a temporary bitmap at 24 bits per pixel, creates a new 16-bit grayscale image, and uses L_ConvertBuffer to convert data from the temporary bitmap to the new one.

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */

void TestFunction(HWND hWnd, pBITMAPHANDLE pBitmap)
{
BITMAPHANDLE TmpBitmap; /* Bitmap handle to hold the input image */
L_UCHAR L_FAR *pBuf; /* Buffer to hold the row */
HGLOBAL hBuf; /* Handle to the buffer */
int i; /* Loop counter */

/* Load the bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, 0, NULL, NULL);

/* Create a new 16-bit grayscale bitmap */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE), TYPE_CONV, TmpBitmap.Width, TmpBitmap.Height,
16, ORDER_GRAY, NULL, TmpBitmap.ViewPerspective, NULL, 0);

/* Allocate and lock the buffer */
hBuf = GlobalAlloc(GMEM_MOVEABLE,max(LeadBitmap.BytesPerLine, TmpBitmap.BytesPerLine));
pBuf = (L_UCHAR L_FAR *)GlobalLock( hBuf );

/* Process each row from TmpBitmap to LeadBitmap */
L_AccessBitmap(&LeadBitmap);
L_AccessBitmap(&TmpBitmap);
for(i=0; i < TmpBitmap.Height; i++)
{
L_GetBitmapRow(&TmpBitmap, pBuf, i, TmpBitmap.BytesPerLine);
L_ConvertBufferExt(pBuf, TmpBitmap.Width,
TmpBitmap.BitsPerPixel, LeadBitmap.BitsPerPixel,
TmpBitmap.Order, LeadBitmap.Order, NULL, NULL,
CVT_DSTGRAY, 0, 15);
L_PutBitmapRow(&LeadBitmap, pBuf, i, LeadBitmap.BytesPerLine);
}
L_ReleaseBitmap(&LeadBitmap);
L_ReleaseBitmap(&TmpBitmap);

/* Free memory that we no longer need */
GlobalUnlock(hBuf);
GlobalFree(hBuf);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);

/* Force paint palette creation */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_ConvertColorSpace

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertColorSpace(pBufferSrc, pBufferDst, nWidth, nFormatSrc, nFormatDst)

L_UCHAR L_FAR * pBufferSrc; | /* pointer to the input buffer */
L_UCHAR L_FAR * pBufferDst; | /* pointer to the output buffer */
L_INT nWidth; | /* number of pixels to be processed */
L_INT nFormatSrc; | /* format of the source data */
L_INT nFormatDst; | /* format of the output data */

Converts image data in a buffer from one color space model to another. The supported models are RGB, YUV, CMYK, CMY, YIQ, HSV, and HLS.

Parameter | Description
pBufferSrc | Pointer to the buffer holding the input data.
pBufferDst | Pointer to the buffer that will hold the converted data.
nWidth | The number of pixels to be processed.
nFormatSrc | Format of the input data. There are two groups. The valid values for the first group are:
 | Value | Meaning
 | CCS_RGB | [0x00] RGB color space model (in BGR order).
 | CCS_YUV | [0x01] YUV color space model.
 | CCS_CMYK | [0x02] CMYK color space model.
 | CCS_CMY | [0x06] CMY color space model.
 | CCS_YIQ | [0x05] YIQ color space model.
 | CCS_HSV | [0x03] HSV color space model.
 | CCS_HLS | [0x04] HLS color space model.
 | The valid values for the second group are:
 | Value | Meaning
 | CCS_RGB16 | [0x10] RGB color space model (in BGR order).
 | CCS_YUV16 | [0x20] YUV color space model.
 | CCS_YIQ16 | [0x30] YIQ color space model.
 | CCS_HSV16 | [0x40] HSV color space model.
 | CCS_HLS16 | [0x50] HLS color space model.
 | CCS_CMY16 | [0x60] CMY color space model.
 | CCS_CMYK16 | [0x70] CMYK color space model.
nFormatDst | Format of the output data. There are two groups. The valid values for the first group are:
 | Value | Meaning
 | CCS_RGB | [0x00] RGB color space model (in BGR order).
 | CCS_YUV | [0x01] YUV color space model.
 | CCS_CMYK | [0x02] CMYK color space model.
 | CCS_CMY | [0x06] CMY color space model.
 | CCS_YIQ | [0x05] YIQ color space model.
 | CCS_HSV | [0x03] HSV color space model.
 | CCS_HLS | [0x04] HLS color space model.
 | The valid values for the second group are:
 | Value | Meaning
 | CCS_RGB16 | [0x10] RGB color space model (in BGR order).
 | CCS_YUV16 | [0x20] YUV color space model.
 | CCS_YIQ16 | [0x30] YIQ color space model.
 | CCS_HSV16 | [0x40] HSV color space model.
 | CCS_HLS16 | [0x50] HLS color space model.
 | CCS_CMY16 | [0x60] CMY color space model.
 | CCS_CMYK16 | [0x70] CMYK color space model.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

RGB is commonly used for displaying images on monitors and for storing images in files. YUV and YIQ are used for data that is stored using JPEG compression. CMYK is used when printing images. HSV and HLS are used in applications that let human beings manipulate the color plane values.

Note the following:

The nFormatSrc and nFormatDst must be selected from the same group (the first or second group shown above).

Before calling this function, your program must allocate buffers for the input and output data. The format of data may be:

24 bits per pixel, except CMYK which is 32. In this case the nFormatSrc and nFormatDst must be selected from the first group.

48 bits per pixel except CMYK which is 64. In this case the nFormatSrc and nFormatDst must be selected from the second group

when using a 48 bit format, the data must be allocated in an integer (short) buffer. However, this function's buffer parameters expect unsigned characters. Therefore, when allocating space for data, to use as a parameter, you should allocate a buffer of integers, then cast the buffer pointer to the appropriate data type.

YUV or YIQ data must be always allocated in an integer (short) buffer. Therefore, when allocating space for YUV or YIQ data, to use a s a parameter, you should allocate a buffer of integers then cast the buffer pointer to the appropriate data type.

RGB input data for this function must be 24-bit or 48-bit in BGR order.

Color-plane values for all models of 24 bits, except YUV and YIQ, are scaled from 0 to 255. For example, a hue, which is normally represented as 0-359, is instead scaled to fit the 0-255 range. For YUV or YIQ, color plane values are scaled from 0 to 16383.

This function also supports 12 and 16 - bit grayscale bitmaps. Support for 12 and 16 - bit grayscale images is available only in the Document/Medical toolkits.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorSeparateBitmap, L_ColorMergeBitmap, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap
Topics: | Processing an Image
 | Color Halftone and Halftone Images
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the CLRSPACE example.

/* This example converts one row of image data from RGB to CMYK.
It does not produce any output. */
L_UCHAR L_FAR *pInBuf; /* Buffer to hold the input row */
HGLOBAL hInBuf; /* Handle to the input buffer */
L_UCHAR L_FAR *pOutBuf; /* Buffer to hold the output row */
HGLOBAL hOutBuf; /* Handle to the output buffer */
BITMAPHANDLE TmpBitmap; /* Bitmap containing input data */
/* Load the input bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Allocate the input buffer for 24-bit RGB data */
hInBuf = GlobalAlloc(GMEM_MOVEABLE, TmpBitmap.Width * 3);
pInBuf = (L_UCHAR L_FAR *)GlobalLock( hInBuf );
/* Allocate the output buffer for 32-bit CMYK data */
hOutBuf = GlobalAlloc(GMEM_MOVEABLE, TmpBitmap.Width * 4);
pOutBuf = (L_UCHAR L_FAR *)GlobalLock( hOutBuf );
/* Get one row of data from the bitmap */
L_AccessBitmap(&TmpBitmap);
L_GetBitmapRow(&TmpBitmap, pInBuf, 0, TmpBitmap.BytesPerLine);
L_ReleaseBitmap(&TmpBitmap);
/* Convert the data from RGB in pInBuf to CMYK in pOutBuf */
L_ConvertColorSpace(pInBuf, pOutBuf, TmpBitmap.Width, CCS_RGB, CCS_CMYK);
/* Free memory that we no longer need */
GlobalUnlock(hInBuf);
GlobalFree(hInBuf);
GlobalUnlock(hOutBuf);
GlobalFree(hOutBuf);
L_FreeBitmap(&TmpBitmap);


L_ConvertFromDDB

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertFromDDB(hDC, pBitmap, uStructSize, hBitmap, hPalette)

HDC hDC; | /* handle to the device responsible for the conversion */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HBITMAP hBitmap; | /* handle to the DDB to be converted */
HPALETTE hPalette; | /* handle to the palette */

Converts a Windows device dependent bitmap (DDB) into a LEAD Technologies bitmap. When this function is completed, there are two copies of the image in memory: the original DDB and the LEAD bitmap. Freeing one will not affect the other.

Parameter | Description
hDC | Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the target LEAD bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hBitmap | Handle to the DDB to be converted.
hPalette | Handle to the palette. This value can be NULL if the hDC parameter refers to a device that is greater than 8 bits, or if the bitmap will use the system palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates information in the bitmap handle and copies the DDB image data into the LEAD bitmap.

Before calling this function, you must declare the LEAD bitmap handle and initialize it, specifying a height and width of 0. However, you should not allocate the bitmap. (If the bitmap is already allocated, you must free it and initialize the bitmap handle again.)

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDIB, L_ConvertToDDB,
 | L_ConvertToDIB, L_ChangeFromDDB,
 | L_ChangeFromDIB, L_ChangeToDDB,
 | L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For a short example, refer to L_ConvertToDDB. For complete sample code, refer to the DIBDDB example.


L_ConvertFromDIB

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertFromDIB(pBitmap, uStructSize, pInfo, pBits)

pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
BITMAPINFO L_FAR * pInfo; | /* pointer to the Windows BITMAPINFO structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_UCHAR L_FAR * pBits; | /* pointer to the DIB image data */

Converts a Windows device independent bitmap (DIB) into a LEAD Technologies bitmap. When this function is completed, there are two copies of the image in memory: the original DIB and the LEAD bitmap. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target LEAD bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pInfo | Long pointer to the Windows BITMAPINFO structure.
pBits | Long pointer to the DIB image data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function updates information in the bitmap handle and copies the DIB image data into the LEAD bitmap.

Before calling this function, you must declare the LEAD bitmap handle and initialize it, specifying a height and width of 0. However, you should not allocate the bitmap. (If the bitmap is already allocated, you must free it and initialize the bitmap handle again.)

This function supports the standard DIB formats (BI_RGB and BI_BITFIELDS) as well as some FOURCC (Four Character Code) formats that some capture cards output.

These are the FOURCC that LEADTOOLS supports at the moment:

YVU9 (YUV9), I420 (YUV12), YUV2 , YV12 , IF09 , IYUV , UYVY , cyuv, YUY2, YVYU, Y41P, Y211, Y41T, Y42T

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertToDDB,
 | L_ConvertToDIB, L_ChangeFromDDB,
 | L_ChangeFromDIB, L_ChangeToDDB,
 | L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For a short example, refer to L_ConvertToDIB. For complete sample code, refer to the DIBDDB example.


L_ConvertFromEMF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertFromEMF(pBitmap, uStructSize, hWmf, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HENHMETAFILE hWmf; | /* handle to the WMF to be converted */
L_UINT uWidth; | /* width */
L_UINT uHeight; | /* height */

Converts a Windows enhanced metafile (WMF) into a LEAD Technologies bitmap. When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap to be updated with the converted file.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hWMF | Handle to the EMF to be converted.
uWidth | Amount by which to scale the metafile’s original width.
UHeight | Amount by which to scale the metafile’s original height.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The enhanced metafile can be loaded at the original dimension or scaled by using the uWidth and uHeight parameters.

If uWidth == 0 and uHeight == 0 - the enhanced metafile is loaded at the size present in the file

If uWidth == 0 and uHeight > 0 - the enhanced metafile is stretched so that it has the height uHeight (preserving the aspect ratio)

If uWidth > 0 and uHeight == 0 - the enhanced metafile is stretched so that it has the width uWidth (preserving the aspect ratio)

If uWidth > 0 and uHeight > 0 - the enhanced metafile is stretched so that it has the width uWidth and height uHeight (the aspect ratio is ignored)

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToEMF, L_ChangeToWMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

/* This example loads a bitmap, converts it to a EMF, then converts
the EMF back to a bitmap
*/

void ConvertEMFToLead(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
BITMAPHANDLE Bitmap; /* Bitmap handle for the initial image */
HENHMETAFILE hEMF;

/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a EMF */
hEMF = L_ConvertToEMF( &Bitmap );

/* Free the initial bitmap */
L_FreeBitmap(&Bitmap);

/* Convert the EMF to create a new LEAD bitmap and preserve the size */
L_ConvertFromEMF(pLeadBitmap, sizeof(BITMAPHANDLE), hEMF, 0, 0);

/* Clean up */
DeleteEnhMetaFile(hEMF);
}


L_ConvertFromWMF

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertFromWMF(pBitmap, uStructSize, hWMF, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
HMETAFILE hWmf; | /* handle to the WMF to be converted */
L_UINT uWidth; | /* width */
L_UINT uHeight; | /* height */

Converts a Windows metafile (WMF) into a LEAD Technologies bitmap. When this function is completed, there are two copies of the drawing in memory: the WMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap to be updated with the converted file.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
hWMF | Handle to the WMF to be converted.
uWidth | Amount by which to scale the metafile’s original width.
UHeight | Amount by which to scale the metafile’s original height.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The metafile can be loaded at the original dimension or scaled by using the uWidth and uHeight parameters.

If uWidth == 0 and uHeight == 0 - the metafile is loaded at the size present in the file

If uWidth == 0 and uHeight > 0 - the metafile is stretched so that it has the height uHeight (preserving the aspect ratio)

If uWidth > 0 and uHeight == 0 - the metafile is stretched so that it has the width uWidth (preserving the aspect ratio)

If uWidth > 0 and uHeight > 0 - the metafile is stretched so that it has the width uWidth and height uHeight (the aspect ratio is ignored)

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToEMF, L_ChangeToWMF,
 | L_ConvertFromEMF, L_ConvertToWMF,
 | L_ConvertToEMF

Example

/* This example loads a bitmap, converts it to a WMF, then converts
the WMF back to a bitmap
*/

void ConvertWMFToLead(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
BITMAPHANDLE Bitmap; /* Bitmap handle for the initial image */
HMETAFILE hWmf;

/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a WMF */
hWmf = L_ConvertToWMF( &Bitmap );

/* Free the initial bitmap */
L_FreeBitmap(&Bitmap);

/* Convert the WMF to create a new LEAD bitmap and preserve the size */
L_ConvertFromWMF(pLeadBitmap, sizeof(BITMAPHANDLE), hWmf, 0, 0);

/* Clean up */
DeleteMetaFile(hWmf);
}


L_ConvertToColoredGray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ConvertToColoredGray(pBitmapHndl, RedFact, GreenFact, BlueFact, RedGrayFact, GreenGrayFact, BlueGrayFact)

pBITMAPHANDLE pBitmapHndl; | /* pointer to a bitmap handle */
L_INT RedFact; | /* red factor */
L_INT GreenFact; | /* green factor */
L_INT BlueFact; | /* blue factor */
L_INT RedGrayFact; | /* additional red factor */
L_INT GreenGrayFact; | /* additional green factor */
L_INT BlueGrayFact; | /* additional blue factor */

Converts a bitmap to a grayscale bitmap, then enhances the color components based on the specified parameters.

Parameter | Description
pBitmapHndl | Pointer to a bitmap handle that references the bitmap to convert.
RedFact | Value that represents the percentage or weight given to the red value of each pixel in the bitmap. Possible values are 0 to 1000.
GreenFact | Value that represents the percentage or weight given to the green value of each pixel in the bitmap. Possible values are 0 to 1000.
BlueFact | Value that represents the percentage or weight given to the blue value of each pixel in the bitmap. Possible values are 0 to 1000.
RedGrayFact | 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.
GreenGrayFact | 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.
BlueGrayFact | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is more general than the L_GrayScaleBitmapExt function. L_ConvertToColoredGray can be used to give images an "sepia" look by adding a blue or brown color.

RedFact + GreenFact + BlueFact 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 RedFact, GreenFact and BlueFact 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 function is called with the RedFact set to 500, the GreenFact set to 250 and the BlueFact 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 RedGrayFact value. The equation for this can be seen below:

Goutput-red = G + G * RedGrayFact / 1000

The green and blue components are found similarly, using the GreenGrayFact and the BlueGrayFact values, respectively.

Please note that the RedGrayFact, GreenGrayFact and BlueGrayFact 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 RedGrayFact = GreenGrayFact = BlueGrayFact = 0, then the output is the same as the output from the L_GrayScaleBitmapExt function.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_BalanceColors, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftone and Halftone Images

Example

/* This example assumes there is a bitmap loaded into Bitmap, which is of type BITMAPHANDLE. */

L_INT nRedFact , nGreenFact , nBlueFact, nRedGrayFact, nGreenGrayFact, nBlueGrayFact;

nRedFact =300;
nGreenFact = 590;
nBlueFact = 110;
nRedGrayFact = 500;
nGreenGrayFact = 300;
nBlueGrayFact = 200;
// These arguments will transform the image into a grayscale image
L_ConvertToColoredGray(&Bitmap, nRedFact, nGreenFact, nBlueFact, nRedGrayFact, nGreenGrayFact, nBlueGrayFact);


L_ConvertToDDB

#include "l_bitmap.h"

HBITMAP EXT_FUNCTION L_ConvertToDDB(hDC, pBitmap)

HDC hDC; | /* handle to the device responsible for the conversion */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */

Converts a LEAD Technologies bitmap into a Windows device dependent bitmap (DDB). When this function is completed, there are two copies of the image in memory: the DDB and the original LEAD bitmap. Freeing one will not affect the other.

Parameter | Description
hDC | Handle to the device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy.

Returns

This function returns a handle to the DDB, or it returns a NULL if there is an error.

Comments

This function allocates a DDB bitmap and copies the LEAD bitmap to the DDB.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB,
 | L_ConvertToDIB, L_ChangeFromDDB,
 | L_ChangeFromDIB, L_ChangeToDDB,
 | L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For complete sample code, refer to the DIBDDB example.

/* This example loads a bitmap, converts it to a DDB, then converts
the DDB back to a bitmap */
void LeadDDBLead(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
HBITMAP hDDB; /* Handle for the DDB */
HPALETTE hPalette; /* Palette handle */
HPALETTE hpalSave; /* Saved palette handle */
HDC hDC; /* Handle to the device context for the current window */
/* Get the device context for the current window */
hDC = GetDC( hWnd );
/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
hPalette = L_CreatePaintPalette(hDC, &TmpBitmap);
if (hPalette)
{
hpalSave = SelectPalette(hDC, hPalette, FALSE);
RealizePalette(hDC);
}
/* Convert the initial bitmap to a DDB */
hDDB = L_ConvertToDDB( hDC, &TmpBitmap );
if (hPalette)
SelectPalette(hDC, hpalSave, FALSE);
/* Free the initial bitmap */
L_FreeBitmap(&TmpBitmap);
/* Convert the DDB to create a new LEAD bitmap */
L_ConvertFromDDB(hDC, pLeadBitmap, sizeof(BITMAPHANDLE), hDDB, hPalette);
/* Clean up */
ReleaseDC( hWnd, hDC );
DeleteObject(hDDB);
DeleteObject(hPalette);
return;
}


L_ConvertToDIB

#include "l_bitmap.h"

HGLOBAL EXT_FUNCTION L_ConvertToDIB(pBitmap, uType)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uType; | /* type of DIB */

Converts a LEAD Technologies bitmap into a Windows device independent bitmap (DIB). When this function is completed, there are two copies of the image in memory: the DIB and the original LEAD bitmap. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.
uType | Flag that indicates the type of DIB to create. Possible values are:
 | 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)

Returns

This function will return a handle to a DIB.

Comments

This function allocates a DIB bitmap and copies the LEAD bitmap to the DIB.

A DIB consists of one of the following:

a BITMAPFILEHEADER,

a BITMAPV4HEADER (introduced in Windows 95 and Windows NT 4.0),

or a 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 uType flag.

The orientation of the image and color order will depend on how the image was loaded into the LEAD bitmap.

If you want to load another image using the same bitmap handle, you must initialize the bitmap handle again.

When you no longer need the DIB, you can free it using the Windows GlobalFree function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertFromDDB, L_ConvertFromDIB,
 | L_ConvertToDDB, L_ChangeFromDDB,
 | L_ChangeFromDIB, L_ChangeToDDB,
 | L_ChangeToDIB
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For complete sample code, refer to the DIBDDB example.

//This example takes a LEAD bitmap, converts it to a V5 DIB and writes
//out the DIB as a bitmap file
#include <io.h>
#include <fcntl.h>

int MySaveFile(HGLOBAL hDIB, L_TCHAR L_FAR* pszFileName)
{
int fp, nSize;
unsigned char *pDIB;
BITMAPFILEHEADER bfh;
PBITMAPINFOHEADER pbih;
int nDIBsize;

nDIBsize = GlobalSize(hDIB);

bfh.bfType = 0x4d42; //"BM";
bfh.bfSize = sizeof(BITMAPFILEHEADER) + nDIBsize;
bfh.bfReserved1 = 0;
bfh.bfReserved2 = 0;

pDIB = (L_UCHAR *)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);

#ifdef UNICODE

fp = _wopen(pszFileName, _O_RDWR | _O_CREAT | _O_BINARY, 0);//_S_IREAD | _S_IWRITE );
#else

fp = _open(pszFileName, _O_RDWR | _O_CREAT | _O_BINARY, 0);//_S_IREAD | _S_IWRITE );

#endif
if (fp == 0)
return FALSE;

nSize = _write( fp, &bfh, sizeof(BITMAPFILEHEADER));
nSize = _write( fp, pDIB, nDIBsize);
_close(fp);

GlobalUnlock(hDIB);
return TRUE;
}

L_VOID ExampleConvertToDIB(pBITMAPHANDLE pBitmap, L_TCHAR L_FAR* pszFileName)
{
HGLOBAL hDIB;
hDIB = L_ConvertToDIB(pBitmap, sizeof(BITMAPHANDLE));
MySaveFile(hDIB, TEXT("e:\\erase\\dib3.bmp"));
GlobalFree(hDIB);
}


L_ConvertToEMF

#include "l_bitmap.h"

HENHMETAFILE EXT_FUNCTION L_ConvertToEMF(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to a bitmap */

Converts a LEAD Technologies bitmap into a Windows enhanced metafile (EMF). When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy.

Returns

This function will return a handle to an enhanced metafile.

Comments

This function allocates an enhanced metafile bitmap and copies the LEAD bitmap to the enhanced Metafile.

When you no longer need the enhanced metafile, you can free it using the Windows DeleteEnhMetaFile function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToEMF, L_ChangeToWMF,
 | L_ConvertFromWMF, L_ConvertToWMF,
 | L_ConvertFromEMF

Example

For an example, refer to L_ConvertFromEMF.


L_ConvertToWMF

#include "l_bitmap.h"

HMETAFILE EXT_FUNCTION L_ConvertToWMF(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to a bitmap */

Converts a LEAD Technologies bitmap into a Windows metafile (WMF). When this function is completed, there are two copies of the drawing in memory: the WMF and the original LEAD vector. Freeing one will not affect the other.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy.

Returns

This function will return a handle to a metafile.

Comments

This function allocates a metafile bitmap and copies the LEAD bitmap to the metafile.

When you no longer need the metafile, you can free it using the Windows DeleteMetaFile function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeFromEMF, L_ChangeFromWMF,
 | L_ChangeToEMF, L_ChangeToWMF,
 | L_ConvertFromWMF, L_ConvertFromEMF,
 | L_ConvertToEMF

Example

For an example, refer to L_ConvertFromWMF.


L_CopyBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyBitmap(pBitmapDst, pBitmapSrc, uStructSize)

pBITMAPHANDLE pBitmapDst; | /* points to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* points to the source bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmapDst */

Copies an entire image of a source bitmap and places it into a destination bitmap. This also copies all fields in the bitmap handle.

Parameter | Description
pBitmapDst | Points to the destination bitmap handle to hold the copied image.
pBitmapSrc | Points to the source bitmap handle. You must have a valid image loaded into the bitmap for this function to work.
uStructSize | Size in bytes, of the structure pointed to by pBitmapDst, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The destination bitmap must not be allocated before this function is called. If the bitmap is already allocated, you must free it.

If a region is defined for the bitmap, the region is also copied.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmapData, L_CopyBitmapHandle,
 | L_CopyBitmapRect
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads TmpBitmap and copies it to LeadBitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Copy the temporary bitmap to the new bitmap */
L_CopyBitmap(&LeadBitmap, &TmpBitmap, sizeof(BITMAPHANDLE));
/* Clean up */
L_FreeBitmap(&TmpBitmap);


L_CopyBitmapData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyBitmapData(pBitmapDst, pBitmapSrc)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */

Copies image data from one bitmap handle to another. Before calling this function, the target bitmap handle must be initialized and allocated.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The target bitmap handle must accurately identify the copied data. Therefore, the initialization function must specify the same bits per pixel, width, and height as the source.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmap, L_CopyBitmapHandle,
 | L_CopyBitmapRect
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

For a short example, refer to L_CreateBitmap. For complete sample code, refer to the FEATURE3 example.


L_CopyBitmapHandle

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_CopyBitmapHandle(pBitmapDst, pBitmapSrc, uStructSize)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmapDst */

Copies one bitmap handle to another. This function copies only the bitmap handle; it does not copy the actual image data.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap to copy.
uStructSize | Size in bytes, of the structure pointed to by pBitmapDst, for versioning. Use sizeof(BITMAPHANDLE).

Returns

None.

Comments

The palette referenced by the hPalette field is not duplicated; the hPalette field is copied the same way as other fields in the bitmap handle.

Note that the destination bitmap does not have to be allocated for this function to work. Use L_CopyBitmapData to copy the contents of the image data from one bitmap to another.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmap, L_CopyBitmapData,
 | L_CopyBitmapRect
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a temporary bitmap and copies its handle to
the new bitmap. Notice that TmpBitmap is not freed, because the new
bitmap handle references the original image data. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Copy bitmap handle to the new bitmap */
L_CopyBitmapHandle(&LeadBitmap, &TmpBitmap, sizeof(BITMAPHANDLE));


L_CopyBitmapListItems

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyBitmapListItems(phList, hList, uIndex, uCount)

pHBITMAPLIST phList; | /* address of the variable to be updated */
HBITMAPLIST hList; | /* handle to an existing list of bitmaps */
L_UINT uIndex; | /* index of the first bitmap to copy */
L_UINT uCount; | /* number of bitmaps to copy */

Creates a new bitmap list by copying the specified bitmaps from an existing list. Bitmap handles and image data are copied.

Parameter | Description
phList | Address of the variable to be updated with the new list of bitmaps.
hList | Handle to the list of bitmaps to copy from.
uIndex | Index of the first bitmap to copy.
uCount | Number of bitmaps to copy. You can specify (L_UINT) -1 to copy to the end of the existing list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList,
 | L_CreateBitmapList, L_DestroyBitmapList,
 | L_GetBitmapListCount, L_InsertBitmapListItem,
 | L_RemoveBitmapListItem, L_DeleteBitmapListItems,
 | L_GetBitmapListItem, L_SetBitmapListItem,
 | L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/* This example copies all but the first two bitmaps in a list of bitmaps;
then calls another function to save the copied list. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the playback target */
void TestCopyList(HBITMAPLIST hList)
{
HBITMAPLIST hNewList;
/* Copy all but the first two bitmaps of the incoming list */
L_CopyBitmapListItems(&hNewList, hList, 2, (L_UINT) -1);
/* Call a local function to save the new list */
TestSaveList(hNewList); /* Refer to the L_SaveBitmapList example */
return;
}


L_CopyBitmapPalette

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyBitmapPalette(pBitmapDst, pBitmapSrc)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */

Copies the palette of a source bitmap and places it into a destination bitmap. Only the palette field of the bitmap handle is copied.

Parameter | Description
pBitmapDst | Pointer to the destination bitmap handle into which the palette will be copied. You must have a valid image loaded into the bitmap for this function to work.
pBitmapSrc | Pointer to the source bitmap handle. You must have a valid image loaded into the bitmap for this function to work.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The destination bitmap must be allocated and must be 8-bit or less before this function is called. The source bitmap and destination bitmap must have the same bits per pixel. The destination bitmap’s existing palette will be destroyed before the copy is made. When the destination bitmap is freed, the palette will also be destroyed.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmapData, L_CopyBitmapHandle, L_CopyBitmapRect, L_CopyBitmap, L_DupBitmapPalette
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

For an example, refer to L_ResizeBitmap.


L_CopyBitmapRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyBitmapRect(pBitmapDst, pBitmapSrc, uStructSize, nCol, nRow, uWidth, uHeight)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmapDst */
L_INT nCol; | /* x coordinate origin of the rectangle to copy */
L_INT nRow; | /* Y coordinate origin of the rectangle to copy */
L_UINT uWidth; | /* width of the rectangle to copy (in pixels) */
L_UINT uHeight; | /* height of the rectangle to copy (in pixels) */

Copies a portion of a bitmap to create another bitmap that is the size of the rectangle that you specify.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap.
 | You do not have to initialize the bitmap handle; the L_CopyBitmapRect function initializes it for you.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmapDst, for versioning. Use sizeof(BITMAPHANDLE).
nCol | The X coordinate of the pixel within the source bitmap that is the origin of the rectangle to copy.
nRow | The Y coordinate of the pixel within the source bitmap that is the origin of the rectangle to copy.
uWidth | Width of the rectangle to copy (in pixels).
uHeight | Height of the rectangle to copy (in pixels).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function duplicates the original bitmap's palette, if one is required in the new bitmap.

This function uses bitmap coordinates to specify the area to be copied. Therefore, you must account for the view perspective of the bitmap. For information about bitmap coordinates, refer to Accounting for View Perspective.

If a region is defined for the source bitmap, the region is also copied, and the region is clipped if necessary.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AutoTrimBitmap, L_GetAutoTrimRect, L_TrimBitmap,
 | L_CopyBitmap, L_CopyBitmapData,
 | L_CopyBitmapHandle
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

/* This example uses L_CopyBitmapRect to copy a rectangle that would
appear in the upper left part of the displayed image. */
L_INT CopyBitmapRect (L_TCHAR L_FAR * szFilename, BITMAPHANDLE * pBitmap)
{
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */
L_INT XOffset; /* Column offset of the rectangle to process */
L_UINT XSize; /* Pixel width of the rectangle to process */
L_INT YOffset; /* Row offset of the rectangle to process */
L_UINT YSize; /* Pixel height of the rectangle to process */
RECT rc; /* rect for converting coordinates */
L_INT nRet = 1;
/* Load the bitmap, at its own bits per pixel */
nRet = L_LoadBitmap (szFilename, &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Specify a rectangle in the top left part of the displayed image */
XOffset = BITMAPWIDTH (&TmpBitmap) / 8;
XSize = BITMAPWIDTH (&TmpBitmap) / 3;
YOffset = BITMAPHEIGHT (&TmpBitmap) / 8;
YSize = BITMAPHEIGHT (&TmpBitmap) / 3;
rc.left = XOffset;
rc.top = YOffset;
rc.right = XSize + rc.left;
rc.bottom = YSize + rc.top;
/* Make sure the coordinates are in the ViewPerspective of the Bitmap */
nRet = L_RectToBitmap ( &TmpBitmap, TOP_LEFT, &rc );
XOffset = rc.left;
YOffset = rc.top;
XSize = rc.right - rc.left;
YSize = rc.bottom - rc.top;
/* Copy the rectangle */
L_CopyBitmapRect(pBitmap, &TmpBitmap, sizeof(BITMAPHANDLE), XOffset, YOffset, XSize, YSize);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
return nRet;
}


L_CopyFromClipboard

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_CopyFromClipboard(hWnd, pBitmap, uStructSize)

HWND hWnd; | /* handle to the active window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Copies image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB, DDB, or aWMF.

Parameter | Description
hWnd | Handle to the active window.
pBitmap | Pointer to the bitmap handle referencing the bitmap to fill. This function will allocate the storage to hold the image.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The LEAD bitmap is referenced by the pointer to the bitmap handle. The bitmap will contain the same width, height, and bits per pixel as the image contained in the clipboard. The color order field in the bitmap handle will be set to ORDER_BGR. If the copied image is not in BGR order, it is up to you to change its color order using L_ColorResBitmap.

The destination bitmap must not be allocated before this function is called. If the bitmap is already allocated, you must free it and initialize the bitmap handle.

To determine whether a region was pasted, you must call L_BitmapHasRgn(pBitmap).

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ClipboardReady, L_CopyToClipboard,
 | L_CopyToClipboard
Topics: | Using DIBs, DDBs, and the Clipboard

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

/* This example loads a bitmap using clipboard data, if available */
L_BOOL PasteImage(HWND hWnd, pBITMAPHANDLE pLeadBitmap)
{
if (L_ClipboardReady ())
{
/* Copy the bitmap from the clipboard */
L_CopyFromClipboard(hWnd, pLeadBitmap, sizeof(BITMAPHANDLE));
return(TRUE);
}
else
{
return(FALSE);
}
}


L_CopyMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyMarkers(phMarkersDst, hMarkersSrc)

HANDLE L_FAR * phMarkersDst; | /* destination markers handle */
HANDLE hMarkersSrc; | /* source markers handle */

Copies the specified collection of metadata markers to a new handle.

Parameter | Description
phMarkersDst | Pointer to a variable to be updated with a handle to a copy of the specified markers.
hMarkersSrc | Handle to the collection of metadata markers to copy.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The new handle will be copied to *phMarkersDst.

If hMarkersSrc is NULL or if the function fails, phMarkersDst will be NULL.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_FreeMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

void CopyMarkers (HANDLE hMarkersCopy, HANDLE hMarkerSrc)

{
// Copy markers collection into the desitation handle
L_CopyMarkers(&hMarkersCopy, hMarkerSrc);

}


L_CopyToClipboard

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CopyToClipboard(hWnd, pBitmap, uFlags)

HWND hWnd; | /* handle to the active window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* indicates how image data is placed on the clipboard */

Copies the RGB or raster image data from a specified bitmap to the clipboard. With this extended function, you can control how image data is placed on the clipboard.

Parameter | Description
hWnd | Handle to the active window.
pBitmap | Pointer to the bitmap handle referencing the bitmap to be copied.
uFlags | Indicates how image data is placed on the clipboard. You can use a bitwise OR ( | ) to pass more than one value. Valid values are:
 | Value | Meaning
 | COPY2CB_EMPTY | [0x0001] Empty the clipboard before copying data to it.
 | COPY2CB_DIB | [0x0002] Copy DIB data to the clipboard.
 | COPY2CB_DDB | [0x0004] Copy DDB data to the clipboard.
 | COPY2CB_PALETTE | [0x0008] Copy palette data to the clipboard.
 | COPY2CB_RGN | [0x0010] Copy the bitmap's region to the clipboard.
 | If you specify all of the values it is the same as using the L_CopyToClipboard function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The clipboard will contain the same width, height, bits per pixel, and color order as the image in the bitmap.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ClipboardReady, L_CopyFromClipboard,
 | L_CopyToClipboard
Topics: | Using DIBs, DDBs, and the Clipboard

Example

/* This example loads a bitmap, copies only the DIB data to the clipboard,
and deletes the original bitmap */
void CopyDIB(HWND hWnd)
{
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap, keeping its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Copy the bitmap to the clipboard */
L_CopyToClipboard (hWnd, &LeadBitmap, COPY2CB_EMPTY | COPY2CB_DIB);
/* Delete the original bitmap, leaving the copy in the clipboard */
L_FreeBitmap(&LeadBitmap);
}


L_CorrelationBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CorrelationBitmap(pBitmap, pCorBitmap, pPoints, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE pCorBitmap; | /* pointer to the correlation bitmap handle */
POINT L_FAR * pPoints; | /* pointer to an array of points */
L_UINT uMaxPoints; | /* array size */
L_UINT L_FAR * puNumOfPoints; | /* pointer to the array size */
L_UINT uXStep; | /* size of the X step */
L_UINT uYStep; | /* size of the Y step */
L_UINT uThreshold; | /* threshold */

This function compares pCorBitmap (or part of pCorBitmap) with all the areas of the same dimensions in pBitmap and finds those portions that match according to the measure of correlation. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be searched.
pCorBitmap | Pointer to the bitmap handle that references the bitmap for which to search.
pPoints | Pointer to an array of points. This array will be filled with the starting points for the correlated areas.
uMaxPoints | Size of the point array. This is also equal to the maximum number of regions in pBitmap that can be found to be correlated.
puNumOfPoints | Pointer to a variable to be updated with the number of areas in pBitmap actually found to be correlated to pCorBitmap. Its maximum value is uMaxPoints.
uXStep | Step size in the X direction (along image width), in pixels. For best results, use 1.
uYStep | Step size in the Y direction (along image height), in pixels. For best results, use 1.
uThreshold | 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 pCorBitmap and an area in pBitmap is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function compares pCorBitmap (or a part of pCorBitmap) with all the areas of the same dimensions in pBitmap and finds those areas 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 function updates the pPoints parameter with the point of origin for those areas of pBitmap where the resemblance with pCorBitmap (or part of pCorBitmap) is greater than the value of uThreshold. The pCorBitmap dimensions must be less than or equal to the pBitmap dimensions.

For example:

1.

Select a bitmap of the object for which you want to look. Put it in pCorBitmap

For example:

2.

Select a bitmap that contains the object for which you are searching and put it in pBitmap

For example:

3. | Call L_CorrelationBitmap.
4. | The function will update the pPoints array parameter with the point of origin (top-left) for each area of the bitmap pBitmap where the correlation with pCorBitmap is greater than the correlation threshold. The height and width of the rectangles are the same as for pCorBitmap.
5. | The result is:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap
Topics: | Processing an Image
 | Raster Image Functions: Comparing Images
 | Color Halftone and Halftone Images
 | Raster Image Functions: Processing an Image

Example

/* This example loads bitmaps, and applies the correlation filter */
BITMAPHANDLE LeadBitmap;
BITMAPHANDLE CorBitmap;
POINT pPoints[10] = {0};
L_UINT uNumOfPoints;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("REDISTRIBUTABLE.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_LoadBitmap(TEXT("T.CMP"), &CorBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Apply the correlation filter*/
L_CorrelationBitmap(&LeadBitmap, &CorBitmap, pPoints, 90 , &uNumOfPoints, 1, 2, 10);


L_CorrelationListBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CorrelationListBitmap(pBitmap, hCorList, pPoints, puListIndex, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
HBITMAPLIST hCorList; | /* correlation list handle */
POINT L_FAR * pPoints; | /* pointer to an array of points */
L_UINT L_FAR * puListIndex; | /* pointer to index array */
L_UINT uMaxPoints; | /* array size */
L_UINT L_FAR * puNumOfPoints; | /* pointer to the array size */
L_UINT uXStep; | /* size of the X step */
L_UINT uYStep; | /* size of the Y step */
L_UINT uThreshold; | /* threshold */

Compares the images in hCorList with all the areas of the same dimensions in pBitmap and finds those portions that match according to the measure of correlation.

This function is available only in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be searched.
hCorList | Bitmap list handle that contains the images for which to search. All the images in the list should have the same dimensions.
pPoints | Pointer to an array of points. This array will be filled with the starting points for the correlated areas.
puListIndex | Pointer to an array of unsigned integers. This array will be filled with the indices of the images that match correlated areas.
uMaxPoints | Size of the point array. This is also equal to the maximum number of regions in pBitmap that can be found to be correlated.
puNumOfPoints | Pointer to a variable to be updated with the number of areas in pBitmap that correlate to an image in pCorBitmap. Its maximum value is uMaxPoints.
uXStep | Step size in the X direction (along image width), in pixels. For best results, use 1.
uYStep | Step size in the Y direction (along image height), in pixels. For best results, use 1.
uThreshold | 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 hCorList and an area in pBitmap is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function compares the images in hCorList with all the areas of the same dimensions in pBitmap and finds those areas that match according to the measure of correlation. All the images in hCorList 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 function updates the pPoints parameter with the point of origin for those areas of pBitmap where the resemblance with an image in hCorList is greater than the value of uThreshold and also updates puListIndex with the index of that image. The dimensions of the hCorList images must be less than or equal to the pBitmap dimensions.

For example:

1. Select bitmaps of the objects for which you want to look. Put them in hCorList.

For example:

2. Select a bitmap that contains the objects for which you are searching and put it in pBitmap.

For example:

3. Call the L_CorrelationListBitmap function.

4. The function will update the pPoints array parameter with the point of origin (top-left) for each area of the bitmap pBitmap where the correlation with the image in hCorList is greater than the correlation threshold. The height and width of the rectangles are the same as for hCorList image.

5. The result is:

To look for one object in a bitmap, use the L_CorrelationBitmap function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_CorrelationBitmap
Topics: | Processing an Image
 | Raster Image Functions: Comparing Images
 | Raster Image Functions: Processing an Image

Example

/* The following example loads a bitmap, and applies the correlation list filter: */BITMAPHANDLE LeadBitmap;BITMAPHANDLE TmpBitmap;
HBITMAPLIST hCorList;POINT pPoints[10] = {0};
L_UINT puListIndex [10] = {0};L_UINT uNumOfPoints;/* Load the bitmap, keeping the bits per pixel of the file */L_LoadBitmap(TEXT("REDISTRIBUTABLE.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);L_LoadBitmap (TEXT("T.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);L_CreateBitmapList(&hCorList);
L_InsertBitmapListItem(hCorList, (L_UINT)-1, &TmpBitmap); /*Apply the correlation filter*/L_CorrelationListBitmap(&LeadBitmap, hCorList, pPoints, puListIndex, 90 , &uNumOfPoints, 1, 2, 10);
L_DestroyBitmapList(hCorList);


L_CountLUTColors

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CountLUTColors(pLUT, ulLLUTLen, puNumberOfEntries, pFirstIndex, uFlags);

RGBQUAD L_HUGE * pLUT; | /* lookup table */
L_UINT32 ulLLUTLen; | /* LUT length */
L_UINT L_FAR * pNumberOfEntries; | /* pointer to a variable to be updated */
L_UINT L_FAR * pFirstIndex; | /* pointer to a variable to be updated */
L_UINT uFlags; | /* flags */

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.

Parameter | Description
pLUT | Pointer to a lookup table.
ulLLUTLen | LUT length.
puNumberOfEntries | Pointer to a variable to be updated with total number of entries in start to end color.
puFirstIndex | Pointer to a variable to be updated with index of the last occurrence of the start color.
uFlags | Flag that indicates the LUT is belong to signed or unsigned image. Possible values are:
 | Value | Meaning
 | COUNT_LUT_UNSIGNED | [0x0001] Belong to signed image.
 | COUNT_LUT_SIGNED | [0x0002] Belong to unsigned image.

Returns

SUCCESS | LUT is Linear (success).
0 | LUT is not linear (fail).
<0 | An error occurred. Refer to Return Codes.

Comments

Suppose you have a LUT with 4096 colors, the first 200 colors are black and the last 30 are white, the rest of the colors between black and white are gray. This is what the function will provide :

pNumberOfEntries : | 3868.
pFirstIndex : | 199.

In more detail this is:

Total number of entries: 4096 (0 – 4095)

First index of the end color: 4095 – 30 + 1 (+1 to add the first index of the end color to the range)

Number of occurrences of the starting color: 200 (0 – 199)

The last index of the start color: 199

Total number of entries: (4095 – 30 + 1) – 199 + 1

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowLevel, L_WindowLevelFillLUT, L_GetUserLookupTable, L_RemapBitmapIntensity, L_ApplyLinearVOILUT
Topics: | Raster Image Functions: Palettes

Example

/* get bitmap pLUT total number of entries in start to end colors and the index of the last occurrence of the start color.*/
L_INT TestFunction(pBITMAPHANDLE pBitmap, L_UINT * pNumberOfEntries, L_UINT *pFirstIndex)
{
return L_CountLUTColors(pBitmap->pLUT, pBitmap->LUTLength, pNumberOfEntries, pFirstIndex, pBitmap->Flags.Signed? COUNT_LUT_SIGNED : COUNT_LUT_UNSIGNED);
}


L_CreateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateBitmap(pBitmap, uStructSize, uMemory, uWidth, uHeight, uBitsPerPixel, uOrder, pPalette, uViewPerspective, pData, dwSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */
L_UINT uMemory; | /* flag to request the type of memory to allocate */
L_UINT uWidth; | /* width of the bitmap in pixels */
L_UINT uHeight; | /* height of the bitmap in pixels */
L_UINT uBitsPerPixel; | /* number of bits per pixel */
L_UINT uOrder; | /* color order for 16-, 24-, 32, 48, and 64-bit bitmaps */
LPRGBQUAD pPalette; | /* pointer to the palette that the bitmap will use */
L_UINT uViewPerspective; | /* where the beginning of the image is stored */
L_UCHAR L_FAR *pData; | /* data pointer */
L_UINT32 dwSize; | /* size of the data buffer pointed to by pData */

Initializes and allocates a bitmap, without loading any data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be created.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
uMemory | Flags that indicate the type of memory to allocate. The following are valid values:
 | Value | Meaning
 | TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk.
 | TYPE_USER | [0x0002] Create a bitmap where the user maintains the data pointer.
 | TYPE_DISK | [0x0080] Do not use conventional memory. Swap to disk only.
 | TYPE_NODISK | [0x0100] Do not swap to disk using LEAD's virtual memory. Windows virtual memory is not affected.
 | TYPE_COMPRESSED | [0x0200] (Document/Medical only) Allocate an RLE-compressed bitmap. You can use this flag with TYPE_CONV or TYPE_NODISK. For more information, refer to Speeding Up 1-Bit Documents.
 | TYPE_SUPERCOMPRESSED | [0x0400] (Document/Medical only) Keep images compressed in memory. This option causes slow access, but very low memory usage. This option is available for 1-bit, 8-bit grayscale, and 24-bit images only.
uWidth | Width of the bitmap in pixels.
uHeight | Height of the bitmap in pixels.
uBitsPerPixel | The number of bits per pixel. Valid values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32, 48, and 64.
 | Use 0 to create an 8-bit grayscale bitmap. In that case, the function ignores the uOrder and pPalette parameters.
uOrder | Color order for 16-, 24-, 32-, 48- and 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order.
 | The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_ROMM | [5] ROMM order in memory. ROMM only supports 24 and 48-bit images.
pPalette | Pointer to the palette that the bitmap will use. You can specify your own palette, or use NULL for LEAD's fixed palette.
uViewPerspective | Where the beginning of the image is stored. Most file formats start in the lower left corner while some formats start in the upper left corner. For valid values, refer to Accounting for View Perspective.
pData | Data pointer that will contain the bitmap data when uMemory is TYPE_USER. This data must be aligned on a four byte boundary. If pData is NULL, the data pointer must be passed later, by calling L_SetBitmapDataPointer, before the bitmap can be used.
dwSize | Size of the data buffer pointed to by pData. This should be at least pBitmap->Size. This parameter is only valid when uMemory is set to TYPE_USER.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

You can specify 0 bits per pixel to create an 8-bit grayscale bitmap. In that case, the function ignores the uOrder and pPalette parameters.

Creating a bitmap of type TYPE_USER does not allocate memory for the bitmap. Instead, the data pointer pData is used.

There is some speed penalty (loss) for accessing tiled bitmaps. Therefore, it is not recommended for use with all bitmaps.

The tiled bitmaps are not used by default. LEADTOOLS will create them only if it failed to create conventional bitmaps and TYPE_NOTILED was not specified.

There are now three distinct types of bitmaps:

a. | Conventional (uncompressed and contiguous) This is the most common type.
b. | Compressed (1-bit only)
c. | Tiled (uncompressed, stored internally as up to 64MB tiles)

If you pass TYPE_USER, you are responsible for freeing the bitmap data. L_FreeBitmap will not do this for you.

Some image processing functions, such as L_RotateBitmap and L_ColorResBitmap, need to re-allocate the image data. If you create a bitmap with TYPE_USER, and pass it to these functions, they will change the bitmap to TYPE_CONV and re-allocate the memory. Your original pData will no longer be used.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_InitBitmap, L_AllocateBitmap, L_FreeBitmap
Topics: | Raster Image Functions: Creating and Deleting Images

Example

/* This example loads a temporary bitmap, creates a new bitmap, and copies the temporary bitmap’s
image data to the new bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
RGBQUAD Palette[256]; /* Palette for the final image */
/* Load a bitmap at 8 bits per pixel so that we can demonstrate palette handling */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);
/* Load the new palette */
L_GetBitmapColors(&TmpBitmap, 0, 256, Palette);
/* Create the new bitmap */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE),TYPE_CONV,
TmpBitmap.Width,
TmpBitmap.Height,
TmpBitmap.BitsPerPixel,
TmpBitmap.Order,
Palette,
TmpBitmap.ViewPerspective, NULL, 0);
/* Copy image data to the new bitmap */
L_CopyBitmapData(&LeadBitmap, &TmpBitmap);
/* Clean up */
L_FreeBitmap(&TmpBitmap);


L_CreateBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateBitmapList(phList)

pHBITMAPLIST phList;

/* address of the variable to be updated */

Creates an empty list of LEAD bitmaps. The list can then be built and maintained with related functions.

Parameter | Description
phList | Address of the HBITMAPLIST variable for the new list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList,
 | L_DestroyBitmapList, L_GetBitmapListCount,
 | L_CopyBitmapListItems, L_InsertBitmapListItem,
 | L_RemoveBitmapListItem, L_DeleteBitmapListItems,
 | L_GetBitmapListItem, L_SetBitmapListItem,
 | L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/* This example creates a bitmap list from the current bitmap, rotating each copy by 10 degrees.
It defines the rotation fill color as a transparent color, and assigns an animation background color.
It then plays the animation, using the current bitmap as the target. */
HPALETTE hpalPaint; /* Paint palette handle. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image. */
void TestFunction(HWND hWnd)
{
HBITMAPLIST hList; /* Bitmap list */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for building the list */
L_INT nMax = 160; /* Maximum width or height for bitmaps in the list */
HPLAYBACK hPlayback; /* Animation playback */
L_UINT uState; /* Next state in the playback */
RECT rcUpdate; /* Source clipping rectangle used in playback */
RECT rcDisplay; /* Display rectangle used in playback */
HDC hdc; /* Device context of the current window */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
RGBQUAD TmpPalette[1]; /* Palette to define the transparent color */
L_INT i; /* Loop counter */
/* Reduce memory requirements, if necessary. Only small bitmaps play smoothly. */
if (LeadBitmap.Width > nMax)
L_SizeBitmap (&LeadBitmap, nMax, (LeadBitmap.Height * nMax) / LeadBitmap.Width, SIZE_RESAMPLE);
else if (LeadBitmap.Height > nMax)
L_SizeBitmap (&LeadBitmap, (LeadBitmap.Width * nMax) / LeadBitmap.Height, nMax, SIZE_RESAMPLE);
/* Dither to an optimized palette, leaving the last color blank to use
later for transparency */
L_ColorResBitmap(&LeadBitmap, &LeadBitmap, sizeof(BITMAPHANDLE), 8,
CRF_FLOYDSTEINDITHERING|CRF_OPTIMIZEDPALETTE|CRF_IDENTITYPALETTE,
NULL, NULL, 255, NULL, NULL);
/* Set the transparent color in the last position of the palette */
TmpPalette[0].rgbBlue = (BYTE) 202;
TmpPalette[0].rgbGreen = (BYTE) 222;
TmpPalette[0].rgbRed = (BYTE) 212;
L_PutBitmapColors(&LeadBitmap, 255, 1, TmpPalette);
/* Create the paint palette */
hdc = GetDC (hWnd);
hpalPaint = L_CreatePaintPalette (hdc, &LeadBitmap);
ReleaseDC (hWnd, hdc);
/* Set the playback flags that will apply to all bitmaps in the list */
LeadBitmap.Flags.WaitUserInput = FALSE;
LeadBitmap.Flags.Transparency = TRUE;
LeadBitmap.Left = 0;
LeadBitmap.Top = 0;
LeadBitmap.Delay = 10;
LeadBitmap.Transparency = PALETTEINDEX(255); /* Last color in the palette */
LeadBitmap.DisposalMethod = PLAYDISPOSE_RESTOREBACKGROUND;
/* Create and populate the bitmap list */
L_CreateBitmapList(&hList);
for (i = 0; i <= 36; ++ i)
{
L_CopyBitmap(&TmpBitmap, &LeadBitmap, sizeof(BITMAPHANDLE));
/* Rotate, using the transparent color as the fill color */
L_RotateBitmap (&TmpBitmap, 1000 * i, 0, PALETTEINDEX(255));
L_InsertBitmapListItem(hList, (L_UINT)-1, &TmpBitmap);
}
/* Set the background color for the animation playback */
LeadBitmap.Background = RGB(0,0,255);
/* Use the client area as the display rectangle */
GetClientRect(hWnd,&rcDisplay);
/* Create and run the playback */
L_CreatePlayback(&hPlayback, &LeadBitmap, hList);
do
{
L_ProcessPlayback(hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_POSTRENDER:
L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE);
hdc = GetDC(hWnd);
if (hpalPaint)
{
hPalette = SelectPalette (hdc, hpalPaint, TRUE);
RealizePalette(hdc);
}
L_PaintDC (hdc, &LeadBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY);
if (hpalPaint)
SelectPalette (hdc, hPalette, TRUE);
ReleaseDC(hWnd, hdc);
break;
}
} while(uState != PLAYSTATE_END);
/* Clean up */
L_DestroyPlayback(hPlayback, NULL);
L_DestroyBitmapList(hList);
return;
}


L_CreateFadedMask

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateFadedMask(pBitmap, uStructSize, pMaskBitmap, nLength, nFadeRate, nStepSize, nInflate, uFlag, nMaxGray, crTransparent)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE pMaskBitmap; | /* pointer to a bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pMaskBitmap */
L_INT nLength; | /* extent of the fade */
L_INT nFadeRate; | /* fade rate */
L_INT nStepSize; | /* step size */
L_INT nInflate; | /* expansion value */
L_UINT uFlag; | /* flag */
L_INT nMaxGray; | /* maximum value of the fade color */
COLORREF crTransparent; | /* transparent color */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to a bitmap handle. This bitmap must have a region.
pMaskBitmap | Pointer to a bitmap handle that references a 24-bit bitmap in which the fade mask will be created.
uStructSize | Size in bytes, of the structure pointed to by pMaskBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nLength | Value that represents the extent of the fade, in pixels.
nFadeRate | Value that represents the rate at which the color will fade with each step. Values are between 0 and 255.
nStepSize | Step size at which the color will change. This value is in pixels.
nInflate | Value used to expand the resulting bitmap. This parameter is valid only when FADE_OUTER is set in the uFlag parameter.
uFlag | 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
nMaxGray | The maximum value of the fade color. Possible values are between 0 and 255.
crTransparent | COLORREF variable that contains the transparency color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_FeatherAlphaBlendBitmap function 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 nInflate value and the fade starts at the edge of the region and progresses toward the edge of the fade mask bitmap. (The nInflate parameter is used only with FADE_OUTER flag)

In order to use the fade mask bitmap in the L_FeatherAlphaBlendBitmap function 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 fill 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

For examples of fade masks created using various flags, click here.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_FeatherAlphaBlendBitmap, L_AlphaBlendBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Using Color Values in LEADTOOLS
 | Using the L_CreateFadedMask Function
 | Raster Image Functions: Processing an Image

Example

For an example, refer to L_FeatherAlphaBlendBitmap.


L_CreateICCTagData

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_CreateICCTagData(pDestTagData, pSrcTagData, uTypeSig)

L_UCHAR L_FAR * pDestTagData; | /* pointer to a destination buffer */
L_UCHAR L_FAR * pSrcTagData; | /* pointer to a source buffer */
L_UINT32 uTypeSig; | /* a value that indicates the tag type signature */

Creates an ICC tag.

Parameter | Description
pDestTagData | A pointer to a buffer to be updated with the newly created tag.
pSrcTagData | A pointer to a buffer that contains the original tag data.
uTypeSig | A value that indicates the signature of the tag type to be created. Possible values include private tag types and the values listed in ICCTAGTYPESIGNATURE.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function does not insert a tag into the ICC profile. It only creates a tag and updates the pDestTagData parameter with a pointer to the newly created tag. This is cast to the desired tag type.

This function converts the original source data, which is in little Indian format, into the ICC profile format, which is in big Indian format.

Before exiting the program, call L_FreeICCTagType to free the contents of the allocated pDestTagData. In addition, the user should free the pDestTagData pointer itself, since the user allocated it.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GenerateICCPointer , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This function will create a */
SYSTEMTIME systemTime;
ICCTAG_DATE_TIME_TYPE iccSrcDateTimeType;
ICCTAG_DATE_TIME_TYPE iccDstDateTimeType;
// Preparing the structure
GetSystemDate(&systemTime);
IccSrcDateTimeType.DateTime.uYear = SystemTime.wYear;
IccSrcDateTimeType.DateTime.uMonth = SystemTime.wMonth;
IccSrcDateTimeType.DateTime.uDay = SystemTime.wDay;
IccSrcDateTimeType.DateTime.uHours = SystemTime.wHour;
IccSrcDateTimeType.DateTime.uMinutes = SystemTime.wMinute;
IccSrcDateTimeType.DateTime.uSeconds = SystemTime.wSecond;
// Creating tag type data
L_CreateICCTagData((L_UCHAR L_FAR *) &iccDstDateTimeType, (L_UCHAR L_FAR *) & iccSrcDateTimeType, DATETIMETYPESIG);
// Freeing the tag type
L_FreeICCTagData((L_UCHAR L_FAR *) &iccDstDateTimeType) ;


L_CreateImageListControl

#include "ltlst.h"

HWND EXT_FUNCTION L_CreateImageListControl(dwStyle, x, y, nWidth, nHeight, hWndParent, nID, crBack)

L_UINT32 dwStyle; | /* window style */
L_INT x; | /* horizontal position of window */
L_INT y; | /* vertical position of window */
L_INT nWidth; | /* window width */
L_INT nHeight; | /* window height */
HWND hWndParent; | /* handle to parent window */
L_INT nID; | /* control ID */
COLORREF crBack; | /* background color of control */

Creates the image list control as a child of the specified parent window.

Parameter | Description
dwStyle | Window styles for the ImageList Control window. This can by any normal window style, or ImageList style. For more information on ImageList styles, refer to LTIMAGELISTCLASS Registered Class: Styles.
x | Original horizontal position for the ImageList Control window.
y | Original horizontal position for the ImageList Control window.
nWidth | Original width for the ImageList Control window.
nHeight | Original height for the ImageList Control window.
hWndParent | Window handle of the parent window for the ImageList Control.
nID | ID for the ImageList Control. You can use this to identify the control when you process WM_COMMAND notification messages that the control will send to it's parent window.
crBack | The background color for the ImageList Control window.

Returns

> 0 | The function was successful, and returns the handle to the ImageList Control window.
< 0 | An error occurred. Refer to Return Codes.

Comments

You can destroy the ImageListControl window using the Windows function DestroyWindow.

When the ImageList Control DLL loads, it registers a window class. The name for the ImageListControl window is:

#ifdef WIN32
#define LTIMGLISTCLASS TEXT("LEADIMGLIST32")
#else
#define LTIMGLISTCLASS TEXT("LEADIMGLIST16")
#endif

You can use this class name to create an ImageList Control in your application's resource file (.RC). If you specify an ID when creating the control, you can use the Windows function GetDlgItem to get the window handle of the ImageListControl.

Note: In WIN32 versions, the window is created with the WS_EX_CLIENTEDGE style by default. To change this, you can use the Windows function SetWindowLong.

Note: The ImageList Control Window Class allocates 8 bytes of user data. The first 4 bytes are reserved, but the second 4 bytes can be used by your application. Use SetWindowLong to set these values.

Required DLLs and Libraries

LTIMG
LTLST

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_UseImageListControl
Topics: | ImageList Control Messages
 | ImageList Control Command Notifications
 | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

#define IDC_LEADIMAGELIST 1200
HWND hCtl;

L_VOID CreateCtl(HWND hWnd)
{
/* create the image list control */
hCtl = L_CreateImageListControl(WS_CHILD|WS_VISIBLE|WS_BORDER,
10, /* x location */
10, /* y location */
250, /* width */
250, /* height */
hWnd, /* parent window */
IDC_LEADIMAGELIST, /* control ID */
RGB(128,128,128)); /* background color */
if(!IsWindow(hCtl))
MessageBox(hWnd, TEXT("Error creating control"), TEXT("Error"), MB_OK);
}


L_CreateLeadDC

#include "l_bitmap.h"

HDC EXT_FUNCTION L_CreateLeadDC(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the LEAD bitmap handle */

Provides a powerful set of graphics features by creating a Microsoft Windows device context, using the specified bitmap as the display surface.

Parameter | Description
pBitmap | Pointer to the LEAD bitmap handle referencing the image data.

Returns

>0 | Function was successful. The return value is the HDC.
NULL | An error occurred.

Comments

This allows you to create an infinite number of 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. The HDC must be freed with the L_DeleteLeadDC function.

Note:

For WIN32 applications, this function ensures that the bitmap's view perspective is BOTTOM_LEFT, flipping the bitmap if necessary. This can affect functions that use bitmap coordinates. For more information, refer to Accounting for View Perspective.

If a region is defined for the bitmap, GDI functions act only on the region, not on the entire bitmap.

The DIB driver supports only 1, 4, 8, 16 and 24 bit images. If you are using an image that has some other number of bits per pixel, you must use L_ColorResBitmap to change the image to a bits per pixel value supported by the DIB driver.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DeleteLeadDC
Topics: | Processing an Image
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the DRAW example.

/* This example uses GDI functions to draw an ellipse on the bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HDC LeadDC; /* Device context for the LEAD bitmap */
int StartGDIX, StartGDIY, EndGDIX, EndGDIY; /* Drawing coordinates */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Create the device context */
LeadDC = L_CreateLeadDC(&LeadBitmap);
/* Set the drawing coordinates in the top left quadrant of the bitmap */
StartGDIX = BITMAPWIDTH(&LeadBitmap) / 8;
EndGDIX = BITMAPWIDTH(&LeadBitmap) / 2;
StartGDIY = BITMAPHEIGHT(&LeadBitmap) / 8;
EndGDIY = BITMAPHEIGHT(&LeadBitmap) / 2;
/* Convert the coordinates if necessary */
if (LeadBitmap.ViewPerspective != TOP_LEFT)
{
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, & StartGDIX, & StartGDIY );
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, & EndGDIX, & EndGDIY );
}
/* Draw the ellipse */
SelectObject(LeadDC, GetStockObject(WHITE_PEN));
SelectObject(LeadDC, GetStockObject(NULL_BRUSH));
SetROP2(LeadDC, R2_NOT);
Ellipse(LeadDC, StartGDIX, StartGDIY, EndGDIX, EndGDIY);
/* Delete the device context */
L_DeleteLeadDC(LeadDC);


L_CreateMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateMarkers(phMarkers)

HANDLE L_FAR * phMarkers;

/* pointer to a marker handle */

Creates an empty marker collection.

Parameter | Description
phMarkers | Pointer to a variable to be updated with a handle to an empty marker collection.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Markers can be added to the collection using L_InsertMarker function.

When the marker collection handle is no longer needed, free it by calling L_FreeMarkers.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_FreeMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

L_INT EXT_CALLBACK MyCopyCallback(L_UINT uMarker, L_UINT uMarkerSize, L_VOID L_FAR * pMarkerData, L_VOID L_FAR * pUserData, LEADMARKERCALLBACK pfnLEADCallback, L_VOID L_FAR * pLEADUserData)
{
// is it a APPn marker?
if(uMarker >= 0xE0 && uMarker < 0xF0)
{
// just insert all the markers in the destination collection list
// L_InsertMarker will never return SUCCESS_IGNOREMARKER, so the source collection list will not be changed.
return L_InsertMarker (*(HANDLE L_FAR*)pLEADUserData, 0xFFFFFFFF, uMarker, uMarkerSize, pLEADUserData);
}

return SUCCESS;
}

// This example will copy all APPn markers from one marker collection to another
L_INT CopyMarkers(HANDLE hSrcMarkers, HANDLE L_FAR*phDstMarkers)
{
L_INT nRet;

nRet = L_CreateMarkers(phDstMarkers);
if(nRet != SUCCESS)
return nRet;

// copy the APPn markers from hSrcMarkers
nRet = L_EnumMarkers (hSrcMarkers, 0, MyCopyCallback, (L_VOID L_FAR*)phDstMarkers);
if(nRet != SUCCESS)
{
// An error occurred. Free the marker list we have created
 L_FreeMarkers (*phDstMarkers);
*phDstMarkers = NULL;
}

return nRet;
}


L_CreateMaskFromBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateMaskFromBitmapRgn(pBitmap, pMask, uStructSize)

pBITMAPHANDLE pBitmap; | /* pointer to the source bitmap handle */
pBITMAPHANDLE pMask; | /* pointer to the destination bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Creates a 1-bit mask image from the region that is defined in the source bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the source bitmap, where the region is defined.
pMask | Pointer to the bitmap handle referencing the destination bitmap, which will be updated with a 1-bit, black-and-white image, where pixels from the region are white, and all others are black.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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. For more information, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapAlpha, L_SetBitmapAlpha,
 | L_SetBitmapRgnFromMask
Topics: | Defining and Using a Bitmap Region
 | Implementing Transparency
 | Saving a Region

Example

/* This example loads an image, sets a color region using black, */
/* and then creates a 1-bit mask image from that bitmap. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
BITMAPHANDLE MaskBitmap; /* Bitmap handle that holds the mask bitmap */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL );
L_SetBitmapRgnColor ( &LeadBitmap, RGB( 0,0,0 ), L_RGN_SET );
L_CreateMaskFromBitmapRgn( &Bitmap, &MaskBitmap, sizeof(BITMAPHANDLE));


L_CreatePaintPalette

#include "l_bitmap.h"

HPALETTE EXT_FUNCTION L_CreatePaintPalette(hDC, pBitmap)

HDC hDC; | /* device context that is used */
pBITMAPHANDLE pBitmap; | /* pointer to the LEAD bitmap handle */

Returns a palette handle that must be selected and realized before calling L_PaintDC.

Parameter | Description
hDC | Device context that is used.
pBitmap | Pointer to the LEAD bitmap handle that references the image data.

Returns

> 0 | Palette handle.
NULL | No palette needed.

Comments

You must use this function if either the display device or the bitmap is 8 bits per pixel or less. You can use this function whenever the bitmap or device changes, and check the return value to decide whether to select and realize the palette. If the return value is NULL, no palette needs to be selected.

You must also call this function before calling L_PaintDC, when painting a 16-bit grayscale image on a 24-bit device.

You must delete the palette handle when it is no longer needed.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetFixedPalette, L_ColorResBitmap,
 | L_GetBitmapColors, L_PutBitmapColors, L_DupPalette,
 | L_PaintDC
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For a short example, refer to L_PaintDC. For complete sample code, refer to the COLOR example.


L_CreatePanWindow

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreatePanWindow(hWndParent, pBitmap, ulDisplayFlags, nLeft, nTop, nWidth, nHeight, pszClassName, hIcon, hCursor, bSysMenu, pfnPanCallback, pUserData)

HWND hWndParent; | /* handle to owner of PanWindow */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT32 ulDisplayFlags; | /* display flags */
L_INT nLeft; | /* x coordinate for PanWindow */
L_INT nTop; | /* y coordinate for PanWindow */
L_INT nWidth; | /* requested client width */
L_INT nHeight; | /* requested client height */
L_TCHAR L_FAR * pszClassName; | /* class name for PanWindow */
HICON hIcon; | /* handle to icon for PanWindow */
HCURSOR hCursor; | /* handle to cursor for PanWindow */
L_BOOL bSysMenu; | /* system menu flag */
PANWNDCALLBACK pfnPanCallback; | /* notification callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Creates the Pan Window and associates it with hWndParent.

Parameter | Description
hWndParent | Handle to the main window, which will be displaying pBitmap. This window will not be the parent, but will be associated with the PanWindow.
pBitmap | Pointer to the bitmap handle referencing the bitmap to be displayed in the PanWindow.
ulDisplayFlags | Flags which determine how the image is painted in the Pan Window. For values, refer to Flags for the L_SetDisplayMode Function.
nLeft | X coordinate for the origin of the Pan Window.
nTop | Y coordinate for the origin of the Pan Window.
nWidth | Requested width of the Pan Window's client area. The actual width will depend on the aspect ratio of the image pointed to by pBitmap and the values passed for nWidth and nHeight.
nHeight | Requested height of the Pan Window's client area. The actual height will depend on the aspect ratio of the image pointed to by pBitmap and the values passed for nWidth and nHeight.
pszClassName | Character string containing the class name for which to register the Pan Window. This must be a valid string, and should be related to your application, to avoid conflicting with an existing registered window class name.
hIcon | Handle to the icon to use for the Pan Window. Pass NULL for no icon.
hCursor | Handle to the cursor to use for the Pan Window.
bSysMenu | TRUE to include the system menu on the Pan Window. FALSE to omit it.
pfnPanCallback | Callback function for doing custom painting and getting notification of Pan Rect updates.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function creates the Pan Window and associates it with hWndParent.

The Pan Window’s width and height will be adjusted to account for the aspect ratio of the image pointed to by pBitmap. You must specify a PANWNDCALLBACK callback function to do custom painting or be notified of interactive Pan Rect updates. To position the Pan Rect, call the L_UpdatePanWindow function. You must use L_DestroyPanWindow to destroy the Pan Window and all data associated with it.

Note: the calling application is responsible for coordinating the Pan Window's Pan Rect and the actual display rect of the main window.

Call L_UpdatePanWindow to make the window visible, and set the Pan Rect.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_UpdatePanWindow, L_DestroyPanWindow, PANWNDCALLBACK

Example

The following provides a quick and easy method for viewing a Pan Window. To make this sample easier to drop into place, a number of globals have been used. For the full sample code for the Pan Window, refer to CHILD.C of the DEMO example program.

Add the following code to SCRLZOOM.C in the SCRLZOOM demo.

#ifdef WIN32
#define PANWINDOW_CLASS TEXT("L_PANWINDOW_32")
#else
#define PANWINDOW_CLASS TEXT("L_PANWINDOW_16")
#endif

FARPROC lpfn;
L_UINT32 ulFlags = 0;
HWND ghPanWindow;
L_BOOL bUpdatePan = FALSE;
L_BOOL bPanWindow = FALSE;
L_INT gnZoom = 100;
HWND ghBitmapWnd;
L_BOOL fFitImage = FALSE;

void TestFunction(HWND hWnd);

L_VOID L_FAR L_EXPORT PanWindowCallback(HWND hPanWindow, HWND hWndParent, L_UINT uMsg, LPRECT prcPan, L_VOID L_FAR *pUserData);

Add the following code to the switch statement in MainWndProc in SCRLZOOM.C, right after HANDLE_MSG (hWnd, WM_DESTROY, Window_OnDestroy);

case WM_KEYDOWN:
TestFunction(hWnd);

Add the following code immediately following the call to L_PaintDC (hDC, &Data.Bitmap, NULL, NULL, &Data.rcView, &ps.rcPaint, SRCCOPY); in the Window_OnPaint function in SCRLZOOM.C :

L_UpdatePanWindow(ghPanWindow, &Data.Bitmap, ulFlags, RGB(255, 0, 0), TEXT("Pan Window"), &Data.rcView);

Add the following code immediately before PostQuitMessage(0); in WIndow_OnDestroy in SCRLZOOM.C :

bPanWindow = FALSE;
if (ghPanWindow)
L_DestroyPanWindow(ghPanWindow);

Add the following code to the end of SCRLZOOM.C :

void TestFunction(HWND hWnd)
{
/* if no PanWindow, create one */
if (bPanWindow == 0)
{
bUpdatePan = TRUE;
ulFlags = DISPLAYMODE_SCALETOGRAY;
lpfn = MakeProcInstance((FARPROC)PanWindowCallback, hInst);
L_CreatePanWindow(hWnd, &Data.Bitmap, ulFlags, 0, 0, 150, 150, PANWINDOW_CLASS, NULL, NULL, TRUE, (PANWNDCALLBACK)lpfn, NULL);
ghBitmapWnd = hWnd;
L_UpdatePanWindow(ghPanWindow, &Data.Bitmap, ulFlags, RGB(255, 0, 0), TEXT("Pan Window"), &Data.rcView);
/* Free the callback function*/
FreeProcInstance((FARPROC) PanWindowCallback);
}

return;
}

L_VOID L_FAR L_EXPORT PanWindowCallback(HWND hPanWindow, HWND hWndParent, L_UINT uMsg, LPRECT prcPan, L_VOID L_FAR *pUserData)
{
POINT Pt;
L_INT dy, dx;

/* This adjusts the gnZoom value when the main window is zoomed. */

if (Data.nScalar > 0)
gnZoom = (Data.nScalar + 1) * 100;

else if (Data.nScalar < 0)
gnZoom = (Data.nScalar - 1) * 100;
else if (Data.nScalar == 0)
gnZoom = 100;
switch(uMsg)
{
case PANWIN_CREATED:
ghPanWindow = hPanWindow;
break;
case PANWIN_UPDATED:
Pt.x = prcPan->left;
Pt.y = prcPan->top;
dx = Data.rcView.right - Data.rcView.left;
dy = Data.rcView.bottom - Data.rcView.top;
Data.rcView.left = -min(Data.nHScrollMax, MulDiv(Pt.x, gnZoom, 100));
Data.rcView.right = Data.rcView.left + dx;
Data.rcView.top = -min(Data.nVScrollMax, MulDiv(Pt.y, gnZoom, 100));
Data.rcView.bottom = Data.rcView.top + dy;

bUpdatePan = FALSE;
Data.nHScrollPos = -Data.rcView.left;
Data.nVScrollPos = -Data.rcView.top;
SetScrollPos(ghBitmapWnd, SB_HORZ, Data.nHScrollPos, TRUE);
SetScrollPos(ghBitmapWnd, SB_VERT, Data.nVScrollPos, TRUE);

InvalidateRect(ghBitmapWnd, NULL, FALSE);
UpdateWindow(ghBitmapWnd);

break;
case PANWIN_DESTROYED:
hPanWindow = NULL;
bPanWindow = FALSE;
break;

}
return;
}


L_CreatePlayback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreatePlayback(phPlayback, pBitmap, hList)

pHPLAYBACK phPlayback; | /* address of the variable to be updated */
pBITMAPHANDLE pBitmap; | /* pointer to the handle of the target bitmap */
HBITMAPLIST hList; | /* bitmap list containing images to be played */

Creates an animation playback object and gets a handle for managing the playback.

Parameter | Description
phPlayback | Address of the HPLAYBACK variable that you can use afterward as the playback handle.
pBitmap | Pointer to the bitmap handle that references the target bitmap.
hList | A bitmap list containing images to be played. The list can be created using L_CreateBitmapList and related functions. You can also pass NULL in this parameter to let the function create an empty list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The target bitmap for the playback must be allocated before calling this function.

If you pass NULL in the hList parameter, you can use the L_AppendPlayback function to add bitmaps to the list during the playback. This is useful in the FILEREADCALLBACK function if you want to play an animated file as it is being loaded. If you need to reference the list after the playback, you can pass the address of an HBITMAPLIST variable when you call the L_DestroyPlayback function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_DestroyPlayback, L_GetPlaybackDelay,
 | L_CancelPlaybackWait, L_ProcessPlayback,
 | L_ClearPlaybackUpdateRect, L_GetPlaybackIndex,
 | L_GetPlaybackState, L_GetPlaybackUpdateRect,
 | L_SetPlaybackIndex, L_AppendPlayback,
 | L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_ProcessPlayback. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_CreateThumbnailFromFile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateThumbnailFromFile(pszFile, pBitmap, uStructSize, pThumbOptions, pfnCallback, pUserData, pLoadOptions, pFileInfo)

L_TCHAR L_FAR * pszFile; | /* name of the image file to load */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
const pTHUMBOPTIONS pThumbOptions; | /* pointer to a structure */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Creates a thumbnail from the specified image file.

Parameter | Description
pszFile | Character string containing the name of the file to load.
pBitmap | Pointer to the bitmap handle for the loaded data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pThumbOptions | Pointer to a structure containing thumbnail generation options. Pass NULL to get the default options.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO. Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used internally by L_BrowseDir to create/load the thumbnails for each file that is enumerated. You can use this function to manually create the thumbnail for a specified image file.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_FreeBitmap.

The default thumbnail options are:

DefThumbOpt.nWidth | = 80;
DefThumbOpt.nHeight | = 80;
DefThumbOpt.nBits | = 0;
DefThumbOpt.uCRFlags | = 0;
DefThumbOpt.bMaintainAspect | = TRUE;
DefThumbOpt.bForceSize | = FALSE;
DefThumbOpt.crBackColor | = RGB(0,0,0);
DefThumbOpt.bLoadStamp | = TRUE;
DefThumbOpt.bResample | = FALSE;

Note: More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadFile, L_GetCompressFileStamp, L_BrowseDir
Topics: | Raster Image Functions: Using the Thumbnail Browser
 | Thumbnail Browser
 | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output

Example

BITMAPHANDLE LeadBitmap;
L_INT nRet;
THUMBOPTIONS opt;
L_TCHAR L_FAR * szFilename= TEXT("d:\\temp\\golf.jpg");

//Create a thumbnail with default options, and no callback
nRet = L_CreateThumbnailFromFile(szFilename, &LeadBitmap, sizeof(BITMAPHANDLE), NULL, NULL, NULL, NULL, NULL);
if(nRet == SUCCESS)
L_FreeBitmap(&LeadBitmap);

//Create a thumbnail with some options, and no callback
memset(&opt, 0, sizeof(THUMBOPTIONS));
opt.uStructSize = sizeof(THUMBOPTIONS);
opt.bLoadStamp = FALSE;
opt.nHeight = 40;
opt.nWidth = 80;
opt.bForceSize = TRUE;
opt.bMaintainAspect = TRUE;
opt.crBackColor = RGB(255,0,0);
nRet = L_CreateThumbnailFromFile(szFilename, &LeadBitmap, sizeof(BITMAPHANDLE), &opt, NULL, NULL, NULL, NULL);


L_CreateUserMatchTable

#include "l_bitmap.h"

L_UINT L_FAR * EXT_FUNCTION L_CreateUserMatchTable(pPalette, uColors)

LPRGBQUAD pPalette; | /* array of values that is your palette */
L_UINT uColors; | /* number of colors in your palette */

Creates a table that speeds color conversion when using a palette that you create. The table is referenced by the L_ColorResBitmap function.

Parameter | Description
pPalette | The array of values that is your palette.
 | Each item in the array can have one of the following values:
 | Value | Meaning
 | Actual RGBQUAD value | Use the specified color as a fixed color.
 | RGB_RESERVED | [0x01] Leave the item blank, for possible later use.
 | RGB_EMPTY | [0x02] Let the L_ColorResBitmap function fill in the color. The function supplies optimized colors to fill the RGB_EMPTY items.
uColors | The number of colors in your palette.

Returns

The pointer to the table, or NULL if the function fails.

Comments

This function is used with other functions in the following sequence:

1. | Call L_CreateUserMatchTable to create the table.
2. | Call L_SetUserMatchTable to make this the current table. (Having this as a separate function allows you to save tables in files and get the one you need, without creating it again.)
3. | Call L_ColorResBitmap with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call L_FreeUserMatchTable when the table is no longer needed.

The completed table is a 32K array of integers. On a 32-bit system, it occupies 128K bytes of memory. Creation of the table is a slow, memory-intensive process that is useful only if you are using your own palette more than once. For example, you may want to create the table once, save it to a file, and ship that file with your application.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmap, L_DefaultDithering, L_SetUserMatchTable, L_FreeUserMatchTable
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes

Example

/* This example changes the color resolution of a bitmap, using a user-defined
palette and a match table for fast color matching. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
void TestFunction(HWND hWnd)
{
L_UINT L_FAR * pMatchTable; /* Pointer to the user match table */
RGBQUAD Rainbow[64] = /* 64-color rainbow palette */
{
{0, 0, 0, 0}, {85, 0, 0, 0}, {170, 0, 0, 0}, {255, 0, 0, 0}, {0, 85, 0, 0},
{85, 85, 0, 0}, {170, 85, 0, 0}, {255, 85, 0, 0}, {0, 170, 0, 0}, {85, 170, 0, 0},
{170, 170, 0, 0}, {255, 170, 0, 0}, {0, 255, 0, 0}, {85, 255, 0, 0}, {170, 255, 0, 0},
{255, 255, 0, 0}, {0, 0, 85, 0}, {85, 0, 85, 0}, {170, 0, 85, 0}, {255, 0, 85, 0},
{0, 85, 85, 0}, {85, 85, 85, 0}, {170, 85, 85, 0}, {255, 85, 85, 0}, {0, 170, 85, 0},
{85, 170, 85, 0}, {170, 170, 85, 0}, {255, 170, 85, 0}, {0, 255, 85, 0},
{85, 255, 85, 0}, {170, 255, 85, 0}, {255, 255, 85, 0}, {0, 0, 170, 0}, {85, 0, 170, 0},
{170, 0, 170, 0}, {255, 0, 170, 0}, {0, 85, 170, 0}, {85, 85, 170, 0}, {170, 85, 170, 0},
{255, 85, 170, 0}, {0, 170, 170, 0}, {85, 170, 170, 0}, {170, 170, 170, 0},
{255, 170, 170, 0}, {0, 255, 170, 0}, {85, 255, 170, 0}, {170, 255, 170, 0},
{255, 255, 170, 0}, {0, 0, 255, 0}, {85, 0, 255, 0}, {170, 0, 255, 0}, {255, 0, 255, 0},
{0, 85, 255, 0}, {85, 85, 255, 0}, {170, 85, 255, 0}, {255, 85, 255, 0}, {0, 170, 255, 0},
{85, 170, 255, 0}, {170, 170, 255, 0}, {255, 170, 255, 0}, {0, 255, 255, 0},
{85, 255, 255, 0}, {170, 255, 255, 0}, {255, 255, 255, 0},
};
/* Create and set the user match table */
pMatchTable = L_CreateUserMatchTable(Rainbow, 64);
L_SetUserMatchTable(pMatchTable);
/* Change the color resolution using the new palette. Note that the user match table
is makes your code faster only if you use it more than once. It is included here only
to show how it can be coded. */
L_ColorResBitmap(&LeadBitmap, &LeadBitmap, sizeof(BITMAPHANDLE), 8,
CRF_FLOYDSTEINDITHERING|CRF_USERPALETTE|CRF_FASTMATCHPALETTE,
Rainbow, NULL, 64, NULL, NULL );
/* Free the user match table when it is no longer needed */
L_FreeUserMatchTable(pMatchTable);
/* Get the new palette as the current paint palette */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_CreateZoomView

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CreateZoomView(hWnd, pBitmap, pZoomViewProps.)

HWND hWnd; | /* handle to a window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pZOOMVIEWPROPS pZoomViewProps; | /* pointer to a structure */

Creates a new Zoom View and associates it with the specified window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.
pBitmap | Pointer to the bitmap handle that references the bitmap displayed in hWnd.
pZoomViewProps | Pointer to a ZOOMVIEWPROPS structure containing options for controlling the behavior of the Zoom View.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Starts a Zoom View procedure by attaching a zoomed view to the specified window.

Note:

Anytime the window's size changes or the bitmap changes, call the L_UpdateZoomView function in order to update the zoomed view settings.

When the zoomed view is no longer needed, call the L_DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

/*
This sample shows how you can start and stop the Zoom View. It also
demonstrates how to provide a callback function and how this can help you
to update Zoom View options.
*/

L_VOID CreateZoomView(HWND hWnd, pBITMAPHANDLE pBitmap,RECT L_FAR *prcView)
{
ZOOMVIEWPROPS ZoomViewProps;
L_INT nRet;
memset(&ZoomViewProps,0,sizeof(ZOOMVIEWPROPS));
ZoomViewProps.uStructSize = sizeof(ZOOMVIEWPROPS);

SetRect(&ZoomViewProps.rcSrc, 0, 0, 100* 100, 100*
 100);
SetRect(&ZoomViewProps.rcDst, 100* 100, 100* 100,
 200* 100, 200* 100);

ZoomViewProps.nZoom                = 200;
ZoomViewProps.bForceDst            = FALSE;
ZoomViewProps.bEnabled             = TRUE;

ZoomViewProps.bCallouts            = TRUE;
ZoomViewProps.crCallout            = RGB(255,0,0);
ZoomViewProps.nCalloutPenStyle     = PS_DASH;

ZoomViewProps.crZoomViewBorder     = RGB(0,255,0);
ZoomViewProps.uZoomViewBorderStyle = ZOOMVIEWBORDERSTYLE_SIMPLE;
ZoomViewProps.nZoomViewPenStyle    = PS_SOLID;

ZoomViewProps.crSrcBorder          = RGB(0,0,255);
ZoomViewProps.uSrcBorderStyle      = SOURCEBORDERSTYLE_SIMPLE;
ZoomViewProps.nSrcPenStyle         = PS_DOT;

CopyRect(&ZoomViewProps.rcView, prcView);
nRet = L_CreateZoomView (hWnd, pBitmap, &ZoomViewProps);
if(nRet = SUCCESS)
{
HDC hDC = GetDC(hWnd);
L_RenderZoomView(hDC,hWnd);
ReleaseDC(hWnd, hDC);
}
L_RenderZoomView(hMemDC,hwnd);

}

L_VOID DestroyZoomView(HWND hWnd)
{
L_UINT uCount,i;
if(L_WindowHasZoomView (hWnd))
{
L_GetZoomViewsCount (hWnd,&uCount);

for(i=0; i < uCount;++i)
{
L_DestroyZoomView (hWnd,uCount-i-1);
}
}
}


L_CubismBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CubismBitmap(pBitmap, uSpace, uLength, nBrightness, nAngle, crColor,uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uSpace; | /* cube spaces */
L_UINT uLength; | /* cube side length */
L_INT nBrightness; | /* brightness */
L_INT nAngle; | /* cube orientation */
COLORREF crColor; | /* background color */
L_UINT uFlags; | /* flags */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uSpace | Space between cubes, in pixels. As uSpace 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))
uLength | Cube side length, in pixels.
nBrightness | 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.
nAngle | The cube’s angle of orientation, in hundredths of a degree (+/-). This value is ignored if the CUB_RAND flag has been set in uFlags. Possible values are from–36000 to 36000.
crColor | The COLORREF value that specifies the background color. This value is ignored if the CUB_BKG flag has been set in uFlags.
uFlags | 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 nAngle value.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and applies the cubism function to it: */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply cubism*/
L_CubismBitmap(&LeadBitmap,5,15,200,4500,RGB(255,0,0), CUB_COLOR | CUB_RECT | CUB_RAND);


L_CurveToBezier

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CurveToBezier(pCurve, pOutPointCount, pOutPoint)

pCURVE pCurve; | /* pointer to a structure */
L_INT * pOutPointCount; | /* pointer to a variable */
POINT * pOutPoint; | /* pointer to an array of structures */

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 to with the Windows APIs PolyBezier and PolyBezierTo.

Parameter | Description
pCurve | Pointer to a CURVE structure that defines a curve.
pOutPointCount | Pointer to a variable to be updated with the number of Bezier control points.
pOutPoint | Pointer to an array of POINT structures to be updated with the Bezier control points.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to convert a standard curve to an array of Bezier control points. A LEAD standard curve (CURVE_STANDARD) is defined by the CURVE structure, and one of the fields is an array of POINT structures. The standard curve passes through all of the points in the array, and is continuous at each point. This function can be used to draw this curve by converting it to an array of Bezier points, and using the Windows API PolyBezier (or PolyBezierTo) to draw the equivalent Bezier.

To use this function, declare a variable of type CURVE, and fill in the appropriate fields. For this function, all fields of the CURVE structure are required EXCEPT uFillMode, which is ignored. For more information, refer to the CURVE structure.

The pOutPoint must point to an array of POINT structures that is large enough to hold the Bezier control points. At most, the resulting array must hold (3n + 1) entries, where n is the number of points in the CURVE_STANDARD curve. If this function is called with pOutPoint set to NULL, pOutPointCount will be updated with the required number of entries in the pOutPoint array.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SetBitmapRgnCurve

Example

//This sample draws a smooth closed curve on hDC that goes through five points
L_INT SampleSetCurveToBezier(HDC hDC)
{
L_INT nRet;
CURVE Curve;
POINT points[5];
L_INT nOutPointCount;
LPPOINT pOutPoints;
HPEN hPen, hPrevPen;
int nPrevROP2;

//Define the points of the curve
points[0].x = 130;
points[0].y = 130;

points[1].x = 130;
points[1].y = 300;

points[2].x = 230;
points[2].y = 230;

points[3].x = 175;
points[3].y = 175;

points[4].x = 230;
points[4].y = 130;

Curve.uStructSize = sizeof(CURVE);
Curve.nType = CURVE_STANDARD;
Curve.nPointCount = 5;
Curve.pPoints = points;
Curve.uFillMode = L_POLY_WINDING; //This member is ignored
Curve.dTension = 0.5;
Curve.nClose = CURVE_CLOSE;
Curve.nReserved = 0;

//Determined the number of required points
nRet = L_CurveToBezier(&Curve, &nOutPointCount, NULL);
if (nRet != SUCCESS)
return nRet;

pOutPoints = (LPPOINT)malloc( sizeof(POINT) * nOutPointCount);

if (pOutPoints == NULL)
return FAILURE;

nRet = L_CurveToBezier(&Curve, &nOutPointCount, pOutPoints);
if (nRet != SUCCESS)
{
free(pOutPoints);
return nRet;
}

//Create a pen
hPen = CreatePen(PS_SOLID, 1,RGB(255,255,255));
hPrevPen = (HPEN)SelectObject(hDC, hPen);
nPrevROP2 = SetROP2(hDC, R2_XORPEN);

//Draw the curve that goes through the original five points
nRet = PolyBezier(hDC, pOutPoints, nOutPointCount);

//Restore the hDC
SetROP2(hDC, nPrevROP2);
SelectObject(hDC, hPrevPen);
DeleteObject(hPen);

free(pOutPoints);
return SUCCESS;
}


L_CylindricalBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CylindricalBitmap (pBitmap, nValue, uType)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* stretch amount */
L_UINT uType; | /* cylinder type */

Warps the bitmap around a cylinder. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nValue | Amount of stretching where:
 | Positive values: stretch the pixels toward the bitmap edges depending on the type of cylinder.
 | Negative values: stretch the pixels toward the central line of the cylinder.
 | The valid range is from –100 to 100.
uType | 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).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Warp the image to horizontal cylinder shape*/
L_CylindricalBitmap (&LeadBitmap, 100, CYL_HORZ);


L_DecodeABIC

#include "ltfil.h"

L_INT EXT_FUNCTION L_DecodeABIC(pInputData, nLength, ppOutputData, nAlign,nWidth, nHeight, bBiLevel)

L_UCHAR * pInputData; | /* input data buffer */
L_INT nLength; | /* size of input data */
L_UCHAR ** ppOutputData; | /* output data buffer to be updated */
L_INT nAlign; | /* number of bytes used for alignment */
L_INT nWidth; | /* image width in pixels */
L_INT nHeight; | /* image height in pixels */
L_BOOL bBiLevel; | /* flag */

Decodes the ABIC data and updates the ppOutputData parameter with the uncompressed raw data.

Parameter | Description
pInputData | Pointer to the input buffer that contains the ABIC compressed data.
nLength | Size of the compressed data.
ppOutputData | Pointer to a pointer to an output buffer to be updated with the uncompressed raw data.
nAlign | Number of bytes used for aligning the uncompressed raw data pointed to by ppOutputData.
nWidth | Width of the compressed ABIC data image, in pixels.
nHeight: | Height of the compressed data image, in pixels.
bBiLevel | Flag that indicates whether the input data is bi-level or grayscale. Possible values are:
 | Value | Meaning
 | TRUE | Input data pointed to by pInputData is 1-bit Bi-level.
 | FALSE | Input data pointed to by pInputData is 4-bit Grayscale.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function decompresses 1-bit bi-level or 4-bit grayscale ABIC raw data.

The output buffer pointed to by ppOutputData is allocated automatically by the function. The user is responsible for freeing this ppOutputData buffer by calling GlobalFreePtr() function.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EncodeABIC
Topics: | Raster Image Functions: Compression Functions
 | Compressing and Decompressing Buffers

Example

BITMAPHANDLE hBitmap;

#define DIB_WIDTH_BYTES(b) (((L_UINT) ((((L_UINT32) (b)) + 31) >> 3)) & ~3)
#define ROUNDEDBYTESPERLINE(w, b) DIB_WIDTH_BYTES((L_UINT32) (w) * (L_UINT32) (b))
L_INT myDecodeABIC( HWND hWnd )
{
L_INT nRet;
L_INT nLength;
L_UCHAR *pData;
L_INT nOutLength;
L_UCHAR *pOutData;
FILE *pFile;
RGBQUAD MyGrayPal[ 16 ];
/* open file */
pFile = fopen( "Image2Raw.ica", "rb+" );
if( NULL != pFile )
{
/* calculate length of data and load it from the file */
fseek( pFile, 0, SEEK_END );
nLength = ftell( pFile );
fseek( pFile, 0, SEEK_SET );
pData = (L_UCHAR *)GlobalAllocPtr( GMEM_FIXED, nLength );
if( NULL == pData )
{
fclose( pFile );
return -1; /* no memory */
}
if( fread( pData, sizeof( L_UCHAR ), nLength, pFile ) != (L_UINT)nLength )
{
GlobalFreePtr( pData );
fclose( pFile );

return -1; /* failed while reading */
}
fclose( pFile );

/* decode the data */
pOutData = NULL;
nRet = L_DecodeABIC( pData, nLength, &pOutData, 4, 472 /* width */, 221 /* height */, FALSE );
GlobalFreePtr( pData );
if( SUCCESS == nRet )
{
if( hBitmap.Flags.Allocated )
{
L_FreeBitmap( &hBitmap );
}
nOutLength = 221 * ROUNDEDBYTESPERLINE( 472, 4 );
struct
{
BITMAPINFO info;
RGBQUAD colors[ 15 ];
} BitmapInfo;

memset(&BitmapInfo, 0, sizeof(BitmapInfo));
BitmapInfo.info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
BitmapInfo.info.bmiHeader.biWidth = 472;
BitmapInfo.info.bmiHeader.biHeight = 221;
BitmapInfo.info.bmiHeader.biBitCount = 4;
nRet = L_ConvertFromDIB( &hBitmap, SIZEOFBITMAPHANDLE, &BitmapInfo.info, pOutData);
/* prepare gray scale 16-color palette */
for( L_INT k = 0 ; k < 16 ; k++ )
{
MyGrayPal[ k ].rgbBlue = 0x11 * k;
MyGrayPal[ k ].rgbRed = 0x11 * k;
MyGrayPal[ k ].rgbGreen = 0x11 * k;
MyGrayPal[ k ].rgbReserved = 0;
}
nRet = L_PutBitmapColors( &hBitmap, 0, 16, MyGrayPal );
GlobalFreePtr( pOutData );
InvalidateRect( hWnd, NULL, TRUE );
return ( SUCCESS == nRet ? 0 : -1 );
}
}
return -1;
}


L_DecompressBitmapMemory

This function has been removed. You can achieve the same functionality using L_LoadBitmapMemory.


L_DecompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DecompressBuffer(hDecompress, pDecompressData)

HGLOBAL hDecompress; | /* decompression handle */
pDECOMPRESSDATA pDecompressData; | /* pointer to a structure */

This function should be called for each buffer, strip or tile of decompressed data.

Parameter | Description
hDecompress | Handle that identifies the decompression process.
pDecompressData | Pointer to a structure that contains information about the decompression process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note that you must call the L_StartDecompressBuffer function before using this function, and you must call the L_StopDecompressBuffer function to end the decompression process.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartDecompressBuffer, L_StopDecompressBuffer, L_StartCompressBuffer, L_EndCompressBuffer
Topics: | Compressing and Decompressing Buffers
 | Raster Image Functions: Low-Level Decompression

Example

For an example, refer to L_StartDecompressBuffer.


L_DecompressMemory

This function has been removed. You can achieve the same functionality using L_LoadMemory.


L_DefaultDithering

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DefaultDithering(uMethod)

L_UINT uMethod;

/* dithering method to use */

Specifies the default dithering method to use when converting an image from 64, 48, 32, 24, or 16 bits per pixel to 8 bits per pixel or fewer.

Parameter | Description
uMethod | The dithering method to use. Valid values are:
 | Value | Meaning
 | NO_DITHERING | [0] Use no dithering.
 | FLOYD_STEIN_DITHERING | [1] Use the Floyd-Steinberg method.
 | BURKES_DITHERING | [3] Use the Burkes method.
 | STUCKI_DITHERING | [2] Use the Stucki method.
 | SIERRA_DITHERING | [4] Use the Sierra method.
 | STEVENSON_ARCE_DITHERING | [5] Use the Stevenson-Arce method.
 | JARVIS_DITHERING | [6] Use the Jarvis method.
 | ORDERED_DITHERING | [7] Use ordered dithering, which is faster than other methods but is lower in quality.
 | CLUSTERED_DITHERING | [8] Use clustered dithering.

Returns

SUCCESS | The function was successful.
< 0 | An error occurred. Refer to Return Codes.

Comments

Some LEADTOOLS functions automatically dither an image when necessary for display. Those functions use the default dithering method that this function specifies.

For general information about dithering, refer to Color Resolution and Dithering.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmap, L_CreateUserMatchTable,
 | L_SetUserMatchTable, L_FreeUserMatchTable
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes
 | Color Resolution and Dithering
 | Color Halftone and Halftone Images

Example

/* This example sets NO_DITHERING as the default before loading a
24-bit image at 8 bits per pixel. This overrides the normal default, which is
to use Floyd-Steinberg dithering. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
void TestFunction(HWND hWnd)
{
/* Set the default dithering */
L_DefaultDithering(NO_DITHERING);
/* Load the bitmap at 8 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 8, 0, NULL, NULL);
/* Update the paint palette */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_DeinterlaceBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeinterlaceBitmap(pBitmap, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags */

Deinterlaces a video source image.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uFlags.

This function does not work with regions.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_BinaryFilterBitmap, L_PixelateBitmap, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel , L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Removing Noise

Example

/* The following loads a bitmap and applies the deinterlace function to it: */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* remove odd lines smoothly */
L_DeinterlaceBitmap(&LeadBitmap, DEINTERLACE_SMOOTH | DEINTERLACE_ODD);


L_DeleteBitmapListItems

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeleteBitmapListItems(hList, uIndex, uCount)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uIndex; | /* index of the first bitmap to delete */
L_UINT uCount; | /* number of bitmaps to delete */

Deletes a set of bitmaps from a list. This removes the bitmaps from the specified list and frees the bitmaps.

Parameter | Description
hList | Handle to the list of bitmaps.
uIndex | Index of the first bitmap to delete.
uCount | Number of bitmaps to delete. You can specify (L_UINT) -1 to delete to the end of the list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You cannot use this function to update a bitmap list while it is being used in an animation playback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList,
 | L_CreateBitmapList, L_DestroyBitmapList,
 | L_CopyBitmapListItems, L_GetBitmapListCount,
 | L_InsertBitmapListItem, L_RemoveBitmapListItem,
 | L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/* This example deletes even numbered bitmaps from a list. */
void TestModifyList(HBITMAPLIST hList)
{
L_UINT i; /* Loop counter */
L_UINT uCount; /* Number of bitmaps in the list */
/* Delete even numbered bitmaps from the list */
L_GetBitmapListCount(hList, &uCount);
for (i = 0; i <= uCount; i += 2)
{
L_DeleteBitmapListItems(hList, i, 1);
}
}


L_DeleteICCTag

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_DeleteICCTag(pICCProfile, uTagSig, pTag)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UINT32 uTagSig; | /* a value that indicates the tag signature */
L_UCHAR L_FAR * pTagData; | /* pointer to a buffer of data */

Deletes a tag from the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag to delete.
uTagSig | A value that indicates the signature of the tag to delete from the ICC profile. Possible values include private tag types and the values listed in ICCTAGSIGNATURE.
pTag | Pointer to a buffer to be updated with the deleted tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function deletes the desired tag from the ICC profile. Before deleting it however, it makes a copy of the tag, and updates the pTag parameter with a pointer to the copy.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_CreateICCTagData , L_GenerateICCFile , L_GenerateICCPointer , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This function deletes a tag from an ICC profile */
L_VOID DeleteTag(pICCPROFILEEXT pICCProfile, L_UINT32 uTagSig, L_UCHAR L_FAR * pTagData)
{
L_DeleteICCTag(pICCProfile, uTagSig, pTagData);
}


L_DeleteLeadDC

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_DeleteLeadDC(hDC)

HDC hDC;

/* handle to a device context */

Deletes the device context that was created using the L_CreateLeadDC function.

Parameter | Description
hDC | Handle to a device context that was created using the L_CreateLeadDC function.

Returns

TRUE | The device context was deleted.
FALSE | The device context was invalid, or the deletion failed for some other reason.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_CreateLeadDC

Example

For a short example, refer to L_CreateLeadDC. For complete sample code, refer to the DRAW example.


L_DeleteMarker

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeleteMarker(hMarkers, uMarker, nCount)

HANDLE hMarkers; | /* markers handle */
L_UINT uMarker; | /* marker type to delete */
L_INT nCount; | /* number of markers to delete */

Deletes the specified number of markers of the specified type from the marker collection.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function.
uMarker | Value that represents the type of marker to delete. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which markers are allowed.
nCount | Number of markers to delete. This value is useful only if there is more than one marker of the specified type in the file. Possible values are:
 | Value | Meaning
 | 0 | Delete all markers of type uMarker.
 | > 0 | Delete only the first nCount occurrences of type uMarker.
 | Note: Negative values are not allowed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The user can delete all the occurrences of uMarker, or the first few occurrences.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

// This example will delete all occurrences of APP2 markers.
#define APP2 0xE2
void DeleteMarker (HANDLE hMarkers)

{
L_DeleteMarker(hMarkers, APP2, 0);

}


L_DeletePage

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeletePage(pszFile, nPage, uFlags, pSaveOptions)

L_TCHAR L_FAR * pszFile; | /* file name */
L_INT nPage; | /* page number */
L_UINT uFlags; | /* flags */
pSAVEFILEOPTION pSaveOptions | /* pointer to optional extended save options */

Deletes the specified page from a multi-page file, if the format supports delete operations.

Parameter | Description
pszFile | Character string containing the name of the file from which to delete the page.
nPage | Number of the page to delete. Use -1 to delete the last page. Use 1 to delete the first page.
uFlags | Reserved. Use 0.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The following file formats support delete operations:

TIFF (most TIFF formats, including JTIF, but excluding EXIF)

PCX

Winfax

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_SaveFile

Example

// delete first page of "test.tif"
L_DeletePage(TEXT("test.tif"), 1, 0, NULL);


L_DeleteTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeleteTag(pszFile, nPage, uTag, uFlags, pSaveFileOption)

L_TCHAR L_FAR *pszFile; | /* file name */
L_INT nPage; | /* page number */
L_UINT uTag; | /* the ID of the tag that should be deleted */
L_UINT uFlags; | /* reserved for future use */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Deletes a tag from a file, if the file supports tags (TIFF or Exif).

Parameter | Description
pszFile | Character string containing the name of the file from which to delete the tag.
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.
uTag | The ID of the tag in the TIFF file. The tag IDs are between 0 and 65535.
uFlags | Reserved for future use. Pass 0.
pSaveFileOption | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
ERROR_TAG_MISSING | The requested tag is missing.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note that if you pass a SAVEFILEOPTION, the PageNumber member of that structure will be ignored. The page number is indicated through the nPage parameter of this function.

If you want to delete the tag from a particular IFD in the file, set ESO_USEIFD in the SAVEFILEOPTIONS.Flags parameter and set SAVEFILEOPTIONS.IFD to the IFD in question. This function 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 using the SAVEFILEOPTION and specifying the IFD as above.

Notes:

1. | The LFCMP filter is used to delete the tag from all the TIFF and Exif files.
2. | Do not attempt to use this function to delete tags from inside an ENUMTAGSCALLBACK callback function. If you want to delete tags that you enumerate, use ENUMTAGSCALLBACK to add the tags to a list. Upon returning from L_EnumFileTags, you can delete all the tags from the list.
3. | You should be careful when you delete non-custom tags (tags below 32768). If you delete the wrong tag, you might corrupt the TIF file.

Required DLLs and Libraries

LTFIL

LFCMP

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ReadFileTag, L_WriteFileTag, L_SetTag, L_GetTag, L_EnumFileTags
Topics: | Implementing TIFF Comments and Tags

Example

/* The following example will delete the PAGENUMBER tag from page 2 of a TIFF file: */

#define FILENAME "e:\\i\\test.tif"
#define TGPAGENUMBER 297

L_VOID TestDeleteTag(HWND hWnd)
{
LOADFILEOPTION LoadFileOption;

L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LoadFileOption));
LoadFileOption.PageNumber = 2;

if(L_ReadFileTag(FILENAME, TGPAGENUMBER, NULL, NULL, NULL, &LoadFileOption) > 0)
{
L_INT nRet = L_DeleteTag(FILENAME, 2, TGPAGENUMBER, 0, NULL);
if(nRet != SUCCESS)
MessageBox(hWnd, TEXT("L_DeleteTag failed!"), "Error", MB_OK);
else
MessageBox(hWnd, TEXT("L_DeleteTag SUCCEEDED!"), "SUCCESS", MB_OK);
}
else
MessageBox(hWnd, TEXT("Page 2 does not have a PAGENUMBER tag!"), "Error", MB_OK);
}


L_DesaturateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DesaturateBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Converts the image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bitmap is converted to a grayscale level by reducing the saturation of each color to zero.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_BalanceColors, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftone and Halftone Images

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply deSaturate effect on the image*/
L_DesaturateBitmap(&LeadBitmap);


L_DeskewBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeskewBitmap(pBitmap, pnAngle, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT32 L_FAR * pnAngle; | /* address of the variable to be updated */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Rotates the specified bitmap to straighten it. This function typically is used to automatically straighten scanned images. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to straighten.
pnAngle | NULL or the address of the variable to be updated with the amount that the function rotates the image. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. You can pass NULL if you do not need to check the amount of rotation.
crFill | Color used to fill the background following rotation. This is used only if DSK_FILL is set in uFlags.
uFlags | 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 function 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:
 | Value | Meaning
 | DSKW_FILL | [0x00000000] Use the color in crFill to fill areas exposed after rotation.
 | DSKW_NOFILL | [0x00000010] Let the function automatically find the suitable background color used to fill areas exposed after rotation. crFill is ignored in this case.
 | The following flags indicate the image type:
 | Value | Meaning
 | DSKW_DOCUMENTIMAGE | [0x00000000] The image contains text only.
 | DSKW_DOCUMENTANDPICTURE | [0x00010000] The image contains text and pictures or light text.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If uFlags contains DSKW_NOPROCESS, the function will update pnAngle with the deskew angle, without rotating the image.

The calculated rotation is limited to 10 degrees in either direction. This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_DespeckleBitmap, L_WindowLevel, L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Processing an Image
 | Raster Image Functions: Document Imaging
 | Detecting Registration Marks
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and straightens it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Deskew the bitmap */
L_DeskewBitmap(&LeadBitmap, NULL, 0, DSKW_PROCESS | DSKW_NOFILL | DSKW_DOCUMENTIMAGE);


L_DeskewBitmapExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DeskewBitmapExt(pBitmap, pnAngle, uAngleRange, uAngleResolution, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT32 L_FAR * pnAngle; | /* rotation angle */
L_UINT uAngleRange; | /* angle range */
L_UINT uAngleResolution; | /* angle resolution */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Rotates the specified bitmap to straighten it. This function typically is used to automatically straighten scanned images. This function is available only in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to straighten.
pnAngle | NULL or the address of the variable to be updated with the amount that the function rotates the image. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. You can pass NULL if you do not need to check the amount of rotation.
uAngleRange | Maximum angle of deskew, in hundredths of degrees. Possible values range from 0 to 4500. This value is divided internally by 100..
uAngleResolution | Deskew angle precision. The valid range is from 1 to uAngleRange (maximum deskew angle). The real value is divided by 10.
crFill | Color used to fill the background following rotation. This value is used only if DSK_FILL is set in uFlags.
uFlags | Flags that indicate whether or not 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 function 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 function 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Like L_DeskewBitmap, you can use this function to automatically straighten scanned documents. With this function, the L_DeskewBitmap function 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 uFlags contains DSKW_NOPROCESS, the function will update pnAngle with the deskew angle without rotating the image.

The calculated rotation is limited to 45 degrees in either direction. This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_DespeckleBitmap, L_WindowLevel, L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap, L_DeskewBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* The following example loads a bitmap and straightens it: */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Deskew the bitmap */
L_DeskewBitmapExt(&LeadBitmap, NULL, 1000, 2, 0, DSKW_PROCESS | DSKW_NOFILL| DSKW_LINEAR| DSKW_DOCUMENTIMAGE);


L_DespeckleBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DespeckleBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Removes speckles from a bitmap. Typically, this function is used to clean up scanned images (such as FAX images). This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_DeskewBitmap, L_WindowLevel, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Removing Noise

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and removes speckles from it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Remove speckles from the bitmap */
L_DespeckleBitmap(&LeadBitmap);


L_DestroyBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DestroyBitmapList(hList)

HBITMAPLIST hList;

/* handle to the list of bitmaps */

Frees all bitmaps in the specified list, and invalidates the list handle.

Parameter | Description
hList | Handle to the list of bitmaps.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList,
 | L_CreateBitmapList, L_CopyBitmapListItems,
 | L_GetBitmapListCount, L_InsertBitmapListItem,
 | L_RemoveBitmapListItem, L_DeleteBitmapListItems,
 | L_GetBitmapListItem, L_SetBitmapListItem,
 | L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For a short example, refer to L_CreateBitmapList. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_DestroyPanWindow

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DestroyPanWindow(hPanWindow)

HWND hPanWindow;

/* handle to the Pan Window */

Destroys the Pan Window and frees all resources associated with it.

Parameter | Description
hPanWindow | Handle to the Pan Window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function destroys the Pan Window created by L_CreatePanWindow, and frees all resources associated with it. You must call this function before the thread that called L_CreatePanWindow terminates.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_CreatePanWindow, L_UpdatePanWindow, PANWNDCALLBACK

Example

For an example, refer to L_CreatePanWindow.


L_DestroyPlayback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DestroyPlayback(hPlayback, phList)

HPLAYBACK hPlayback; | /* playback handle */
pHBITMAPLIST phList; | /* address of the list variable to be updated */

Invalidates the animation playback handle. The image list is not deleted.

Parameter | Description
hPlayback | Handle that references the animation playback.
phList | NULL or the address of the variable to be updated with the handle to the bitmap list that the playback used. This is useful it the list was created using L_AppendPlayback during the playback. You can pass NULL if you do not need the list handle. In that case, if the list was created using L_AppendPlayback, LEADTOOLS will free the list from memory.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_GetPlaybackDelay,
 | L_CancelPlaybackWait, L_ProcessPlayback,
 | L_ClearPlaybackUpdateRect, L_GetPlaybackIndex,
 | L_GetPlaybackState, L_GetPlaybackUpdateRect,
 | L_SetPlaybackIndex, L_AppendPlayback,
 | L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_ProcessPlayback. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_DestroyZoomView

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DestroyZoomView(hWnd, uIndex)

HWND hWnd; | /* handle to a window */
L_UINT uIndex; | /* index of the zoomed view to be destroyed */

Destroys the specified Zoom View, and releases all resources associated with it. Call this function before destroying the window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.
uIndex | Index of the zoomed view to be destroyed. This is a zero-based index.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When a zoomed view is no longer needed, call the L_DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

You must call this function 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 five Zoom Views associated with the specified window you need to do the following:

L_UINT uCount,i;
L_GetZoomViewsCount(hWnd,&uCount);

for(i=0; i < uCount; ++i)
{
L_DestroyZoomView(hWnd,uCount-i-1);
}

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_GetZoomViewsCount
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

For an example, refer to L_CreateZoomView.


L_DFTBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DFTBitmap (pBitmap, pFTArray, prcRange, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pFTARRAY pFTArray; | /* pointer to a structure */
RECT L_FAR * prcRange; | /* pointer to range rectangle */
L_UINT uFlags; | /* flags */

Computes the Discrete Fourier transform of an image or the Inverse Discrete Fourier transform as specified in the uFlags parameter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap object of the transformation.
pFTArray | Pointer to an FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array that holds the frequency components of the image. Its size must be the same as the image. This array is filled by the function when DFT_DFT flag has been chosen, and it must be sent to the function to construct the image from it when DFT_IDFT flag has been chosen.
prcRange | Specifies the frequency range to be computed when DFT_DFT flag is chosen. It specifies the frequency range that will be used in the image construction when DFT_IDFT is chosen. The left value refers to the minimum X harmonic, the right refers to the maximum X harmonic, the top refers to the minimum Y harmonic and the bottom refers to the maximum Y harmonic. The maximum X harmonic equals (Width –1) and the maximum Y harmonic equals (Height –1). The minimum X harmonic equals 0 and the minimum Y harmonic equals 0.
uFlags | 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 and store the results in the acxData.
 | DFT_IDFT | [0x0000002] Construct an image using the frequency components from acxData. This option will change the values of acxData.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function converts the image from the time domain to the frequency domain and vice versa using the Discrete Fourier Transform algorithm. Use the L_FFTBitmap to use a Fast Fourier Transform algorithm on a bitmap. Please note however, that this function does not impose the size restrictions (the width and height having to be powers of 2) that the Fast Fourier Transform function, L_FFTBitmap, imposes upon bitmaps.

Before using this function, you need to use the L_AllocFTArray function to allocate a FTARRAY structure large enough to hold Fourier Transform coefficients for pBitmap. When you are finished, you should free the allocated array by calling the L_FreeFTArray function.

This function does not work on regions. If a bitmap has a region the function ignores it and processes the entire bitmap.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FFTBitmap, L_FrqFilterBitmap, L_FTDisplayBitmap, L_FrqFilterMaskBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

/* This example loads a bitmap and applies DFT function. */
RECT rcRange;
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
pFTARRAY pFTArray;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Allocate FT buffer*/
L_AllocFTArray(&LeadBitmap, &pFTArray, sizeof(FTARRAY));

rcRange.left = 0;
rcRange.right = LeadBitmap.Width / 4;
rcRange.top = 0;
rcRange.bottom = LeadBitmap.Height / 2;

/* Apply DFT*/
L_DFTBitmap(&LeadBitmap, pFTArray, &rcRange, DFT_DFT | DFT_GRAY | DFT_RANGE| DFT_INSIDE_X| DFT_OUTSIDE_Y);

/* Free FT buffer */
L_FreeFTArray(pFTArray);


L_DiceEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DiceEffectBitmap (pBitmap, uXBlock, uYBlock, uRandomize, uFlags, crColor);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uXBlock; | /* either the width of the block or the number of blocks per row */
L_UINT uYBlock; | /* either the height of the block or the number of blocks per column */
L_UINT uRandomize; | /* starting point for the randomization process */
L_UINT uFlags; | /* flags that specify how to apply the effect */
COLORREF crColor; | /* border color */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
uXBlock | 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.
uYBlock | 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.
uRandomize | The starting point for the randomization process. Valid values range from 0 through 500. Use 0 to have the function select the value.
uFlags | 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] uXBlock and uYBlock contain the width and height of each block, in pixels.
 | DICE_COUNT | [0x0020] uXBlock and uYBlock 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.
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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function divides the image into a certain number of blocks according to the uFlags 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 uXBlock and uYBlock parameters.

If the uFlags 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 uXBlock and uYBlock parameters.

The uFlags variable must contain DICE_COUNT or DICE_SIZE (but not both).

The uFlags 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 function 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 function draws borders around the blocks.

The starting point (that is, the "randomize value") for the random number generator is selected through the uRandomize parameter.

If uRandomize is set to zero then the function itself selects a random value between 1 and 500 for the randomize value.

If uRandomize 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 function twice with the same randomize value, each block will be transformed the same way.

Calling the function 4 times with the same bitmap and the same randomize value > 0 will leave the bitmap blocks unchanged. So, if you call the function once, the blocks will be transformed. Call the function 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 uFlags, the function leaves the image unchanged.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PuzzleEffectBitmap, L_RingEffectBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

/* This example loads a bitmap and applies a Dice Effect over the loaded image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply Dice Effect for this bitmap */
L_DiceEffectBitmap (&LeadBitmap, 16, 16,0, BITMAP_RESIZE | DICE_SIZE | DICE_BORDER, RGB(0,0,0));


L_DiffuseGlowBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DiffuseGlowBitmap(pBitmap, nGlowAmount, uClearAmount, uSpreadAmount, uWhiteNoise, crGlowColor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nGlowAmount; | /* glow intensity */
L_UINT uClearAmount; | /* clear amount */
L_UINT uSpreadAmount; | /* glow spread amount */
L_UINT uWhiteNoise; | /* amount of noise */
COLORREF crGlowColor; | /* glow color */

Adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nGlowAmount | Glow intensity, expressed in tenths of a percent. Possible 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.
uClearAmount | Value that represents how deeply the glow will penetrate into the non-glowing areas, expressed in tenths of a percent. Possible 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.
uSpreadAmount | Value that represents the amount of blur in the glow diffusion, from 0 to 100 pixels. Possible values range from 0 – 1000. A value of 0 indicates none of the glow is diffused, whereas a value of 1000 indicates maximum diffusion.
uWhiteNoise | Percent of the bitmap to be covered with added pixels, expressed in tenths of a percent. The pixels will be added randomly. Possible values range from 0 – 1000.
crGlowColor | The COLORREF value that specifies the glow color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_DiffuseGlowBitmap using the following settings:

Parameter | Value
nGlowAmount | 50
uClearAmount | 50
uSpreadAmount | 10
uWhiteNoise | 10
crGlowColor | white

The following figure results:

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_GlowFilterBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Add Diffuse Glow to the image*/
L_DiffuseGlowBitmap(&LeadBitmap, 500, 500, 200, 50, RGB(255, 255, 255));


L_DigitalSubtractBitmap

L_INT EXT_FUNCTION L_DigitalSubtractBitmap (pBitmap, pMaskBitmap, uFlags);

pBITMAPHANDLE pBitmap; | /* pointer to the destination, live, bitmap handle */
pBITMAPHANDLE pMaskBitmap; | /* pointer to the source mask bitmap handle */
L_UINT uFlags; | /* flags that specify how to process the bitmap */

Subtracts the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps. This function is available in the Medical and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the live bitmap. The live bitmap is the destination bitmap that will contain the result of the subtraction.
pMaskBitmap | Pointer to the bitmap handle referencing the mask bitmap. The mask bitmap is the source bitmap. pMaskBitmap will not be affected.
uFlags | Flags that control how the function works. Valid values are 0 (which means no enhancement), one or both of the following values:
 | Value | Meaning
 | DS_CONTRASTENH | [0x0001] Perform a contrast enhancement after applying the subtraction.
 | DS_OPTIMIZERANGE | [0x0002] Optimize and increase the tonal range of the bitmap after applying the subtraction.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Performs a digital subtraction between two images. The resulting image may be enhanced using the uFlags 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 pBitmap and pMaskBitmap should have the same bits per pixel, number of channels and image dimensions; otherwise the function will return an error code.

If DS_CONTRASTENH flag is set then the contrast of the subtracted image will be enhanced.

If DS_OPTIMIZERANGE flag 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 pBitmap.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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. 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ShiftBitmapData, L_SelectBitmapData, L_ColorizeGrayBitmap, L_MultiScaleEnhancementBitmap, L_CombineBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image

Example

/* This example loads the mask and live bitmaps and performs digital subtraction. */
BITMAPHANDLE MaskBmp; /* Bitmap handle to hold the mask image. */
BITMAPHANDLE LiveBmp; /* Bitmap handle to hold the live image and then the result */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("mask.CMP"), &MaskBmp, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
L_LoadBitmap (TEXT("live.CMP"), &LiveBmp, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
L_DigitalSubtractBitmap (&LiveBmp, &MaskBmp, DS_CONTRASTENH);
// Now we have the resulting image in LiveBmp


L_DirectionEdgeStatisticalBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DirectionEdgeStatisticalBitmap(pBitmap, uDim, uThreshold, nAngle, crEdgeColor, crBkColor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* edge detector size */
L_UINT uThreshold; | /* threshold value */
L_INT nAngle; | /* edge search direction */
COLORREF crEdgeColor; | /* edge color value */
COLORREF crBkColor; | /* non-edge color value */

Detects the variation of colors in the specified direction using statistical indices. It is similar to L_EdgeDetectStatisticalBitmap, but this function allows you to specify the direction angle.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which the edge detector is applied.
uDim | The dimension or the number of pixels used to calculate the edge in the specified direction.
uThreshold | 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 uDim 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.
nAngle | 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.
crEdgeColor | The COLORREF value that specifies the edge color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crBkColor | The COLORREF value that specifies the non edge color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The edges are detected by applying a statistical filter that analyzes the variations of colors in a specified direction around each pixel.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_IntensityDetectBitmap, L_SharpenBitmap, L_SpatialFilterBitmap, L_EdgeDetectorBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_DiffuseGlowBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Image Processing: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and find its edges using a 45 degree angle, a 128 threshold, and a size equal to 15 */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Find the edges in the bitmap*/
L_DirectionEdgeStatisticalBitmap (&LeadBitmap, 15, 128, 4500, RGB(255, 255, 255), RGB(0, 0, 0));


L_DisplaceMapBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DisplaceMapBitmap(pBitmap, pDisplacementMap, uHorzFact, uVertFact, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE pDisplacementMap; | /* pointer to the displacement bitmap handle */
L_UINT uHorzFact; | /* horizontal shift factor */
L_UINT uVertFact; | /* vertical shift factor */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Displaces bitmap pixels horizontally and vertically according to the values of the displacement map image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pDisplacementMap | Pointer to the bitmap handle that references the displacement map bitmap.
uHorzFact | Horizontal displacement factor, in percent of the bitmap dimensions. The valid range is from 0 to 100.
uVertFact | Vertical displacement factor, in percent of the bitmap dimensions. The valid range is from 0 to 100.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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_STRETCH | [0x0000] Stretch the displacement map image over the entire image area.
 | DSPL_TILE | [0x0010] Repeat the displacement map image to cover the image area.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_DisplaceMapBitmap using the following settings:

Parameter | Value
uHorzFact | 17
uVertFact | 24
crFill | na
uFlags | FILL_NOCHG | DSPL_STRETCH

The following figure results:

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
BITMAPHANDLE DisplacementMap; /* Bitmap handle for the displacement map */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Load a displacement map at its own bits per pixel */
L_LoadBitmap (TEXT("ULAY3.BMP"), &DisplacementMap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Shift the image according to the displacement map*/
L_DisplaceMapBitmap(&LeadBitmap, &DisplacementMap, 5, 5, RGB(0,0,0), FILL_CLR|DSPL_TILE);
if(DisplacementMap.Flags.Allocated)
L_FreeBitmap(&DisplacementMap);


L_DitherLine

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DitherLine(pBitmap, pBufferSrc, pBufferDst)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBufferSrc; | /* pointer to the input buffer */
L_UCHAR L_FAR * pBufferDst; | /* pointer to the output buffer */

Used in a loop, dithers the line in a specified input buffer, and writes it to the output buffer. You must supply the function to process data in the input buffer.

Parameter | Description
pBitmap | Pointer to the bitmap handle that has all the information about the input image. It is the same bitmap handle that is passed by the L_StartDithering function. The bitmap does not have to exist, but the information must be complete. The DitheringMethod field in the bitmap handle specifies the dithering method to be used for color reduction.
pBufferSrc | Pointer to the input buffer.
pBufferDst | Pointer to the output buffer. You must allocate space to hold the output data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses the dithering method specified in the bitmap handle. Therefore, it provides better 4- or 8-bit output than the L_ConvertBuffer function.

This function uses the palette that the L_StartDithering function specifies. The output of the L_DitherLine function is made up of 1-, 4-, or 8-bit indexes to the specified palette. L_StopDithering cleans up the allocated variables and buffers. For a description of how the functions relate to each other, refer to the L_StartDithering function description.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertBuffer, L_StartDithering, L_StopDithering
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

For an example,refer to L_StartDithering.


L_DotRemoveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DotRemoveBitmap(pBitmap, pDotRemove, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPDOTREMOVE pDotRemove; | /* pointer to a structure */
DOTREMOVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Finds and removes dots and specks of various sizes. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap from which to remove dots.
pDotRemove | Pointer to the DOTREMOVE structure that LEADTOOLS uses to remove dots.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in DOTREMOVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function 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. The behavior of this function can be modified by using its callback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | DOTREMOVECALLBACK, L_SmoothBitmap, L_LineRemoveBitmap, L_InvertedTextBitmap, L_BorderRemoveBitmap, L_HolePunchRemoveBitmap, L_HolesRemovalBitmapRgn
Topics: | Cleaning Up 1-Bit Images

Example

//This example returns a region of all 1x1 to 3x3 specks that are solid black
//If a speck has any white pixels, it is NOT part of the returned region
//The call is configured to return a single LEAD region corresponding to all changes
//The image itself is unchanged
//A callback is used to display information about each speck that is removed
//The callback does NOT return a region
L_INT L_EXPORT EXT_CALLBACK ExampleDotRemoveCB(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iWhiteCount,
L_INT32 iBlackCount,
L_VOID L_FAR *pUserData
)
{
L_TCHAR szMsg[200];
L_INT32 nRet;

//Note: no hRgn to delete because it was not requested
wsprintf(
szMsg,
TEXT("Size[%dx%d]\tBounds[%d,%d][%d,%d]\tWhiteCount[%d]\tBlackCount[%d]\n"),
pBoundingRect->right - pBoundingRect->left,
pBoundingRect->bottom - pBoundingRect->top,
pBoundingRect->left,
pBoundingRect->top,
pBoundingRect->right,
pBoundingRect->bottom,
iWhiteCount,
iBlackCount);
OutputDebugString(szMsg);

//Do not remove the speck if it contains any white pixels
if (iWhiteCount > 0)
{
nRet = SUCCESS_NOREMOVE;
}
else
{
nRet = SUCCESS_REMOVE;
}
return nRet;
}

L_VOID ExampleDotRemove(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
BITMAPHANDLE BitmapRegion;
DOTREMOVE dr;

memset(&BitmapRegion, 0, sizeof(BITMAPHANDLE));

dr.uStructSize = sizeof(DOTREMOVE);
dr.iMinDotWidth = 1;
dr.iMinDotHeight = 1;
dr.iMaxDotWidth = 3;
dr.iMaxDotHeight = 3;
dr.uFlags = DOT_USE_SIZE | DOT_SINGLE_REGION | DOT_LEAD_REGION | DOT_IMAGE_UNCHANGED;
dr.pBitmapRegion = &BitmapRegion;

nRet = L_DotRemoveBitmap(
pBitmap,
&dr,
(DOTREMOVECALLBACK)(ExampleDotRemoveCB),
NULL
);

if (nRet == SUCCESS)
{
RECT rectRgn;

//Delete the existing region
L_FreeBitmapRgn(pBitmap);

L_GetBitmapRgnBounds(dr.pBitmapRegion, NULL, &rectRgn);
if (!IsRectEmpty(&rectRgn))
{
L_CopyBitmapHandle(pBitmap, dr.pBitmapRegion, sizeof(BITMAPHANDLE));
}
}

}


L_DoubleBufferBegin

#include "l_bitmap.h"

HDC EXT_FUNCTION L_DoubleBufferBegin(hDoubleBufferHandle, hDC, cx, cy)

L_HANDLE hDoubleBufferHandle; | /* double buffering handle */
HDC hDC; | /* handle to the target device context */
L_INT cx; | /* width, in pixels, of the target device context */
L_INT cy; | /* height, in pixels of the target device context */

Returns a memory hDC that is used in the double buffering process. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDoubleBufferHandle | Handle that identifies the double buffering process.
hDC | Handle to the target device context.
cx | Width in pixels, of the target device context.
cy | Height, in pixels, of the target device context.

Returns

<> 0 | Memory hDC to use for double buffered paints.
0 | The function failed.

Comments

Use L_DoubleBufferBegin to begin a double buffering process. All double buffered paint operations should be wrapped in L_DoubleBufferBegin and L_DoubleBufferEnd calls.

The hDC argument is the device context that you want to double buffer. The arguments cx and cy specify the pixel dimensions of the hDC. If the call to L_DoubleBufferBegin is successful, a memory hDC is returned. Use this memory hDC for all subsequent paint operations. When you want the result of the memory hDC to appear on the target hDC, call L_DoubleBufferEnd.

Note that you must create a double buffer handle with L_DoubleBufferCreateHandle before calling this function.

For more information, see the topic Minimizing Flicker With Double Buffering.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DoubleBufferEnable, L_DoubleBufferCreateHandle, L_DoubleBufferDestroyHandle, L_DoubleBufferEnd
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to L_DoubleBufferEnd.

To see how double buffering can be used in an application, see the source code for the API annotation demo.


L_DoubleBufferCreateHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DoubleBufferCreateHandle(phDoubleBufferHandle)

L_HANDLE *phDoubleBufferHandle;

/* address of the double buffer handle */

Creates the handle that is used throughout the double buffering. This function is available in the Document/Medical Toolkits.

Parameter | Description
phDoubleBufferHandle | Address of the handle that identifies the double buffering process. If successful, phDoubleBufferHandle points to the handle of the double buffering process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is the first step of a double buffering process. Declare a variable of type L_HANDLE, and pass the address of this variable to L_DoubleBufferCreateHandle. If successful, your variable will contain a double buffering handle that will be used throughout the double buffering process. When you are finished with the handle, you must call L_DoubleBufferDestroyHandle.

You may decide to call this function only one time for you application. If your application is MDI, and you want to double buffer several windows simultaneously, you may want to call this function once for each child window. The latter is the technique used in the API annotation demo (annot32.exe).

For more information, see the topic Minimizing Flicker With Double Buffering.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DoubleBufferEnable, L_DoubleBufferDestroyHandle, L_DoubleBufferBegin, L_DoubleBufferEnd
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker With Double Buffering

Example

For an Example, refer to L_DoubleBufferEnd.

To see how double buffering can be used in an application, see the source code for the API annotation demo.


L_DoubleBufferDestroyHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DoubleBufferDestroyHandle(hDoubleBufferHandle)

L_HANDLE hDoubleBufferHandle;

/* double buffering handle */

Frees the double buffer handle resources. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDoubleBufferHandle | Handle that identifies the double buffering process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when you are finished with the double buffering process. It frees all internally allocated resources associated with double buffering it should be called once for each call to L_DoubleBufferCreateHandle.

For more information, see the topic Minimizing Flicker With Double Buffering.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DoubleBufferEnable, L_DoubleBufferCreateHandle, L_DoubleBufferBegin, L_DoubleBufferEnd
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker With Double Buffering

Example

For an example refer to L_DoubleBufferEnd.

To see how double buffering can be used in an application, see the source code for the API annotation demo.


L_DoubleBufferEnable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DoubleBufferEnable(hDoubleBufferHandle, bEnable)

L_HANDLE hDoubleBufferHandle; | /* double buffer handle */
L_BOOL bEnable; | /* value that specifies whether double buffering is used */

Enables or disables double buffering. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDoubleBufferHandle | Handle that identifies the double buffering process.
bEnable | Value that specifies whether to enable double buffering. Possible values are:
 | Value | Meaning
 | TRUE | Enable double buffering.
 | FALSE | Disable double buffering.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function enables or disables a double buffering process. This function should be used after the double buffering process is already in place. This means that the double buffering handle should already be created, and all paint calls should already be wrapped in L_DoubleBufferBegin and L_DoubleBufferEnd pairs.

For more information, see the topic Minimizing Flicker With Double Buffering.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DoubleBufferCreateHandle, L_DoubleBufferDestroyHandle, L_DoubleBufferBegin, L_DoubleBufferEnd
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to L_DoubleBufferEnd.

To see how double buffering can be used in an application, see the source code for the API annotation demo.


L_DoubleBufferEnd

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DoubleBufferEnd(hDoubleBufferHandle, hDC)

L_HANDLE hDoubleBufferHandle; | /* double buffering handle */
HDC hDC; | /* handle to the target device context */

Displays the double buffered paint operations. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDoubleBufferHandle | Handle that identifies the double buffering process.
hDC | Handle to the original target device context.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use L_DoubleBufferEnd when ready to paint all that has been double-buffered to the target hDC. All double buffered paint operations should be wrapped in L_DoubleBufferBegin and L_DoubleBufferEnd calls.

The hDC argument is the device context that you want to double buffer, which in this case should be the same as the hDC argument that was passed to L_DoubleBufferBegin.

Note that you must create a double buffer handle with L_DoubleBufferCreateHandle before calling this function.

For more information, see the topic Minimizing Flicker With Double Buffering.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DoubleBufferEnable, L_DoubleBufferCreateHandle, L_DoubleBufferDestroyHandle, L_DoubleBufferBegin
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker With Double Buffering

Example

To see how double buffering can be used in an application, see the source code for the API annotation demo.

// This sample illustrates double buffering by bouncing a ball around
// a window that contains an image
// For simplicity, we assume both the window the hDC are 24 bit
// Run the example twice --
// * once with bDoubleBuffer set to FALSE
// * once with bDoubleBuffer set to TRUE
// to see the difference
// hWnd -- window to paint image and bounce ball
// pszFile -- file name of image to load
// bDoubleBuffer - flag saying whether or not to double buffer the paints

#define BALL_RADIUS 30
L_VOID SampleDoubleBuffer(HWND hWnd, L_TCHAR *pszFile, L_BOOL bDoubleBuffer)
{
HBRUSH hBrush;
BITMAPHANDLE Bitmap;
L_HANDLE hDoubleBufferHandle;
L_INT cx, cy;
HDC hDC, hMemDC;
RECT rcClient;
RECT rcBitmap;
RECT rcBall;
L_INT dx, dy;
L_INT i;
L_INT nRet;

nRet = L_LoadBitmap(pszFile, &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
if (nRet != SUCCESS)
{
MessageBox(hWnd, TEXT("Failed to load image"), TEXT("Error"), MB_OK);
return;
}

hBrush = CreateSolidBrush( RGB(100,100,100));
L_DoubleBufferCreateHandle(&hDoubleBufferHandle);

L_DoubleBufferEnable(hDoubleBufferHandle, bDoubleBuffer);

GetClientRect(hWnd, &rcClient);
cx = rcClient.right - rcClient.left;
cy = rcClient.bottom - rcClient.top;
hDC = GetDC(hWnd);

rcBitmap.left = 0;
rcBitmap.top = 0;
rcBitmap.right = BITMAPWIDTH(&Bitmap);
rcBitmap.bottom = BITMAPWIDTH(&Bitmap);

SetRect(&rcBall, 0, 0, BALL_RADIUS, BALL_RADIUS);
dx = dy = 1;
for (i=0; i<2000; i++)
{
// Double buffer painting the image and the moving ball
hMemDC = L_DoubleBufferBegin(hDoubleBufferHandle, hDC, cx, cy);
FillRect(hMemDC, &rcClient, hBrush);
L_PaintDC(hMemDC, &Bitmap, NULL, NULL, &rcBitmap, NULL, SRCCOPY);
Ellipse(hMemDC, rcBall.left, rcBall.top, rcBall.right, rcBall.bottom);
L_DoubleBufferEnd(hDoubleBufferHandle, hDC);

if ((rcBall.bottom) > rcClient.bottom)
dy = -1;
if (rcBall.top < 0)
dy = 1;
if (rcBall.left < 0)
dx = 1;
if ((rcBall.right) > rcClient.right)
dx = -1;
OffsetRect(&rcBall, dx, dy);
}

// Cleanup
L_FreeBitmap(&Bitmap);
L_DoubleBufferDestroyHandle(hDoubleBufferHandle);
DeleteObject(hBrush);
}


L_DoubleTo2bFixed2bNumber

#include "ltkrn.h"
#include "ltclr.h"

L_UINT32 EXT_FUNCTION L_DoubleTo2bFixed2bNumber(dNumber)

L_DOUBLE dNumber;

/* double value */

Converts a fraction number into a 2-bytes fixed, 2-bytes fraction format.

Parameter | Description
dNumber | A double fractional value to convert.

Returns

A 4-byte (2-bytes fixed, 2-bytes fraction) value that represents the value passed to the function.

Comments

This function is used for ICC profiles purposes. The returned value must be cast into one of the following types: L_IccS15Fixed16Number or L_IccU16Fixed16Number.

Each of these types is 4-bytes, divided into 2-bytes that contain the fixed part of the number, and 2-bytes that contain the fractional part of the number.

The (2b) found in the function name means (2-bytes).

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This example defines a double fractional value, and converts it into 2-bytes fixed, 2-bytes fraction value, and then converts it back into double */
L_DOUBLE dNumber;
L_IccU16Fixed16Number uIccNumber;
dNumber = 1.9858;
uIccNumber = (L_IccU16Fixed16Number) L_DoubleTo2bFixed2bNumber(dNumber);
dNumber = L_2bFixed2bNumberToDouble (uIccFormatNumber);


L_DrawStarBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DrawStarBitmap(pBitmap, pStarInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPSTARINFO pStarInfo; | /* pointer to a structure */

Draws a star on the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to draw the star.
pStarInfo | Pointer to an LPSTARINFO structure that contains star information.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
STARINFO StarInfo;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

StarInfo.uStructSize = sizeof(STARINFO);
StarInfo.nAngle = 0;
StarInfo.nAngleOpac = 0;
StarInfo.nBorderOpac = 0;
StarInfo.nDistOpac = 0;
StarInfo.nPhase = 0;
StarInfo.nSpokeDiv = 0;
StarInfo.pCenter.x = LeadBitmap.Width/2;
StarInfo.pCenter.y = LeadBitmap.Height/2;
StarInfo.uFlag = STR_INSIDE;
StarInfo.uHoleSize = 50;
StarInfo.uOpacity = 100;
StarInfo.uSpoke = 5;
StarInfo.uStarHeight = LeadBitmap.Height/2;
StarInfo.uStarWidth = LeadBitmap.Width/2;
StarInfo.crFillUpper = RGB(255, 0, 0);
StarInfo.crFillLower = RGB(0, 0, 255);

L_DrawStarBitmap(&LeadBitmap, &StarInfo);


L_DryBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DryBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood in pixels */

Simulates painting an image with the watercolor dry brush technique. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uDim | Dimensions of the neighborhood used in creating the effect (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_DryBitmap(&LeadBitmap, 5);


L_DupBitmapPalette

#include "l_bitmap.h"

HPALETTE EXT_FUNCTION L_DupBitmapPalette(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Creates a Windows HPALETTE from the specified bitmap’s palette.

Parameter | Description
pBitmap | Pointer to the bitmap whose palette is to be duplicated.

Returns

Handle of the palette that is created.

Comments

The bitmap must be 8-bit or less in order to have a valid palette.

The palette returned by this function must be destroyed using the Windows API DeleteObject() when it is no longer needed.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetFixedPalette, L_ColorResBitmap, L_CreatePaintPalette, L_GetBitmapColors, L_PutBitmapColors, L_DupPalette, L_SetBitmapPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For an example, refer to L_ChangeToDDB.


L_DupPalette

#include "l_bitmap.h"

HPALETTE EXT_FUNCTION L_DupPalette(hPalette)

HPALETTE hPalette;

/* handle of the palette to duplicate */

Duplicates a Windows palette.

Parameter | Description
hPalette | Handle of the palette to duplicate.

Returns

Handle of the palette that is created by making the duplicate.

Comments

The palette returned by this function must be destroyed using the Windows API DeleteObject() when it is no longer needed.

In order to copy a palette from one bitmap to another, use L_CopyBitmapPalette.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmapPalette, L_GetFixedPalette, L_ColorResBitmap, L_CreatePaintPalette, L_GetBitmapColors, L_PutBitmapColors, L_DupBitmapPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For a short example, refer to L_ResizeBitmap. For complete sample code, refer to the FEATURE3 example.


L_DynamicBinaryBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DynamicBinaryBitmap (pBitmap, uDim, uLocalContrast)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */
L_UINT uLocalContrast; | /* local contrast threshold */

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. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uDim | Dimensions of the neighborhood used when evaluating each pixel (uDim x uDim), in pixels. uDim should be at least 1.
uLocalContrast | Local contrast threshold. If the contrast of the area surrounding the pixel is below uLocalContrast, 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 uLocalContrast, the local threshold value is calculated and used. The range for uLocalContrast is 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function converts a bitmap into a black and white image without changing its bits per pixel.

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.

Here are some hints on using this function:

Increasing uLocalContrast increases the number of pixels that use the global threshold. This tends to preserve the general aspect of the image and reduces the improvement in the areas with many details. Reducing uLocalContrast, increases the contrast in areas with many details.

Increasing uDim increases the area used for local contrast. This makes the color changes smoother.

This function is good as a prerequisite for converting scanned images to 1-bit, because it uses one threshold for background and another for text.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_IntensityDetectBitmap , L_MedianFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_WindowLevel, L_DespeckleBitmap, L_DeskewBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Modifying Intensity Values

Example

/* This example loads a bitmap and converts it into a black and white image without changing its bits per pixel */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* convert it into a black and white image without changing its bits per pixel */
L_DynamicBinaryBitmap (&LeadBitmap, 8, 16);


L_EdgeDetectEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EdgeDetectEffectBitmap(pBitmap, uLevel, uThreshold, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uLevel; | /* edge weight */
L_UINT uThreshold; | /* threshold value */
L_UINT uFlags; | /* edges type */

Performs edge detection on the image.

Parameter

Description

pBitmap

Pointer to the bitmap handle that references the bitmap on which to apply the effect.

uLevel

Level value used to determine the brightness of the edges. Standard value is 50. Range between 1 and 100. Big values will produce bright edges.

uThreshold

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. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

uFlags

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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function detects the edges in a bitmap and then replaces the values of edges by new values calculated according to the uFlags.

Support for 12 and 16-bit grayscale images are available only in the Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EdgeDetectorBitmap, L_SpatialFilterBitmap, L_EdgeDetectStatisticalBitmap, L_DirectionEdgeStatisticalBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_DiffuseGlowBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply find edges effect on the image*/
L_EdgeDetectEffectBitmap(&LeadBitmap, 50, 0, EDGE_SOFT);


L_EdgeDetectorBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EdgeDetectorBitmap(pBitmap, uThreshold, uFilter)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* threshold value */
L_UINT uFilter; | /* filter to be used */

Applies the specified edge filter to the specified bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the edge filter.
uThreshold | 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.
uFilter | 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

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 function can process the whole image or a region of the image.

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.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CombineBitmap, L_IntensityDetectBitmap, L_SharpenBitmap, L_SpatialFilterBitmap, L_SkeletonBitmap, L_CorrelationBitmap
Topics: | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Image Processing: Filtering Images
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and finds its edges. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* find the edges of the bitmap */
L_EdgeDetectorBitmap (&LeadBitmap,60, EDG_SOBEL_ALL);


L_EdgeDetectStatisticalBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EdgeDetectStatisticalBitmap(pBitmap, uDim, uThreshold, crEdgeColor, crBkColor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the edge detector neighborhood */
L_UINT uThreshold; | /* threshold value */
COLORREF crEdgeColor; | /* color value */
COLORREF crBkColor; | /* color value */

Detects edges by examining the variation of colors in all directions using statistical indices.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap in which the edge detector is applied.
uDim | Dimensions of the neighborhood used to detect edges (uDim x uDim), in pixels.
uThreshold | 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. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.
crEdgeColor | The COLORREF value that specifies the edge color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crBkColor | The COLORREF value that specifies the non edge color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The edges are detected by applying a statistical filter that analyzes the variations of colors in all directions around each pixel.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_IntensityDetectBitmap, L_SharpenBitmap, L_SpatialFilterBitmap, L_EdgeDetectorBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap
Topics: | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Filtering Images
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* The following example loads a bitmap and applies an edge detector statistical function*/

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply an edge detector statistical function */
L_EdgeDetectStatisticalBitmap(&LeadBitmap, 15, 128, RGB(255, 255, 255), RGB(0, 0, 0));


L_EfxDraw3dShape

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxDraw3dShape(hDC, uShape, pRect, crBack, hdcBack, prcBack, uBackStyle, crFill, uFillStyle, crBorder, uBorderStyle, uBorderWidth, crInnerHilite, crInnerShadow, uInnerStyle, uInnerWidth, crOuterHilite, crOuterShadow, uOuterStyle, uOuterWidth, nShadowX, nShadowY, crShadow, hRgn)

HDC hDC; | /* handle to the target device context */
L_UINT uShape; | /* type of shape */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
COLORREF crBack; | /* background color */
HDC hdcBack; | /* handle to the device context for background */
RECT L_FAR * prcBack; | /* pointer to the display background rectangle */
L_UINT uBackStyle; | /* background style */
COLORREF crFill; | /* foreground color */
L_UINT uFillStyle; | /* foreground style */
COLORREF crBorder; | /* border color */
L_UINT uBorderStyle; | /* border style */
L_UINT uBorderWidth; | /* border width */
COLORREF crInnerHilite; | /* inner band highlight color */
COLORREF crInnerShadow; | /* inner band shadow color */
L_UINT uInnerStyle; | /* inner band style */
L_UINT uInnerWidth; | /* inner band width */
COLORREF crOuterHilite; | /* outer band highlight color */
COLORREF crOuterShadow; | /* outer band shadow color */
L_UINT uOuterStyle; | /* outer band style */
L_UINT uOuterWidth; | /* outer band width */
L_INT nShadowX; | /* horizontal position of the shadow */
L_INT nShadowY; | /* vertical position of the shadow */
COLORREF crShadow; | /* shadow color */
HRGN hRgn; | /* region handle */

Draws the specified three-dimensional shape into the target device context using the specified color, style, and size.

Parameter | Description
hDC | Handle to the target device context.
uShape | Shape type. For valid values, refer to Effect Shapes.
pRect | Pointer to the display destination rectangle.
crBack | COLORREF value that specifies the background color.
hdcBack | Handle to the source device context for background. Use this parameter and prcBack to place an image from another device context into the background of the shape. To use a background image, the uFillStyle parameter must not be EFX_FILLSTYLE_SOLID.
prcBack | Pointer to the display background rectangle.
uBackStyle | Background style. For valid values, refer to Effect Background Styles.
crFill | COLORREF value that specifies the foreground color.
uFillStyle | Foreground style. The following are valid values:
 | Value | Meaning
 | EFX_FILLSTYLE_SOLID | Solid filling
 | EFX_FILLSTYLE_TRANSPARENT | Transparent filling
 | EFX_FILLSTYLE_HORIZONTAL | Horizontal lines (==)
 | EFX_FILLSTYLE_VERTICAL | Vertical lines (||)
 | EFX_FILLSTYLE_FDIAGONAL | Downward diagonal lines (//)
 | EFX_FILLSTYLE_BDIAGONAL | Upward diagonal lines (\\)
 | EFX_FILLSTYLE_CROSS | Cross lines (++)
 | EFX_FILLSTYLE_DIAGCROSS | Diagonal cross lines (XX)
crBorder | COLORREF value that specifies the border color.
uBorderStyle | Border style. The following are valid values:
 | Value | Meaning
 | EFX_BORDERSTYLE_TRANSPARENT | Transparent
 | EFX_BORDERSTYLE_SOLID | Solid line
 | EFX_BORDERSTYLE_DASH | Dash line (valid only for 1-pixel lines)
 | EFX_BORDERSTYLE_DOT | Dot line (valid only for 1-pixel lines)
 | EFX_BORDERSTYLE_DASHDOT | Dash dot line (valid only for 1-pixel lines)
 | EFX_BORDERSTYLE_DASHDOTDOT | Dash dot dot line (valid only for 1-pixel lines)
uBorderWidth | Border width.
crInnerHilite | COLORREF value that specifies the inner band highlight color.
crInnerShadow | COLORREF value that specifies the inner band shadow color.
uInnerStyle | Inner band style. The following are valid values:
 | Value | Meaning
 | EFX_INNERSTYLE_NONE | None
 | EFX_INNERSTYLE_INSET | Inner band inset
 | EFX_INNERSTYLE_RAISED | Inner band raised
 | The inner band is available only for squares and rectangles.
uInnerWidth | Inner band width.
crOuterHilite | COLORREF value that specifies the outer band highlight color.
crOuterShadow | COLORREF value that specifies the outer band shadow color.
uOuterStyle | Outer band style. The following are valid values:
 | Value | Meaning
 | EFX_OUTERSTYLE_NONE | None
 | EFX_OUTERSTYLE_INSET | Outer band inset
 | EFX_OUTERSTYLE_RAISED | Outer band raised
uOuterWidth | Outer band width.
nShadowX | Horizontal position of the shadow.
nShadowY | Vertical position of the shadow.
crShadow | COLORREF value that specifies the shadow color.
hRgn | Handle to a Windows region that defines the shape. This parameter is used only if the uShape parameter is EFX_SHAPE_REGION.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use hdcBack and prcBack to place an image from another device context into the background of the shape.

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using L_EfxDraw3dShape */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
HDC hdcMem; /* HDC for background image */
HBITMAP hbmMem; /* Bitmap for background image */
RECT rcbm;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Create the gradient for the background of the 3D shape */
rcbm.top = pDest->top;
rcbm.left = pDest->left;
rcbm.bottom = pDest->bottom;
rcbm.right = pDest->right;
OffsetRect(&rcbm, -pDest->left, -pDest->top);
hdcMem = CreateCompatibleDC(hdc);
hbmMem = CreateCompatibleBitmap(hdc, rcbm.right, rcbm.bottom);
hbmMem = (HBITMAP)SelectObject(hdcMem, hbmMem);
/* Place a gradient in the background of the 3D shape */
L_EfxGradientFillRect ( hdcMem,
&rcbm,
EFX_GRADIENT_LINE_L_TO_R,
RGB(255, 0, 0),
RGB(0, 0, 255),
16 );
/* Draw the 3D shape */
L_EfxDraw3dShape ( hdc, /* device context */
EFX_SHAPE_STAR4, /* star shape */
pDest, /* destination rectangle */
RGB ( 0,0,255 ), /* background color, blue */
hdcMem, /* use this to place an image in the background */
&rcbm, /* display background rectangle */
EFX_BACKSTYLE_TRANSLUCENTTILEDIMAGE,/* style flags for 3D shape */
RGB (255,0,0 ), /* foreground color, red */
EFX_FILLSTYLE_TRANSPARENT,/* foreground style */
RGB ( 255,0,0 ), /* border color, red */
EFX_BORDERSTYLE_SOLID, /* border style */
5, /* border width */
RGB ( 255,255,255 ), /* inner band highlight color, white */
RGB ( 128,128,128 ), /* inner band shadow color */
EFX_INNERSTYLE_INSET,/* inner band style */
3, /* inner band width */
RGB ( 255,0,0 ), /* outer band highlight color, RED */
RGB ( 128,128,128 ), /* outer band shadow color */
EFX_OUTERSTYLE_INSET,/* outer band style */
3, /* outer band width */
2, /* horizontal shadow position */
2, /* vertical shadow position */
RGB ( 0,0,0 ), /* shadow color, black */
NULL ); /* no region handle */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
DeleteObject(SelectObject(hdcMem, hbmMem));
DeleteDC(hdcMem);
return;
}


L_EfxDraw3dText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxDraw3dText(hDC, pszText, pRect, uFlags, nXDepth, nYDepth, crText, crShadow, crHilite, hFont, hdcFore)

HDC hDC; | /* handle to the target device context */
L_TCHAR L_FAR* pszText; | /* text string */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
L_UINT uFlags; | /* text style */
L_INT nXDepth; | /* horizontal shadow position */
L_INT nYDepth; | /* vertical shadow position */
COLORREF crText; | /* text color */
COLORREF crShadow; | /* shadow color */
COLORREF crHilite; | /* border color */
HFONT hFont; | /* handle to the selected font */
HDC hdcFore; | /* handle to the device context for foreground */

Draws three-dimensional text into the target device context using the specified font, color, and style.

Parameter | Description
hDC | Handle to the target device context.
pszText | Text string.
pRect | Pointer to the display destination rectangle.
uFlags | Text style. Use this parameter to control the style and justification of the three-dimensional text. For valid values, refer to Effect Text Style Flags and Effect Text Alignment Flags.
nXDepth | Horizontal shadow position.
nYDepth | Vertical shadow position.
crText | COLORREF value that specifies the text color.
crShadow | COLORREF value that specifies the shadow color.
crHilite | COLORREF value that specifies the border color.
hFont | Handle to the selected font.
hdcFore | Handle to the source device context for the foreground. Use this parameter to place an image (such as a gradient) on the surface of the three-dimensional text. Use NULL to paint the color specified in crText.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use the uFlags parameter to control the style and justification of the three-dimensional text. Use the hdcFore parameter to place an image (such as a gradient) on the surface of the three-dimensional text.

Drop shadows are available only for the following uFlags values:

EFX_TEXT_DROPSHADOW
EFX_TEXT_BLOCKSHADOW
EFX_TEXT_OUTLINEBLOCK

The crShadow color is used for three-dimensional effects for the following uFlags values:

EFX_TEXT_INSETHEAVY
EFX_TEXT_EXTRAHEAVY
EFX_TEXT_RAISEDHEAVY
EFX_TEXT_RAISEDEXTRAHEAVY

The crHilite color is used only for the following uFlags values:

EFX_TEXT_INSETLIGHT
EFX_TEXT_INSETEXTRALIGHT
EFX_TEXT_INSETHEAVY
EFX_TEXT_INSETEXTRAHEAVY
EFX_TEXT_RAISEDLIGHT
EFX_TEXT_RAISEDEXTRALIGHT
EFX_TEXT_RAISEDHEAVY
EFX_TEXT_RAISEDEXTRAHEAVY
EFX_TEXT_OUTLINEBLOCK

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using L_EfxDraw3dText */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Draw the 3d Text */
L_EfxDraw3dText ( hdc, /* device context */
TEXT("3D Text - LEADTOOLS"),
pDest, /* destination rectangle */
/* style flags for 3D Text */
EFX_TEXT_DROPSHADOW | EFX_TEXT_HCENTER | EFX_TEXT_VCENTER,
2, /* horizontal shadow position */
2, /* vertical shadow position */
RGB ( 0,0,255 ), /* text color, blue */
RGB ( 0,0,0 ), /* shadow color, black */
RGB ( 255,255,255 ), /* border color, white */
(HFONT) GetStockObject(SYSTEM_FONT ),
NULL ); /* do not put an image in the font */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_EfxDrawFrame

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxDrawFrame(hDC, pRect, uFlags, uFrameWidth, crFrame, uInnerWidth, crInner1, crInner2, uOuterWidth, crOuter1, crOuter2)

HDC hDC; | /* handle to the target device context */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
L_UINT uFlags; | /* frame style */
L_UINT uFrameWidth; | /* middle band width */
COLORREF crFrame; | /* middle band color */
L_UINT uInnerWidth; | /* inner band width */
COLORREF crInner1; | /* inner band shadow color */
COLORREF crInner2; | /* inner band highlight color */
L_UINT uOuterWidth; | /* outer band width */
COLORREF crOuter1; | /* outer band shadow color */
COLORREF crOuter2; | /* outer band highlight color */

Draws a rectangular frame having the specified style, color, and border width into the target device context.

Parameter | Description
hDC | Handle to the target device context.
pRect | Pointer to the display destination rectangle.
uFlags | Frame style. The following are valid values:
 | Value | Meaning
 | EFX_FRAME_INNER_INSET | [0x0000] Inner band inset
 | EFX_FRAME_INNER_RAISED | [0x0001] Inner band raised
 | EFX_FRAME_OUTER_INSET | [0x0000] Outer band inset
 | EFX_FRAME_OUTER_RAISED | [0x0010] Outer band raised
 | EFX_FRAME_ADJUST_RECT | [0x0100] Adjust dimensions of the destination rectangle
uFrameWidth | Middle band width.
crFrame | COLORREF value that specifies the middle band color.
uInnerWidth | Inner band width.
crInner1 | COLORREF value that specifies the inner band shadow color.
crInner2 | COLORREF value that specifies the inner band highlight color.
uOuterWidth | Outer band width.
crOuter1 | COLORREF value that specifies the outer band shadow color.
crOuter2 | COLORREF value that specifies the outer band highlight color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using the L_EfxDrawFrame */
/* function to draw a frame with a palette */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Draw the frame */
L_EfxDrawFrame ( hdc, /* Device context */
pDest, /* Destination rectangle */
EFX_FRAME_OUTER_RAISED, /* outer band raised */
2, /* middle band width*/
RGB ( 255,0,0 ), /* middle band color */
2, /* inner band width*/
RGB ( 100,100,100 ), /* inner band shadow color */
RGB ( 0,0,0 ), /* inner band highlight color */
2, /* outer band width*/
RGB ( 128,128,128 ), /* inner band shadow color */
RGB ( 255,255,0 ) ); /* inner band highlight color */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_EfxDrawRotated3dText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxDrawRotated3dText(hDC, pszText, pRect, nAngle, uFlags, nXDepth, nYDepth, crText, crShadow, crHilite, hFont, hdcFore)

HDC hDC; | /* handle to the target device context */
L_TCHAR L_FAR* pszText; | /* text string */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
L_INT nAngle; | /* Text angle */
L_UINT uFlags; | /* text style */
L_INT nXDepth; | /* horizontal shadow position */
L_INT nYDepth; | /* vertical shadow position */
COLORREF crText; | /* text color */
COLORREF crShadow; | /* shadow color */
COLORREF crHilite; | /* border color */
HFONT hFont; | /* handle to the selected font */
HDC hdcFore; | /* handle to the source device context for foreground */

Draws three-dimensional text which is rotated by the amount specified into the target device context using the specified font, color, and style.

Parameter | Description
hDC | Handle to the target device context.
pszText | Text string.
pRect | Pointer to the display destination rectangle.
nAngle | Text angle, in tenths of degrees.
uFlags | Text style. Use this parameter to control the style and justification of the three-dimensional text. For valid values, refer to Effect Text Style Flags and Effect Text Alignment Flags.
nXDepth | Horizontal shadow position.
nYDepth | Vertical shadow position.
crText | COLORREF value that specifies the text color.
crShadow | COLORREF value that specifies the shadow color.
crHilite | COLORREF value that specifies the border color.
hFont | Handle to the selected font. The font must be TrueType in order to rotate.
hdcFore | Handle to the source device context for the foreground. Use this parameter to place an image (such as a gradient) on the surface of the three-dimensional text. Use NULL to paint the color specified in crText.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The font must be TrueType in order to rotate.

Drop shadows are available only for the following uFlags values:

EFX_TEXT_DROPSHADOW
EFX_TEXT_BLOCKSHADOW
EFX_TEXT_OUTLINEBLOCK

The crShadow color is used for three-dimensional effects for the following uFlags values:

EFX_TEXT_INSETHEAVY
EFX_TEXT_INSETEXTRAHEAVY
EFX_TEXT_RAISEDHEAVY
EFX_TEXT_RAISEDEXTRAHEAVY

The crHilite color is used only for the following uFlags values:

EFX_TEXT_INSETLIGHT
EFX_TEXT_INSETEXTRALIGHT
EFX_TEXT_INSETHEAVY
EFX_TEXT_INSETEXTRAHEAVY
EFX_TEXT_RAISEDLIGHT
EFX_TEXT_RAISEDEXTRALIGHT
EFX_TEXT_RAISEDHEAVY
EFX_TEXT_RAISEDEXTRAHEAVY
EFX_TEXT_OUTLINEBLOCK

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using L_EfxDrawRotated3dText */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
HFONT hFont; /* Font to use for the text, must be TrueType */
HDC hdcMem; /* HDC for foreground image */
HBITMAP hbmMem; /* Bitmap for foreground image */
RECT rcbm;
/* Get the device context */
hdc = GetDC (hWnd);
/* Create the gradient for the foreground of the 3D text */
rcbm.top = pDest->top;
rcbm.left = pDest->left;
rcbm.bottom = pDest->bottom;
rcbm.right = pDest->right;
OffsetRect(&rcbm, -pDest->left, -pDest->top);
hdcMem = CreateCompatibleDC(hdc);
hbmMem = CreateCompatibleBitmap(hdc, rcbm.right, rcbm.bottom);
hbmMem = (HBITMAP)SelectObject(hdcMem, hbmMem);
/* Place a gradient in the foreground of the 3D text */
L_EfxGradientFillRect ( hdcMem,
&rcbm,
EFX_GRADIENT_LINE_L_TO_R,
RGB(255, 0, 0),
RGB(0, 0, 255),
16 );
/* Create the font */
hFont = CreateFont (-MulDiv(32, GetDeviceCaps(hdc, LOGPIXELSY), 72),
0, 0, 0,
FW_BOLD, FALSE, FALSE, FALSE,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
TEXT("Arial"));
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Draw the Rotated 3D text */
L_EfxDrawRotated3dText ( hdc, /* device context */
TEXT("Rotated 3D Text - LEADTOOLS"),
pDest, /* destination rectangle */
300, /* rotate 30 degrees*/
/* style flags for 3D text */
EFX_TEXT_DROPSHADOW | EFX_TEXT_HCENTER | EFX_TEXT_VCENTER,
2, /* horizontal shadow position */
2, /* vertical shadow position */
RGB ( 0,0,255 ), /* text color, blue */
RGB ( 0,0,0 ), /* shadow color, black */
RGB ( 255,255,255 ), /* border color, white */
hFont,
hdcMem ); /* use this to put an image in the font */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
DeleteObject (hFont);
DeleteObject(SelectObject(hdcMem, hbmMem));
DeleteDC(hdcMem);
return;
}


L_EfxEffectBlt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxEffectBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, uEffect, uGrain, uDelay, nSpeed, nCycles, uPass, uMaxPass, fTransparency, crTransparency, uWandWidth, crWand, uROP)

HDC hdcDest; | /* handle to the target device context */
L_INT nXDest; | /* x coordinate of the origin of the destination rectangle */
L_INT nYDest; | /* y coordinate of the origin of the destination rectangle */
L_INT nWidth; | /* width of the destination rectangle */
L_INT nHeight; | /* height of the destination rectangle */
HDC hdcSrc; | /* handle to the source device context */
L_INT nXSrc; | /* x coordinate of the origin of the source rectangle */
L_INT nYSrc; | /* y coordinate of the origin of the source rectangle */
L_UINT uEffect; | /* effect to apply when painting */
L_UINT uGrain; | /* graining size */
L_UINT uDelay; | /* delay between graining steps */
L_INT nSpeed; | /* speed of the wave */
L_INT nCycles; | /* number of cycles or repetitions */
L_UINT uPass; | /* pass number when using a pattern brush */
L_UINT uMaxPass; | /* maximum passes for a pattern brush */
L_BOOL fTransparency; | /* transparency paint flag */
COLORREF crTransparency; | /* transparency paint color */
L_UINT uWandWidth; | /* wand width */
COLORREF crWand; | /* wand color */
L_UINT32 uROP; | /* Windows ROP code for display */

Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context, while applying a special effect.

Parameter | Description
hdcDest | Handle to the target device context.
nXDest | X coordinate of the origin of the destination rectangle.
nYDest | Y coordinate of the origin of the destination rectangle.
nWidth | Width of the destination rectangle.
nHeight | Height of the destination rectangle.
hdcSrc | Handle to the source device context.
nXSrc | X coordinate of the origin of the source rectangle.
nYSrc | Y coordinate of the origin of the source rectangle.
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
uGrain | 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. If the uEffect parameter is from the Wave class this represents the duration or height of the wave. Valid values are 1 to 256.
uDelay | Delay between graining steps, in milliseconds.
nSpeed | Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the uEffect parameter is from the Wave class.
nCycles | Number of cycles or repetitions used to draw the wave. This parameter is valid only if the uEffect parameter is from the Wave class.
uPass | Pass number when using a pattern brush. Use 1 for painting in one pass.
uMaxPass | Maximum passes for a pattern brush. Use 1 for painting in one pass.
fTransparency | TRUE to implement transparency by not painting pixels of the color specified in the crTransparency parameter; FALSE if transparency is not implemented.
crTransparency | COLORREF value that specifies the transparent color.
uWandWidth | Wand width, in pixels.
crWand | COLORREF value that specifies the wand color.
uROP | Windows ROP code for display. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function as a replacement for the Windows BitBlt API function when you want a special painting effect.

Use the uGrain and uDelay parameters to control the speed of the display. The uGrain parameter controls the size of the painting increment, and uDelay controls the time between increments.

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 Effect Types can have a wand.

Use the uPass and uMaxPass parameters to paint the image in more than one pass. For example, if you want a 3-pass paint, use uMaxPass of 3 and paint 3 times, once with uPass = 1, once with uPass = 2, and once with uPass = 3.

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

If the uEffect parameter is from the Twirl class, White Turnover class, Turnover class, Replace class, Laser class, Fade Normal class, Fade Black and White class, Fade Color class or Wave Class, the uPass and uMaxPass parameters have no effect.

If the uEffect parameter is from the Fade Normal class, Fade Black and White class or Fade Color class, the uGrain parameter has no effect. However, if the uEffect parameter is from the Wave class, the uGrain parameter contains the wave size.

If the uEffect parameter is from the White Turnover class, the Turnover class or the Replace class, the uWandWidth and crWand parameters have no effect. However, if the uEffect parameter is from the Fade Color class, the crWand parameter contains the bitmap color level.

The nSpeed and nCycles parameters have effect only if the uEffect parameter is from the Wave class.

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows how to use L_EfxEffectBlt to paint a bitmap */
/* to the screen using a special effect */
void TestFunction(HWND hWnd )
{
HDC hdcDest; /* Device context for the current window */
HDC hdcSrc; /* Device context for the source image */
BITMAPHANDLE Bitmap; /* image that will be blt */
HBITMAP hbmMem; /* image that will be blt */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hPaintPal = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdcDest = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdcDest, BITSPIXEL ) * GetDeviceCaps ( hdcDest, PLANES );
/* Load an image to BLT */
/* Load the image as screen bit-depth */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &Bitmap, sizeof(BITMAPHANDLE), (nBitsPerPixel <= 8) ? nBitsPerPixel : 24, ORDER_BGR, NULL, NULL );
/* Create the source DC */
hdcSrc = CreateCompatibleDC(hdcDest);
/* Convert the image to DDB and select it into the source dc */
hbmMem = L_ConvertToDDB ( hdcDest, &Bitmap );
hbmMem = (HBITMAP)SelectObject(hdcSrc, hbmMem);
if ( nBitsPerPixel <=8 )
{
hPaintPal = L_CreatePaintPalette( hdcDest, &Bitmap );
hSavedPalette = SelectPalette (hdcDest, hPaintPal, FALSE);
/* Realize our palette */
RealizePalette (hdcDest);
}
/* Paint the image using L_EfxEffectBlt and 3 steps */
L_EfxEffectBlt ( hdcDest, /* handle to target dc */
0, /* x-coordinate of destination rectangle's upper-left corner */
0, /* x-coordinate of destination rectangle's upper-left corner */
Bitmap.Width, /* width of destination rectangle */
Bitmap.Height, /* height of destination rectangle */
hdcSrc, /* handle to source device context */
0, /* x-coordinate of source rectangle's upper-left corner */
0, /* y-coordinate of source rectangle's upper-left corner */
EFX_EFFECT_WIPE_L_TO_R, /* paint effect to use */
1, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
1, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* transparent color, black */
3, /* wand width */
RGB ( 255,0,0 ), /* wand color, red */
SRCCOPY ); /* Windows raster operation code */
L_EfxEffectBlt ( hdcDest, /* handle to target DC */
0, /* x-coordinate of destination rectangle's upper-left corner */
0, /* x-coordinate of destination rectangle's upper-left corner */
Bitmap.Width, /* width of destination rectangle */
Bitmap.Height, /* height of destination rectangle */
hdcSrc, /* handle to source device context */
0, /* x-coordinate of source rectangle's upper-left corner */
0, /* y-coordinate of source rectangle's upper-left corner */
EFX_EFFECT_WIPE_R_TO_L, /* paint effect to use */
1, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
2, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* transparent color, black */
3, /* wand width */
RGB ( 255,0,0 ), /* wand color, red */
SRCCOPY ); /* Windows raster operation code */
L_EfxEffectBlt ( hdcDest, /* handle to target dc */
0, /* x-coordinate of destination rectangle's upper-left corner */
0, /* x-coordinate of destination rectangle's upper-left corner */
Bitmap.Width, /* width of destination rectangle */
Bitmap.Height, /* height of destination rectangle */
hdcSrc, /* handle to source device context */
0, /* x-coordinate of source rectangle's upper-left corner */
0, /* y-coordinate of source rectangle's upper-left corner */
EFX_EFFECT_WIPE_L_TO_R, /* paint effect to use */
1, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
3, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* transparent color, black */
3, /* wand width */
RGB ( 255,0,0 ), /* wand color, red */
SRCCOPY ); /* Windows raster operation code */
/* Restore the old palette */
if ( hPaintPal )
{
SelectPalette (hdcDest, hSavedPalette, FALSE);
DeleteObject (hPaintPal);
}
/* Release the device context */
ReleaseDC ( hWnd, hdcDest );
DeleteDC(hdcSrc);
DeleteObject(hbmMem);
return;
}

/* This example shows how to use L_EfxEffectBlt with wave effect */
void TestFunction(HWND hWnd )
{
HDC hdcDest; /* Device context for the current window */
HDC hdcSrc; /* Device context for the source image */
BITMAPHANDLE Bitmap; /* image that will be blt */
HBITMAP hbmMem; /* image that will be blt */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hPaintPal = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdcDest = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdcDest, BITSPIXEL ) * GetDeviceCaps ( hdcDest, PLANES );
/* Load an image to BLT */
/* Load the image as screen bit-depth */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &Bitmap, sizeof(BITMAPHANDLE), (nBitsPerPixel <= 8) ? nBitsPerPixel : 24, ORDER_BGR, NULL, NULL );
/* Create the source DC */
hdcSrc = CreateCompatibleDC(hdcDest);
/* Convert the image to DDB and select it into the source dc */
hbmMem = L_ConvertToDDB ( hdcDest, &Bitmap );
hbmMem = (HBITMAP)SelectObject(hdcSrc, hbmMem);
if ( nBitsPerPixel <=8 )
{
hPaintPal = L_CreatePaintPalette( hdcDest, &Bitmap );
hSavedPalette = SelectPalette (hdcDest, hPaintPal, FALSE);
/* Realize our palette */
RealizePalette (hdcDest);
}
L_EfxEffectBlt ( hdcDest, /* handle to target dc */
0, /* x-coordinate of destination rectangle's upper-left corner */
0, /* x-coordinate of destination rectangle's upper-left corner */
Bitmap.Width, /* width of destination rectangle */
Bitmap.Height, /* height of destination rectangle */
hdcSrc, /* handle to source device context */
0, /* x-coordinate of source rectangle's upper-left corner */
0, /* y-coordinate of source rectangle's upper-left corner */
EFX_EFFECT_WAVE_TB, /* paint effect to use */
1, /* graining size */
10, /* delay between graining steps */
20, /* speed of the wave */
1, /* number of cycles or repetitions */
1, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* transparent color, black */
3, /* wand width */
RGB ( 255,0,0 ), /* wand color, red */
SRCCOPY ); /* Windows raster operation code */

/* Restore the old palette */
if ( hPaintPal )
{
SelectPalette (hdcDest, hSavedPalette, FALSE);
DeleteObject (hPaintPal);
}
/* Release the device context */
ReleaseDC ( hWnd, hdcDest );
DeleteDC(hdcSrc);
DeleteObject(hbmMem);
return;
}


L_EfxGradientFillRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxGradientFillRect(hDC, pRect, uStyle, crStart, crEnd, uSteps)

HDC hDC; | /* handle to the target device context */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
L_UINT uStyle; | /* gradient style */
COLORREF crStart; | /* starting color */
COLORREF crEnd; | /* ending color */
L_UINT uSteps; | /* number of gradient color steps */

Draws a rectangle into the target device context, and then fills the rectangle with a gradient from the specified starting color to the specified ending color.

Parameter | Description
hDC | Handle to the target device context.
pRect | Pointer to the display destination rectangle.
uStyle | Gradient style. For valid values, refer to Effect Gradient Styles.
crStart | COLORREF value that specifies the starting color.
crEnd | COLORREF value that specifies the ending color.
uSteps | Number of gradient color steps. Valid values are 2 to 256.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxPaintBitmap, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using the L_EfxGradientFillRect */
/* function to draw and fill a rectangle with a color gradient. */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Draw the gradient filled rectangle */
L_EfxGradientFillRect ( hdc, /* device context */
pDest, /* destination rectangle */
EFX_GRADIENT_ELLIPSE_TO_C, /* out to center */
RGB ( 255,0,0 ), /* starting color, red */
RGB ( 0,0,255 ), /* ending color, blue */
12 ); /* gradient color steps */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_EfxPaintBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxPaintBitmap(hDC, pBitmap, pSrc, pSrcClip, pDest, pDestClip, uEffect, uGrain, uDelay, nSpeed, nCycles, uPass, uMaxPass, fTransparency, crTransparency, uWandWidth, crWand, uROP)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
RECT L_FAR * pSrc; | /* pointer to the display source rectangle */
RECT L_FAR * pSrcClip; | /* pointer to the display source clipping rectangle */
RECT L_FAR * pDest; | /* pointer to the display rectangle */
RECT L_FAR * pDestClip; | /* pointer to the display destination clipping rectangle */
L_UINT uEffect; | /* effect to apply when painting */
L_UINT uGrain; | /* graining size */
L_UINT uDelay; | /* delay between graining steps */
L_INT nSpeed; | /*speed of the wave */
L_INT nCycles; | /* number of cycles or repetitions*/
L_UINT uPass; | /* pass number when using a pattern brush */
L_UINT uMaxPass; | /* maximum passes for a pattern brush */
L_BOOL fTransparency; | /* transparency paint flag */
COLORREF crTransparency; | /* transparency paint color */
L_UINT uWandWidth; | /* wand width */
COLORREF crWand; | /* wand color */
L_UINT32 uROP; | /* Windows ROP code for display */

Applies an effect when painting a bitmap to a target device context. The effect, commonly used for slide show transitions, specifies how the image is painted, not how it looks when painting is finished.

Parameter | Description
hDC | Handle to the target device context.
pBitmap | Pointer to the bitmap handle referencing the bitmap to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pSrcClip | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDest | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pDestClip | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context.
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
uGrain | 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. If the uEffect parameter is from the Wave class this represents the duration or height of the wave. Valid values are 1 to 256.
uDelay | Delay between graining steps, in milliseconds.
nSpeed | Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the uEffect parameter is from the Wave class.
nCycles | Number of cycles or repetitions used to draw the wave. This parameter is valid only if the uEffect parameter is from the Wave class.
uPass | Pass number when using a pattern brush. Use 1 for painting in one pass.
uMaxPass | Maximum passes for a pattern brush. Use 1 for painting in one pass.
fTransparency | TRUE to implement transparency by not painting pixels of the color specified in the crTransparency parameter; FALSE if transparency is not implemented.
crTransparency | COLORREF value that specifies the transparent color.
uWandWidth | Wand width, in pixels.
crWand | COLORREF value that specifies the wand color.
uROP | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Use this function instead of L_PaintDCEffect when more or different paint effects are desired.

Use the uGrain and uDelay parameters to control the speed of the display. The uGrain parameter controls the size of the painting increment, and uDelay controls the time between increments.

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 Effect Types can have a wand.

Use the uPass and uMaxPass parameters to paint the image in more than one pass. For example, if you want a 3-pass paint, use uMaxPass of 3 and paint 3 times, once with uPass = 1, once with uPass = 2, and once with uPass = 3.

This function uses source and destination rectangles the same as L_PaintDC. For a complete explanation of the rectangles, refer to L_PaintDC.

For general information, refer to Implementing Special Effects.

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

If the uEffect parameter is from the Twirl class, Wave class, White Turnover class, Turnover class, Replace class, Laser class, Fade Normal class, Fade Black and White class, Fade Color class or Wave class, the uPass and uMaxPass parameters have no effect.

If the uEffect parameter is from the Fade Normal class, Fade Black and White class or Fade Color class, the uGrain parameter has no effect. However, if the uEffect parameter is from the Wave class, the uGrain parameter contains the wave size.

If the uEffect parameter is from the White Turnover class, the Turnover class or the Replace class, the uWandWidth and crWand parameters have no effect. However, if the uEffect parameter is from the Fade Color class, the crWand parameter contains the bitmap color level.

The nSpeed and nCycles parameters have effect only if the uEffect parameter is from the Wave class.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintTransition, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Implementing Transparency
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using L_EfxPaintBitmap. */
void TestFunction ( HWND hWnd, RECT *pDest, BITMAPHANDLE * pBitmap )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = L_CreatePaintPalette ( hdc, pBitmap );
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Paint the bitmap using 3 steps */
L_EfxPaintBitmap ( hdc, /* device context */
pBitmap, /* bitmap to paint */
NULL, /* source rectangle */
NULL, /* source clip rectangle */
pDest, /* destination rectangle */
NULL, /* destination clip rectangle */
EFX_EFFECT_WIPE4_L_R_T_B, /* effect to apply when painting the transition */
5, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
1, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
L_EfxPaintBitmap ( hdc, /* device context */
pBitmap, /* bitmap to paint */
NULL, /* source rectangle */
NULL, /* source clip rectangle */
pDest, /* destination rectangle */
NULL, /* destination clip rectangle */
EFX_EFFECT_WIPE_RECTANGLE_IN, /* effect to apply when painting the transition */
5, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
2, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
L_EfxPaintBitmap ( hdc, /* device context */
pBitmap, /* bitmap to paint */
NULL, /* source rectangle */
NULL, /* source clip rectangle */
pDest, /* destination rectangle */
NULL, /* destination clip rectangle */
EFX_EFFECT_WIPE_RECTANGLE_OUT, /* effect to apply when painting the transition */
5, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
3, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
/* Restore the old palette */
if ( hOurPalette )
{
SelectPalette (hdc, hSavedPalette, FALSE);
DeleteObject (hOurPalette);
}
/* Release the device context */
ReleaseDC ( hWnd, hdc );
return;
}


L_EfxPaintTransition

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxPaintTransition(hDC, uTransition, crBack, crFore, uSteps, pDest, uEffect, uGrain, uDelay, nSpeed, nCycles, uPass, uMaxPass, fTransparency, crTransparency, uWandWidth, crWand, uROP)

HDC hDC; | /* handle to the target device context */
L_UINT uTransition; | /* filling style */
COLORREF crBack; | /* background color */
COLORREF crFore; | /* foreground color */
L_UINT uSteps; | /* number of gradient color steps */
RECT L_FAR * pDest; | /* pointer to the display rectangle */
L_UINT uEffect; | /* effect to apply when painting */
L_UINT uGrain; | /* graining size */
L_UINT uDelay; | /* delay between graining steps */
L_INT nSpeed; | /* speed of the wave */
L_UINT nCycles; | /* number of cycles or repetitions */
L_UINT uPass; | /* pass number when using a pattern brush */
L_UINT uMaxPass; | /* maximum passes for a pattern brush */
L_BOOL fTransparency; | /* transparency paint flag */
COLORREF crTransparency; | /* transparency paint color */
L_UINT uWandWidth; | /* wand width */
COLORREF crWand; | /* wand color */
L_UINT32 uROP; | /* Windows ROP code for display */

Draws a rectangle into the target device context with the specified fill pattern and color while using a special effect.

Parameter | Description
hDC | Handle to the target device context.
uTransition | Filling style during transition. For valid values, refer to Effect Transition Filling Styles.
crBack | COLORREF value that specifies the background color. If a gradient transition is specified in the uTransition parameter, this is the beginning color for the gradient transition. Otherwise, it is the only color that is used.
crFore | COLORREF value that specifies the foreground color. If a gradient transition is specified in the uTransition parameter, this is the ending color for the gradient transition. Otherwise, this color that is not used.
uSteps | Number of gradient color steps. This parameter is used only if a gradient transition is specified in the uTransition parameter. Valid values are 2 to 256.
pDest | Pointer to the display destination rectangle.
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
uGrain | 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. If the uEffect parameter is from the Wave class this represents the duration or height of the wave. Valid values are 1 to 256.
uDelay | Delay between graining steps, in milliseconds.
nSpeed | Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the uEffect parameter is from the Wave class.
nCycles | Number of cycles or repetitions used to draw the wave. This parameter is valid only if the uEffect parameter is from the Wave class.
uPass | Pass number when using a pattern brush. Use 1 for painting in one pass.
uMaxPass | Maximum passes for a pattern brush. Use 1 for painting in one pass.
fTransparency | TRUE to implement transparency by not painting pixels of the color specified in the crTransparency parameter; FALSE if transparency is not implemented.
crTransparency | COLORREF value that specifies the transparency paint color.
uWandWidth | Wand width, in pixels.
crWand | COLORREF value that specifies the wand color.
uROP | Windows ROP code for display. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to create a special effect screen transition before painting the next image.

Use the uGrain and uDelay parameters to control the speed of the display. The uGrain parameter controls the size of the painting increment, and uDelay controls the time between increments.

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 Effect Types can have a wand.

Use the uPass and uMaxPass parameters to paint the image in more than one pass. For example, if you want a 3-pass paint, use uMaxPass of 3 and paint 3 times, once with uPass = 1, once with uPass = 2, and once with uPass = 3.

For general information, refer to Implementing Special Effects.

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

If the uEffect parameter is from the Twirl class, White Turnover class, Turnover class, Replace class, Laser class, Fade Normal class, Fade Black and White class, Fade Color class or Wave class, the uPass and uMaxPass parameters have no effect.

If the uEffect parameter is from the Fade Normal class, Fade Black and White class or Fade Color class, the uGrain parameter has no effect. However, if the uEffect parameter is from the Wave class, the uGrain parameter contains the wave size.

If the uEffect parameter is from the White Turnover class, the Turnover class or the Replace class, the uWandWidth and crWand parameters have no effect. However, if the uEffect parameter is from the Fade Color class, the crWand parameter contains the bitmap color level.

The nSpeed and nCycles parameters are valid only if the uEffect parameter is from the Wave class.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPatternFillRect
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using L_EfxPaintTransition */
void TestFunction ( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Paint the transition in 3 steps */
L_EfxPaintTransition ( hdc, /* device context */
EFX_TRANS_GRADIENT_LINE_R_TO_L, /* transition effect to paint */
RGB ( 255,0,0 ), /* background color, red */
RGB ( 0,0,255 ), /* foreground color, blue */
12, /* gradient color steps */
pDest, /* destination rectangle */
EFX_EFFECT_WIPE_RECTANGLE_IN, /* effect to apply when painting the transition */
4, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
1, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
L_EfxPaintTransition ( hdc, /* device context */
EFX_TRANS_GRADIENT_LINE_R_TO_L, /* transition effect to paint */
RGB ( 255,0,0 ), /* background color, red */
RGB ( 0,0,255 ), /* foreground color, blue */
12, /* gradient color steps */
pDest, /* destination rectangle */
EFX_EFFECT_WIPE_RECTANGLE_OUT, /* effect to apply when painting the transition */
4, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
2, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
L_EfxPaintTransition ( hdc, /* device context */
EFX_TRANS_GRADIENT_LINE_R_TO_L, /* transition effect to paint */
RGB ( 255,0,0 ), /* background color, red */
RGB ( 0,0,255 ), /* foreground color, blue */
12, /* gradient color steps */
pDest, /* destination rectangle */
EFX_EFFECT_WIPE_CIRCLE_C_CW_FROM_L, /* effect to apply when painting the transition */
4, /* graining size */
10, /* delay between graining steps */
0, /* speed of the wave */
0, /* number of cycles or repetitions */
3, /* step number for the pattern brush */
3, /* maximum steps for the pattern brush */
FALSE, /* do not use transparency */
0, /* no transparent color */
0, /* wand width */
0, /* no wand color */
SRCCOPY ); /* Windows raster operation code */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC ( hWnd, hdc );
return;
}


L_EfxPatternFillRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EfxPatternFillRect(hDC, pRect, uStyle, crBack, crFore)

HDC hDC; | /* handle to the target device context */
RECT L_FAR * pRect; | /* pointer to the display rectangle */
L_UINT uStyle; | /* filling style */
COLORREF crBack; | /* background color */
COLORREF crFore; | /* foreground color */

Draws a rectangle into the target device context, and then fills the rectangle with the specified pattern and color.

Parameter | Description
hDC | Handle to the target device context.
pRect | Pointer to the display destination rectangle.
uStyle | Filling style. The following are possible values. (Values cannot be combined.)
 | Value | Meaning
 | EFX_PATTERN_SOLID | Solid
 | 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 | Diagonal cross lines (XX)
crBack | COLORREF value that specifies the background color.
crFore | COLORREF value that specifies the foreground color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For general information, refer to Implementing Special Effects.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_EfxDraw3dShape, L_EfxDraw3dText, L_EfxDrawFrame, L_EfxDrawRotated3dText, L_EfxEffectBlt, L_EfxGradientFillRect, L_EfxPaintBitmap, L_EfxPaintTransition
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

/* This example shows the minimum requirements for using the L_EfxPatternFillRect */
/* function to draw and fill a rectangle with a pattern and color. */
void TestFunction( HWND hWnd, RECT *pDest )
{
HDC hdc; /* Device context for the current window */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
L_INT nBitsPerPixel;
/* Get the device context */
hdc = GetDC (hWnd);
/* Check the device to see if we need a palette */
nBitsPerPixel = GetDeviceCaps( hdc, BITSPIXEL ) * GetDeviceCaps ( hdc, PLANES );
if ( nBitsPerPixel <=8 )
{
hOurPalette = (HPALETTE)GetStockObject (DEFAULT_PALETTE);
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
}
/* Draw the pattern filled rectangle */
L_EfxPatternFillRect ( hdc, /* device context */
pDest, /* destination rectangle */
EFX_PATTERN_DIAG_CROSS, /* diagonal cross pattern */
RGB ( 0,0,0 ), /* background color, black */
RGB ( 0,0,255 ) ); /* foreground color, blue */
/* Restore the old palette */
if ( hOurPalette )
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_EmbossBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EmbossBitmap(pBitmap, uDirection, uDepth)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDirection; | /* direction of the apparent light source */
L_UINT uDepth; | /* apparent depth of this three-dimensional effect */

Applies an emboss effect to a bitmap, letting you specify the depth and direction of the effect.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uDirection | The direction of the apparent light source. Valid values are:
 | EMBOSS_N | [0]
 | EMBOSS_NE | [1]
 | EMBOSS_E | [2]
 | EMBOSS_SE | [3]
 | EMBOSS_S | [4]
 | EMBOSS_SW | [5]
 | EMBOSS_W | [6]
 | EMBOSS_NW | [7]
uDepth | The apparent depth of this three-dimensional effect. Valid values are 0 to 1000, with 500 as normal.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgEmboss , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and embosses it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Emboss with northeast direction and average depth */
L_EmbossBitmap(&LeadBitmap, EMBOSS_NE, 500 );


L_EncodeABIC

#include "ltfil.h"

L_INT EXT_FUNCTION L_EncodeABIC(pInputData, nAlign, nWidth, nHeight, ppOutputData, pnLength, bBiLevel)

L_UCHAR * pInputData; | /* input data buffer */
L_INT nAlign; | /* number of bytes aligned for uncompressed input data*/
L_INT nWidth; | /* image width in pixels */
L_INT nHeight; | /* image height in pixels */
L_UCHAR ** ppOutputData; | /* output data buffer to receive */
L_INT * pnLength; | /* pointer to variable */
L_BOOL bBiLevel; | /* flag */

Compresses the input raw data using the ABIC encoder.

Parameter | Description
pInputData | Pointer to a buffer that contains the uncompressed raw data.
nAlign | Number of bytes used to align the uncompressed raw data pointed to by pInputData.
nWidth | Width of the uncompressed raw data image, in pixels.
nHeight | Height of the uncompressed raw data image, in pixels.
ppOutputData | Pointer to a pointer to an output data buffer to be updated with the resulting compressed ABIC data.
pnLength | Pointer to a variable to be updated with the length of the resulting compressed data pointed to by ppOutputData.
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
 | TRUE | Encodes the input buffer as 1-bit Bi-level.
 | FALSE | Encodes the input buffer as 4-bit Grayscale.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function compresses the input raw data to 1-bit bi-level or 4-bit grayscale ABIC data.

The output buffer pointed by ppOutputData is allocated automatically by the function. The user is responsible to free this ppOutputData buffer by calling GlobalFreePtr() function.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DecodeABIC
Topics: | Raster Image Functions: Compression Functions
 | Compressing and Decompressing Buffers

Example

BITMAPHANDLE hBitmap;

L_INT myEncodeABIC( HWND hWnd )
{
HGLOBAL hGlobal;
L_UCHAR *pData;
L_UINT32 uLength;
L_UCHAR *pOutData;
L_INT nOutLength;
L_INT nRet;
FILE *pFile;

nRet = 0;
if( hBitmap.Flags.Allocated )
{
nOutLength = 0;
pOutData = NULL;

nRet = L_SaveBitmapMemory( &hGlobal, &hBitmap, FILE_RAW, hBitmap.BitsPerPixel, 0, &uLength, NULL );
if( SUCCESS == nRet )
{
pData = (L_UCHAR *)GlobalLock( hGlobal );

nRet = L_EncodeABIC( pData, 4, hBitmap.Width, hBitmap.Height, &pOutData, &nOutLength, FALSE );
if( SUCCESS == nRet )
{
pFile = fopen( "output.ica", "wb+" );
if( pFile )
{
if( (L_UINT)nOutLength != fwrite( pOutData, sizeof( L_UCHAR ), nOutLength, pFile ) )
{
nRet = -1; /* failed to write data */
}
fclose( pFile );
}
else
{
nRet = -1; /* failed to open file */
}

GlobalFreePtr( pOutData );

nRet = 0;

}
else
{
nRet = -1; /* failed to encode data */
}

GlobalUnlock( hGlobal );
GlobalFree( hGlobal );
}
}
else
{
MessageBox( hWnd, "Do decode first please!", "Information!", MB_OK | MB_ICONINFORMATION);

nRet = 0;
}

return nRet;
}


L_EndCompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EndCompressBuffer(L_VOID)

Cleans up all data variables and buffers allocated by the JPEG or LEAD CMP compression engine.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Calling this function will reset all internal variables to their default settings. Call this function after the compression of the entire image using L_CompressBuffer. For a detailed description of when to use this function, refer to L_StartCompressBuffer.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartCompressBuffer, L_CompressBuffer
Topics: | Raster Image Functions: Saving Files

Example

For a short example, refer to L_StartCompressBuffer. For complete sample code, refer to the COMPCB example.


L_EnumFileGeoKeys

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EnumFileGeoKeys(pszFile, uFlags, pfnCallback, pUserData, pLoadOptions)

L_TCHAR L_FAR *pszFile; | /* input file name */
L_UINT uFlags; | /* reserved for future use. */
ENUMGEOKEYSCALLBACK pfnCallback; | /* callback function */
L_VOID L_FAR* pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

This function will enumerate all the GeoKeys in a GeoTIFF file.

Parameter

Description

pszFile

Character string containing the name of the file in which to enumerate GeoKeys.

uFlags

Flags parameter reserved for future use. Pass 0.

pfnCallback

Callback function for enumerating each GeoKey. Use the function pointer as the value of this parameter.

L_EnumFileGeoKeys calls this callback function for each tag. The callback function must adhere to the function prototype described in the ENUMGEOKEYSCALLBACK Function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

pLoadOptions

Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 pLoadOptions parameter.

The callback is called for each GeoKey value stored in the three standard GeoTIFF tags (34735, 34736 and 34737). For enumerating the other standard GeoTIFF data stored as separate tags, you can use L_EnumFileTags. Or you can call L_ReadFileTag for each of these tags (since there are not that many of them to warrant the use of L_EnumFileTags).

For more information about GeoKeys tags, refer to Implementing GeoKeys (GeoTIFF tags).

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetGeoKey, L_GetGeoKey, L_WriteFileGeoKey, L_WriteFileMetaData, L_EnumFileGeoKeys, L_SaveFile, L_SaveBitmap, ENUMGEOKEYSCALLBACK
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

/* This is an efficient way of reading all the GeoKeys in a file */
#define FILENAME "geotiff.tif" /* change this to point to a GeoTIFF file */

L_INT EXT_CALLBACK EnumGeoKeysCallback(L_UINT16 uTag, L_UINT16 uType, L_UINT32 uCount, L_VOID L_FAR*pData, L_VOID L_FAR*pUserData)
{
L_TCHAR s[500];

wsprintf(s, "Key = %d, Type = %s, Count = %d", uTag, uType == TAG_ASCII ? "ASCII" : (uType == TAG_SHORT ? "SHORT" : "DOUBLE"), uCount);
MessageBox(NULL, s, "Key Info", MB_OK);

if(uType == TAG_ASCII)
{
/* LEADTOOLS makes the string null-terminated, so it is OK to pass it to MessageBox.
Note that for Unicode builds you will need to convert this array of bytes to array of WCHAR
*/
MessageBox(NULL, (LPSTR)pData, "Key Value", MB_OK);
}
else
{
if(uType == TAG_SHORT)
if(uCount == 1)
wsprintf(s, "%d", *(L_UINT16 L_FAR*)pData);
else
wsprintf(s, "{%d, ...}", *(L_UINT16 L_FAR*)pData);
else
if(uCount == 1)
sprintf(s, "%g", *(L_DOUBLE L_FAR*)pData);
else
sprintf(s, "{%g, ...}", *(L_DOUBLE L_FAR*)pData);
MessageBox(NULL, s, "Key Value", MB_OK);
}
return SUCCESS;
}

L_VOID TestEnumFileGeoKeys(HWND hWnd)
{
L_INT nRet = L_EnumFileGeoKeys(FILENAME, 0, EnumGeoKeysCallback, NULL, NULL);
if(nRet != SUCCESS)
MessageBox(hWnd, "Error enumerating GeoKeys", "ERROR", MB_OK);
else
MessageBox(hWnd, "Enumeration SUCCEEDED!", "ERROR", MB_OK);
}


L_EnumFileTags

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EnumFileTags (pszFile, uFlags, pfnCallback, pUserData, pLoadOptions)

L_TCHAR L_FAR *pszFile; | /* character string containing the input file name */
L_UINT uFlags; | /* reserved for future use. Pass 0. */
ENUMTAGSCALLBACK pfnCallback; | /* callback function */
L_VOID L_FAR * pUserData; | /* user data parameter that will be passed to pfnCallback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Enumerates all the tags in a file. Currently, only TIFF and Exif files contain tags.

Parameter

Description

pszFile

Character string containing the name of the file in which to enumerate the tags.

uFlags

Flags parameter. Reserved for future use. Pass 0.

pfnCallback

Callback function for enumerating each tag. Use the function pointer as the value of this parameter.

L_EnumFileTags calls this callback function for each tag. The callback function must adhere to the function prototype described in the ENUMTAGSCALLBACK callback function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

pLoadOptions

Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For multipage TIFF files, you can enumerate the tags from a particular page. Specify the page number on which to enumerate the tags using the pLoadOptions structure. For more information, refer to the LOADFILEOPTION structure.

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.

To read a tag value, call L_ReadFileTag.

Note that if ENUMTAGSCALLBACK returns a value other than SUCCESS, L_EnumFileTags will stop enumerating the tags and return the value returned by ENUMTAGSCALLBACK as its return value.

Do not attempt to use the L_DeleteTag function to delete tags from inside an ENUMTAGSCALLBACK callback function. If you want to delete tags that you enumerate, use ENUMTAGSCALLBACK to add the tags to a list. Upon returning from L_EnumFileTags, you can delete all the tags from the list.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

Required DLLs and Libraries

LTFIL

LFCMP

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ReadFileTag, L_WriteFileTag, L_SetTag, L_GetTag, ENUMTAGSCALLBACK, L_DeleteTag
Topics: | Implementing TIFF Comments and Tags.

Example

/* This example will read all the user tags from page 1 of "file.tif". */
L_INT EXT_CALLBACK EnumFileTagCallback(L_UINT16 uTag, L_UINT16 uType, L_UINT32 uCount, L_VOID L_FAR*pUserData)
{
L_TCHAR s[100];
wsprintf(s, "Tag = %d, Type = %d, Count = %d", uTag, uType, uCount);
MessageBox(NULL, s, "EnumFileTagCallback", MB_OK);
return SUCCESS;
}

L_INT EnumTags(HWND hWnd)
{
/* Enumerate the tags */
return L_EnumFileTags("file.tif", 0, EnumFileTagCallback, NULL, NULL);
}


L_EnumMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_EnumMarkers(hMarkers, uFlags, pfnCallback, pUserData)

HANDLE hMarkers; | /* markers handle */
L_UINT uFlags; | /* flags that determine function behavior */
ENUMMARKERSCALLBACK pfnCallback; | /* ENUMMARKERSCALLBACK callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Enumerates the markers in the marker collection.

Parameter | Description
hMarkers | Handle to the collection of metadata markers to enumerate. The data accessed by the handle may change, even if the handle value stays the same. A handle to a collection of metadata markers can be obtained by calling either L_LoadMarkers or L_CreateMarkers.
uFlags | Reserved for future use. Pass 0.
pfnCallback | Callback function for processing each enumerated marker. Use the function pointer as the value of this parameter.
 | L_EnumMarkers calls this callback function as it gets the handle of each marker. The callback function must adhere to the function prototype described in the ENUMMARKERSCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

L_EnumMarkers filters the return codes from ENUMMARKERSCALLBACK. For example: if ENUMMARKERSCALLBACK returns SUCCESS_ABORT, the enumeration will be aborted and L_EnumMarkers will copy the remaining markers to the resulting marker collection. L_EnumMarkers will return SUCCESS if the copy succeeds.

This function actually updates the metadata marker collection as changes (deletions, insertions, etc.) take place. Therefore, when this function successfully returns, the contents of the resulting marker collection referenced by hMarkers may be different from the contents of the marker collection initially passed to L_EnumMarkers in the hMarkers parameter.

This function can also be used to selectively delete markers from hMarkers.

Your callback function will be called for every marker in the handle. You can delete, replace or insert markers using the callback.

You can call the LEADMARKERCALLBACK from your callback to insert a marker. The marker will be inserted before the current marker.

You can think of this function as though the LEAD engine is creating a new collection of markers. If your ENUMMARKERSCALLBACK returns SUCCESS, the marker passed to it will be included in the resulting marker collection by pfnLEADCallback. This resulting marker collection will be referenced by the hMarkers parameter when the L_EnumMarkers function successfully returns. You can also call pfnLEADCallback yourself if you want to insert extra markers or to control the order in which the markers are written.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_GetMarkerCount, L_GetMarker, ENUMMARKERSCALLBACK, LEADMARKERCALLBACK
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to L_CreateMarkers.


L_ExpandRow

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ExpandRow(pRunBuffer, pBuffer, nCol, nWidth)

L_UINT16 L_HUGE * pRunBuffer; | /* pointer to the input buffer */
L_UCHAR L_HUGE * pBuffer; | /* pointer to the output buffer */
L_UINT nCol; | /* column offset within the row to process */
L_INT nWidth; | /* number of pixels to process */

Does buffer-to-buffer decompression of RLE-compressed 1-bit image data. Use this function to process all or part of a single line of image data. This function is available in the Document/Medical Toolkits.

Parameter | Description
PRunBuffer | Pointer to the input buffer containing 1-bit compressed image data.
PBuffer | Pointer to the output buffer, which is to be filled with 1-bit image data. Use integer math to calculate the required size of this buffer as follows: bytes required = ( nWidth + 7) / 8.
NCol | Column offset within the row to be processed. The function skips this many pixels before it begins processing.
NWidth | The number of pixels to process.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CompressRow, L_CompressRows, L_ExpandRows, L_GetBitmapRowColCompressed, L_PutBitmapRowColCompressed, L_GetBitmapRowCompressed, L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

For an example,refer to L_PutBitmapRowColCompressed.


L_ExpandRows

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ExpandRows(pRun, pBuffer, nWidth, nRows)

L_UINT16 L_HUGE * pRun; | /* pointer to the input buffer */
L_UCHAR L_HUGE * pBuffer; | /* pointer to the output buffer */
L_UINT nWidth; | /* number of pixels in each row */
L_UINT nRows; | /* number of rows */

Does buffer-to-buffer decompression of RLE-compressed 1-bit image data. Use this function to process multiple lines of image data. This function is available in the Document/Medical Toolkits.

Parameter | Description
PRun | Pointer to the input buffer containing 1-bit compressed image data.
PBuffer | Pointer to the output buffer, which is to be filled with 1-bit image data. The size of each row must be rounded up to a multiple of 4 bytes. Use integer math to calculate the required size of this buffer as follows: bytes required = (((nWidth + 31) &~31)/ 8) * nRows.
NWidth | The number of pixels in each row.
NRows | The number of rows to process.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CompressRow, L_ExpandRow, L_CompressRows, L_GetBitmapRowColCompressed, L_PutBitmapRowColCompressed, L_GetBitmapRowCompressed, L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

For an example,refer to L_GetBitmapRowCompressed.


L_ExtractMessageFromBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ExtractMessageFromBitmap(pBitmap, pAddMesgInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPADDMESGINFO pAddMesgInfo; | /* pointer to a structure */

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 pAddMesgInfo parameter. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap from which the function extracts the message.
pAddMesgInfo | Pointer to an ADDMESGINFO structure that contains information about the extracted message.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to extract the message that was added to the bitmap by the function L_AddMessageToBitmap.

Before calling this function, you must declare a variable of data type ADDMESGINFO. Set the pPassword, pStart, pDirectory members of the structure using the same information used for these members when the message was added. You can then pass the address of this structure in the pAddMesgInfo parameter, which this function will update with the extracted message.

This function 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.

This function supports 24- and 48-bit images, and 8- and 16-bit grayscale images.

Support for 16-bit grayscale and 48-bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddMessageToBitmap
Topics: | Raster Image Functions: Getting and Setting File Information
 | Non-Image Data

Example

/* This example loads a bitmap that has an embedded message and extracts the message from it. */
BITMAPHANDLE pBitmap;
LPADDMESGINFO pAddMesgInfo;
L_INT nRet;
L_TCHAR szBuf[200];

pAddMesgInfo = (LPADDMESGINFO) GlobalAllocPtr(GHND, sizeof(ADDMESGINFO));
if(!pAddMesgInfo)
return;

pAddMesgInfo->uStructSize = sizeof(ADDMESGINFO);

/* Load the bitmap, using the bits per pixel used for the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

memset(pAddMesgInfo, 0, sizeof(ADDMESGINFO));

/*Extract the message from the image in the default position and with the default password */
nRet = L_ExtractMessageFromBitmap(&pBitmap, pAddMesgInfo);

/*Determine whether the extracted message is text or file */
if(nRet == SUCCESS)
{
if(pAddMesgInfo->pStrMsg != NULL)
{
wsprintf (szBuf, TEXT("%s"), pAddMesgInfo->pStrMsg);
MessageBox(NULL, szBuf, TEXT("Extracted Message"), MB_OK);
}
else if(pAddMesgInfo->pFileName != NULL)
{
wsprintf (szBuf, TEXT("%s"), pAddMesgInfo->pFileName);
MessageBox(NULL, szBuf, TEXT("Extracted File"), MB_OK);
}
else
MessageBox(NULL, TEXT("There is no Message!"), TEXT("Error"), MB_OK);
}
else
MessageBox(NULL, TEXT("No message"), TEXT("Error"), MB_OK);

/*Free the temporary buffers. */
if(pAddMesgInfo->pStrMsg)
GlobalFreePtr(pAddMesgInfo->pStrMsg);

if(pAddMesgInfo->pFileName)
GlobalFreePtr(pAddMesgInfo->pFileName);

if(pAddMesgInfo)
GlobalFreePtr(pAddMesgInfo);


L_FeatherAlphaBlendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FeatherAlphaBlendBitmap(pBitmapDst, nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, pBitmapMask)

pBITMAPHANDLE pBitmapDst; | /* pointer to the bitmap handle */
L_INT nXDst; | /* x coordinate */
L_INT nYDst; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
pBITMAPHANDLE pBitmapSrc; | /* pointer to a bitmap handle */
L_INT nXSrc; | /* x coordinate */
L_INT nYSrc; | /* y coordinate */
pBITMAPHANDLE pBitmapMask; | /* pointer to a bitmap handle */

Combines image data from two bitmaps with feathering, by combining the two bitmaps with a variable opacity that depends on a fade mask. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle that references the destination bitmap. The function will update this bitmap.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
nWidth | Width of the area to be combined, in pixels. This width applies to both the source and the destination areas.
nHeight | Height of the area to be combined, in pixels. This height applies to both the source and the destination areas.
pBitmapSrc | Pointer to the bitmap handle that references the source bitmap.
nXSrc | The X coordinate of the origin of the source rectangle.
nYSrc | The Y coordinate of the origin of the source rectangle.
pBitmapMask | Pointer to the bitmap handle that references the fade mask.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To combine two bitmaps with a fixed opacity, use the L_AlphaBlendBitmap function.

The L_FeatherAlphaBlendBitmap function achieves feathering between two bitmaps by using variable opacity values, obtained from the fade mask referenced by pBitmapMask.

To create a bitmap that contains a fade mask, use L_CreateFadedMask.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_AlphaBlendBitmap, L_CreateFadedMask, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE BitmapDst; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE BitmapSrc; /* source bitmap */
BITMAPHANDLE BitmapMask; /* Bitmap handle to the fade mask bitmap */
RECT rRgnRect; /* Rectangle that defines the region */
L_INT XDst; /* Column offset of the destination */
L_INT XSize; /* Pixel width of the rectangle to combine */
L_INT YDst; /* Row offset of the destination */
L_INT YSize; /* Pixel height of the rectangle to combine */
L_INT XSrc; /* Column offset of the source */
L_INT YSrc; /* Column offset of the source */
/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &BitmapDst, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("IMAGE2.BMP"), &BitmapSrc, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

/* Specify a position in the top left part of the displayed image */
XDst = BITMAPWIDTH(&BitmapDst) / 8;
YDst = BITMAPHEIGHT(&BitmapDst) / 8;
/* Use the half size of the source bitmap */
YSize = BITMAPHEIGHT(&BitmapSrc) / 2;
XSize = BITMAPWIDTH(&BitmapSrc) / 2;
XSrc = 0;
YSrc = 0;
// specify a rectangle
SetRect(&rRgnRect, XSrc, YSrc, XSrc + XSize , YSrc + YSize);
/* Create a rectangular region */
L_SetBitmapRgnRect (&BitmapSrc, NULL, &rRgnRect, L_RGN_SET);

/* create the fade mask */
L_CreateFadedMask(&BitmapSrc, &BitmapMask, sizeof(BITMAPHANDLE), 60, 20, 3, 0, FADE_DUMPFILL | FADE_NOTRANSPARENCY, 255,RGB(0, 0, 255));
/* Combine BitmapSrc with BitmapDst, with fade mask bitmap */
L_FeatherAlphaBlendBitmap (&BitmapDst, XDst, YDst, XSize, YSize,
& BitmapSrc, XSrc, YSrc, &BitmapMask);
/* Free the temporary bitmap */
L_FreeBitmap(&BitmapSrc);


L_FeedLoad

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FeedLoad(hLoad, pBuffer, dwBufferSize)

HGLOBAL hLoad; | /* handle that identifies the loading process */
L_UCHAR L_FAR * pBuffer; | /* address of your buffer */
L_UINT32 dwBufferSize; | /* size of your buffer */

Supplies image data to the file-load process from a buffer that you provide.

Parameter | Description
hLoad | Handle that identifies the loading process. It is the same handle that you specify in the L_StartFeedLoad function.
pBuffer | The address of your buffer.
dwBufferSize | The size of your buffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function with the L_StartFeedLoad and L_StopFeedLoad functions. For a description of how the functions relate to each other, refer to L_StartFeedLoad.

This function cannot be used in combination with L_RedirectIO.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and LIBRARIES needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartFeedLoad, L_StopFeedLoad, L_ChangeBitmapHeight, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For a short example, refer to L_StartFeedLoad. For complete sample code, refer to the FEEDLOAD example


L_FFTBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FFTBitmap(pBitmap, pFTArray, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pFTARRAY pFTArray; | /* pointer to an FTARRAY structure */
L_UINT uFlags; | /* flags */

Computes the Fast Fourier transform of an image or the Inverse Fast Fourier transform as specified in the uFlags. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap, object of the transformation.
pFTArray | Pointer to FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array that will hold the frequency components of the image. Its size must be the same as the image. The function will fill the array elements using data from pBitmap when FFT_FFT flag is passed. The function will use the array values and reconstruct pBitmap when FFT_IFFT flag is passed.
uFlags | 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 and store the results in the acxData.
 | FFT_IFFT | [0x0002] Construct an image from the frequency components in acxData. The image will be stored in pBitmap. This option will change the values of acxData.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_DFTBitmap to use a Discrete Fourier Transform algorithm on a bitmap. If you try to use this function with a bitmap with dimensions that are not a power of two, the function will return an ERROR_INV_PARAMETER error.

Before using this function, call the L_AllocFTArray function to allocate a FTARRAY structure large enough to hold the Fourier Transform coefficients for pBitmap. When the array is no longer needed, free the allocated array by calling the L_FreeFTArray function.

This function does not work on regions. If a bitmap has a region the function ignores it and processes the entire bitmap.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DFTBitmap, L_FrqFilterBitmap, L_FTDisplayBitmap, L_FrqFilterMaskBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

/* This example loads a bitmap and applies a FFT transformation. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
pFTARRAY pFTArray;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Resize the bitmap to make sure the bitmap dimensions are power of two*/
L_SizeBitmap(&LeadBitmap, 256, 512, SIZE_BICUBIC);

/* Allocate FFT buffer*/
L_AllocFTArray(&LeadBitmap, &pFTArray, sizeof(FTARRAY));

/* Apply FFT*/
L_FFTBitmap(&LeadBitmap, pFTArray, FFT_FFT | FFT_GRAY);

/* Free FFT buffer */
L_FreeFTArray(pFTArray);


L_FileConvert

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FileConvert(pszFileSrc, pszFileDst, nType, nWidth, nHeight, nBitsPerPixel, nQFactor, pLoadOptions, pSaveOptions, pFileInfo)

L_TCHAR L_FAR * pszFileSrc; | /* input file name */
L_TCHAR L_FAR * pszFileDst; | /* output file name */
L_INT nType; | /* output file format */
L_INT nWidth; | /* new width of the output file */
L_INT nHeight; | /* new height of the output file */
L_INT nBitsPerPixel; | /* output file pixel depth */
L_INT nQFactor; | /* quality factor */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Converts an image file from one format to another, creating a new file in the new format.

Parameter | Description
pszFileSrc | Character string containing the input file name.
pszFileDst | Character string containing the output file name.
nType | Output file format. For valid values, refer to Formats of Output Files.
nWidth | The new width of the output file. If this value is not 0, then the output file will be resized to the nWidth value. Use a value of 0 if you do not wish to resize the output file.
nHeight | The new height of the output file. If this value is not 0, then the output file will be resized to the nHeight value. Use a value of 0 if you do not wish to resize the output file.
nBitsPerPixel | 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.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Q factor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If you convert to a lower bits-per-pixel format, this function optimizes the colors automatically. For example, when converting a 24-bit file (16 million colors) to an 8-bit file (256 colors) this function selects the best 256 colors to represent the 24-bit image.

Note that this is a high-level function that does conversion from all possible formats to all possible formats.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmap, L_SaveFile, L_SaveFileOffset, L_CompressBitmapWithStamp
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: Low-Level Compression Functions
 | Raster Image Functions: Loading and Saving Stamp Images
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

/* This example converts a LEAD CMP file to a Windows BMP file */
L_FileConvert(
TEXT("IMAGE3.CMP"), /* Input file */
TEXT("TEST.BMP"), /* Output file */
FILE_BMP, /* Windows BMP file for output */
0, /* Keep the same width */
0, /* Keep the same height */
8, /* 8 bits per pixel */
0, /* No quality factor is used for BMP */
NULL,
NULL, NULL);


L_FileInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FileInfo(pszFile, pFileInfo, uStructSize, uFlags, pLoadOptions)

L_TCHAR L_FAR * pszFile; | /* input file name to query */
pFILEINFO pFileInfo; | /* pointer to the FILEINFOFILEINFO structure to be filled */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pFileInfo */
L_UINT uFlags; | /* flag */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets information about the specified file and fills the specified FILEINFO structure with the information.

Parameter | Description
pszFile | Character string containing the input file name to query.
pFileInfo | Pointer to the FILEINFO structure to be filled. For more information, see FILEINFO structure.
uStructSize | Size in bytes, of the structure pointed to by pFileInfo, for versioning. Use sizeof(FILEINFO).
uFlags | Flag indicating whether to update the TotalPages field in the FILEINFO structure. Possible values are:
 | Value | Meaning
 | FILEINFO_TOTALPAGES | [0x0001] Update the pFileInfo->TotalPages field with the total number of pages in the file.
 | 0 | Do not update the pFileInfo->TotalPages field.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a variable with the datatype of FILEINFO.
2. | Declare and assign a character string variable for the file name.
3. | If you are getting information about a multi-page file (which can contain more than one image), use the LOADFILEOPTION structure to specify the page number. The information that you get will be for the image on the specified page.
4. | Call the L_FileInfo function, passing the file name and the address of the FILEINFO variable as parameters.
5. | Get the image information from the fields described in FILEINFO structure.

For a summary of file information functions, refer to Getting and Setting File Information.

Note: More options are available in the LOADFILEOPTION structure.

Note: For information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the INFO example.

/* This example gets file information and displays it in a message box */
FILEINFO FileInfo; /* LEAD File Information structure. */
L_TCHAR szMessage[1024]; /* Buffer to hold information for display. */
/* Get the file information */
FileInfo.uStructSize = sizeof(FileInfo);
L_FileInfo(TEXT("IMAGE3.CMP"), &FileInfo, sizeof(FILEINFO), 0, NULL);
/* Format the message string with data from the FILEINFO structure */
wsprintf(szMessage, TEXT("Filename: %s\n\n")
TEXT("Format: %d\n\n")
TEXT("Width: %d\n\n")
TEXT("Height: %d\n\n")
TEXT("BitsPerPixel: %d\n\n")
TEXT("Size On Disk: %ld\n\n")
TEXT("Size In Memory: %ld\n\n")
TEXT("Compression: %s"),
(L_TCHAR L_FAR *) FileInfo.Name,
FileInfo.Format,
FileInfo.Width,
FileInfo.Height,
FileInfo.BitsPerPixel,
FileInfo.SizeDisk,
FileInfo.SizeMem,
(L_TCHAR L_FAR *) FileInfo.Compression );
/* Display the message string */
MessageBox( NULL, szMessage, TEXT("File Information"), MB_OK );


L_FileInfoMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FileInfoMemory(pBuffer, pFileInfo, uStructSize, nBufferSize, uFlags, pLoadOptions)

L_CHAR L_FAR * pBuffer; | /* pointer to the file location in memory */
pFILEINFO pFileInfo; | /* pointer to the LEAD FILEINFO structureFILEINFO */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pFileInfo */
L_INT32 nBufferSize; | /* size in bytes of the file */
L_UINT uFlags; | /* flag */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads information about the file located in memory into a FILEINFO structure.

Parameter | Description
pBuffer | Pointer to the location in memory of the image file.
pFileInfo | Pointer to the LEAD FILEINFO structure to be filled with data from the image file.
uStructSize | Size in bytes, of the structure pointed to by pFileInfo, for versioning. Use sizeof(FILEINFO).
nBufferSize | The size in bytes of the file referenced by pBuffer.
uFlags | Flag indicating whether to update the TotalPages field in the FILEINFO structure. Possible values are:
 | Value | Meaning
 | FILEINFO_TOTALPAGES | [0x0001] Update the pFileInfo->TotalPages field with the total number of pages in the file.
 | 0 | Do not update the pFileInfo->TotalPages field.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a variable with the datatype of FILEINFO.
2. | Load the file into memory and assign variables for the file's location in memory and for the file size.
3. | If you are getting information about a multi-page file (which can contain more than one image), use the LOADFILEOPTION structure to specify the page number. The information that you get will be for the image on the specified page.
4. | Call the L_FileInfoMemory function, passing the pointer to the file in memory, the address of the FILEINFO variable, and the file size as parameters.
5. | Get the image information from the fields described in FILEINFO structure.

For a summary of file information functions, refer to Getting and Setting File Information.

Note: More options are available in the LOADFILEOPTION structure.

Note: This function does not support Kodak PhotoCD (PCD) files or Kodak FlashPix files.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the MEMORY example.

/* This example loads a temporary bitmap, saves it as a file in memory,
then gets information about the memory-resident file */

BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
HGLOBAL hFileInMemory; /* Memory handle */
L_UINT32 uMemSize; /* Size of the data in memory */
L_CHAR L_FAR *pData; /* Pointer to the data in memory */
FILEINFO FileInfo; /* LEAD File Information structure. */
L_TCHAR szMessage[1024]; /* Buffer to hold information for display. */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Save the image as a CMP file in memory */
L_SaveBitmapMemory(&hFileInMemory, &TmpBitmap, FILE_CMP, 24, QS, &uMemSize, NULL);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
/* Get the pointer to the memory-resident file */
pData = (L_CHAR L_FAR *) GlobalLock (hFileInMemory);
/* Get information about the file in memory */
FileInfo.uStructSize = sizeof(FileInfo);
L_FileInfoMemory (pData, &FileInfo, sizeof(FILEINFO), uMemSize, 0, NULL);
/* Unlock the memory */
GlobalUnlock (hFileInMemory);
/* Format the message string with data from the FILEINFO structure */
wsprintf(szMessage, TEXT("Format: %d\n\n")
TEXT("Width: %d\n\n")
TEXT("Height: %d\n\n")
TEXT("BitsPerPixel: %d\n\n")
TEXT("Size of File: %ld\n\n")
TEXT("Size of Bitmap: %ld\n\n")
TEXT("Compression: %s"),
FileInfo.Format,
FileInfo.Width,
FileInfo.Height,
FileInfo.BitsPerPixel,
FileInfo.SizeDisk,
FileInfo.SizeMem,
(L_TCHAR L_FAR *)FileInfo.Compression );
/* Display the message string */
MessageBox( NULL, szMessage, TEXT("File Information"), MB_OK );
/* Clean up the test environment */
GlobalFree (hFileInMemory);


L_FillBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FillBitmap(pBitmap, crFill)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF crFill; | /* fill color */

Fills the specified bitmap with the specified color.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
crFill | The fill 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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter
 | In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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 functions will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS function, refer to L_GetPixelColor.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Using Color Values in LEADTOOLS

Example

For complete sample code, refer to the FEATURE3 example.

/* This example loads a bitmap and fills it with blue. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Fill the bitmap with blue */
L_FillBitmap(&LeadBitmap,RGB(0, 0, 255));


L_FillICCProfileFromICCFile

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_FillICCProfileFromICCFile(pszFileName, pICCProfile)

L_UCHAR L_FAR * pszFileName; | /* name of the file to load */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */

Fills the ICCPROFILEEXT structure fields with the appropriate ICC data from the specified file.

Parameter | Description
pszFileName | Character string containing the name of the ICC file from which to get the ICC data.
pICCProfile | Pointer to an ICCPROFILEEXT structure to be filled with the data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function fills the ICCPROFILEEXT structure directly from an ICC file.

The ICCPROFILEEXT structure must be initialized, by calling L_InitICCProfileExt, before calling this function.

To save an ICC Profile to an ICC Profile file call L_GenerateICCFile.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

/* This example initializes an ICCPROFILEEXT structure, and fills its fields with ICC data directly read from an ICC Profile */
ICCPROFILEEXT iccProfile;
// Initialize the ICC profile structure
L_InitICCProfileExt (&iccProfile, sizeof(ICCPROFILEEXT));
// Fill the structure with ICC data directly from an ICC file
L_FillICCProfileFromICCFile(TEXT("iccfile.icc"), &iccProfile);
// Free the ICC structure
L_FreeICCProfile(&iccProfile);


L_FillICCProfileStructure

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_FillICCProfileStructure(pICCProfile, pData, uDataSize)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR L_FAR * pData; | /* data pointer */
L_UINT uDataSize; | /* size of the data buffer */

Fills the ICCPROFILEEXT structure fields with the appropriate ICC data from a loaded ICC Profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure to be filled with the data.
pData | Pointer to a data buffer that contains the ICC profile as one piece.
uDataSize | Value that indicates the size of the data buffer that contains the ICC profile.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When loading the ICC profile from a file using the L_LoadICCProfileExt or the L_LoadICCProfile functions, the ICC profile is stored into one pointer inside the structure. Calling L_FillICCProfileStructure extracts the information from that ICC profile pointer, and fills the ICCPROFILEEXT structure with the appropriate data for each field.

To fill an ICCPROFILEEXT structure directly from an ICC profile file, call L_FillICCProfileFromFile.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

For an example, refer to L_InitICCProfileExt.


L_FlipBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FlipBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Flips a specified bitmap image from top to bottom.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to flip.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RotateBitmap, L_RotateBitmapFine, L_ShearBitmap, L_ReverseBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a bitmap and flips it */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Flip the bitmap */
L_FlipBitmap(&LeadBitmap);


L_FlipBitmapViewPerspective

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FlipBitmapViewPerspective(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Performs a fast flip operation by changing the bitmap's view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to flip.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function is similar to L_RotateBitmapViewPerspective.

The bitmap data remains unchanged.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FlipBitmap, L_RotateBitmap, L_RotateBitmapFine, L_ShearBitmap, L_ReverseBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a bitmap and flips it */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Flip the bitmap */
L_FlipBitmapViewPerspective(&LeadBitmap);


L_FragmentBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FragmentBitmap(pBitmap, uOffset, uOpacity)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uOffset; | /* image displacement */
L_UINT uOpacity; | /* transparency percentage */

Averages a bitmap with its shifted copies. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
uOffset | Value that indicates the number of pixels the copied image is shifted.
uOpacity | Value that indicates the transparency, in percent, of the copy in comparison to the original image. Possible values 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_DisplaceMapBitmap function to displace a bitmap's pixels horizontally and vertically according to the values of the displacement map image.

Use the L_OffsetBitmap function to shift a bitmap's pixels horizontally and vertically.

Use the L_OffsetBitmapRgn function to move a bitmap region by the specified number of rows and columns.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_FeatherAlphaBlendBitmap, L_CreateFadedMask, L_TextureAlphaBlendBitmap, L_DisplaceMapBitmap, L_OffsetBitmap, L_OffsetBitmapRgn, L_BumpMapBitmap, L_CanvasBitmap, L_CombineBitmapWarp, L_BricksTextureBitmap
Topics: | Raster Image Functions: Combining Images
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects

Example

/*Apply the fragment effect with four pixel shifting and opacity = 100 */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("Image1.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
/* Apply the effect*/
L_FragmentBitmap(&LeadBitmap, 4, 100);


L_FrameBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FrameBitmapRgn(hDC, pBitmap, pXForm, uType)

HDC hDC; | /* handle to a device context where the image is displayed */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a structure for coordinate translation */
L_UINT uType; | /* type of frame to display */

Displays an outline of the bitmap region. If the region includes noncontiguous shapes, each shape is outlined. The outline, itself, is inside the region.

Parameter | Description
hDC | Handle to a device context where the image is displayed and where the frame is to appear.
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
uType | The type of frame to display. The following are valid values. To animate the frame, you must cycle through the values using a timer event.
 | L_FRAME_MOVING0 [0]
 | L_FRAME_MOVING1 [1]
 | L_FRAME_MOVING2 [2]
 | L_FRAME_MOVING3 [3]
 | L_FRAME_MOVING4 [4]
 | L_FRAME_MOVING5 [5]
 | L_FRAME_MOVING6 [6]
 | L_FRAME_MOVING7 [7]

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

This function is designed to produce an animated frame, which you can implement by calling the function with a timer event that cycles through the possible frame types.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PaintRgnDC, L_PaintRgnDCBuffer, L_PaintRgnDCEffect
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/****************************************************************************************
This example, which displays an animated frame around a bitmap region, includes
sections from a program’s message-processing function. The sample code uses the
following global variables: */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_INT DisplayWidth, DisplayHeight; /* Dimensions of the displayed image */
/****************************************************************************************/
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
HDC hdc; /* Device context used with the palette functions */
RGNXFORM XFormFromBitmap; /* Structure for transforming bitmap coordinates */
RECT rClientSize;
static L_UINT FrameType;

GetClientRect (hWnd, &rClientSize);
switch (Message)
{
case WM_CREATE:
/* Load the bitmap and create the region */
TestFunction(hWnd);
/* Set the timer for the region frame */
SetTimer( hWnd, 1, 400, NULL);
case WM_TIMER:
/* Do nothing if there is no region */
if (!L_BitmapHasRgn(&LeadBitmap))
return(0);
/* Set the frame type */
FrameType = (FrameType + 1) % 8;
/* Get the device context */
hdc = GetDC (hWnd);
/* Set XFormFromBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormFromBitmap.uViewPerspective = TOP_LEFT;
XFormFromBitmap.nXScalarNum = rClientSize.right - rClientSize.left;
XFormFromBitmap.nXScalarDen = DisplayWidth;
XFormFromBitmap.nYScalarNum = rClientSize.bottom - rClientSize.top;
XFormFromBitmap.nYScalarDen = DisplayHeight;
XFormFromBitmap.nXOffset = 0;
XFormFromBitmap.nYOffset = 0;
/* Display the frame */
L_FrameBitmapRgn(hdc, &LeadBitmap, &XFormFromBitmap, FrameType);

}
return (0);
}


L_FreeBitmap

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_FreeBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Frees storage allocated for a specified bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to free.

Returns

None.

Comments

This function should be called when your program no longer needs the image data. If the bitmap was allocated in disk memory, this function deletes the temporary file. If the bitmap has a region defined, this function also frees the region.

If after calling L_FreeBitmap you want to use the same bitmap handle to load another image, use the L_InitBitmap function to reinitialize the bitmap handle.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreateBitmap, L_InitBitmap, L_AllocateBitmap
Topics: | Raster Image Functions: Creating and Deleting Images

Example

Refer to the example for L_ResizeBitmap.

For complete sample code, refer to the FEATURE1 example.


L_FreeBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeBitmapRgn(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Removes the region from the bitmap and frees the memory used for the region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_BitmapHasRgn, L_GetBitmapRgnArea, L_IsPtInBitmapRgn
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For a short example, refer to L_SetBitmapRgnEllipse. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_FreeExtensions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeExtensions(pExtensionList)

pEXTENSIONLIST pExtensionList;

/* pointer to a structure */

Frees the extension list data allocated by the L_ReadFileExtensions function.

Parameter | Description
pExtensionList | Pointer to the EXTENSIONLIST structure to free.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when the extension data is no longer needed.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadExtensionStamp, L_GetExtensionAudio, L_ReadFileStamp
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

For an example, refer to L_ReadFileExtensions.


L_FreeFTArray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeFTArray(pFTArray)

pFTARRAY pFTArray;

/* pointer to structure */

Frees the 2D storage array that was allocated by L_AllocFTArray. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pFTArray | Pointer to the FTARRAY structure to be freed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when your program no longer needs the 2D array that is used to hold Fourier Transform coefficients. This function is used only when working with the Fourier Transform functions. Do not use pFTArray after this function returns.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FFTBitmap, L_DFTBitmap, L_FrqFilterBitmap, L_FTDisplayBitmap, L_FrqFilterMaskBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

For an example, refer to L_DFTBitmap.


L_FreeHandShearBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeHandShearBitmap (pBitmap, pAmplitudes, uAmplitudesCount, uScale, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR * pAmplitudes; | /* array of integer values */
L_UINT uAmplitudesCount; | /* array length */
L_UINT uScale; | /* wave size factor */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Shears the bitmap by the wave drawn using pAmplitudes. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pAmplitudes | Array of integers that represent shear wave values. The real values 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 L_GetCurvePoints function. They may also be obtained through the Wave Shear Dialog .
uAmplitudesCoun | Number of entries in the pAmplitudes array.
uScale | Factor used to increase or decrease the various amplitude values in the pAmplitudes array. Each value in the pAmplitudes array is multiplied by this factor. The real factor value is the uScale value divided by 100. The valid range is from 0 to 100.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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 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 direction of the shear wave:
 | Value | Meaning
 | SHR_HORZ | [0x0000] Apply the shear wave horizontally.
 | SHR_VERT | [0x0010] Apply the shear wave vertically.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will shear the bitmap using the wave in the pAmplitudes array. The wave can be applied vertically or horizontally. The pAmplitude data can be obtained from the L_GetCurvePoints function, or from the Wave Shear Dialog .

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgWaveShear , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

/* This example will shear the bitmap using a triangular wave */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT apUserPoint [4];
L_INT pAmplitudes[13];
L_INT nMax, i;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Fill apUserPoint array with points that define a triangular wave*/
apUserPoint [0].x = 0;
apUserPoint [0].y = 0;
apUserPoint [1].x = 3;
apUserPoint [1].y = 10;
apUserPoint [2].x = 9;
apUserPoint [2].y = -10;
apUserPoint [3].x = 12;
apUserPoint [3].y = 0;

/*Draw a triangular wave according to apUserPoint points and store the amplitude values in the pAmplitudes array*/
L_GetCurvePoints(pAmplitudes, apUserPoint, 4, NULL, GUB_LINEAR);

/*Normalize pAmplitudes (maximum value in pAmplitudes is 1000 and lower is -1000)*/
nMax = 0;
for(i = 0; i < 13; i++)
{
if(nMax < pAmplitudes [i])
nMax = pAmplitudes [i];
}

if(nMax)
{
for(i = 0; i < 13; i++)
{
pAmplitudes [i] = (1000 * pAmplitudes [i] / abs(nMax));
}
}

/* Apply the shear wave horizontally */
L_FreeHandShearBitmap (&LeadBitmap, pAmplitudes, 13, 100, 0, FILL_RPT | SHR_HORZ);


L_FreeHandWaveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeHandWaveBitmap (pBitmap, pAmplitudes, uAmplitudesCount, uScale, uWaveLen, nAngle, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR * pAmplitudes; | /* array of wave amplitudes */
L_UINT uAmplitudesCount; | /* array length */
L_UINT uScale; | /* wave size factor */
L_UINT uWaveLen; | /* wave length */
L_INT nAngle; | /* wave rotation angle */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Distorts the bitmap by the wave specified in pAmplitudes and the rotation angle specified in nAngle. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pAmplitudes | 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 L_GetCurvePoints function. They may also be obtained through the FreeHandWave Dialog .
uAmplitudesCount | Number of entries in the pAmplitudes array.
uScale | Factor used to increase or decrease the various amplitude values in the pAmplitudes array. Each value in the pAmplitudes array is multiplied by this factor. The real factor value is the uScale value divided by 100.
uWaveLen | Value that represents the wave length, if DIS_PER is set in the uFlags parameter. Possible values range from 1 – 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in uFlags, this value is the number of repeated waves.
nAngle | Wave rotation angle in hundredths of a degree (+/-). The valid range is from –36000 to 36000. The value in degrees is nAngle divided by 100.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | Flags that indicate how to handle exposed areas and the type of information contained in uWaveLen. 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 uWaveLen parameter:
 | Value | Meaning
 | DIS_PER | [0x0000] The value in uWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is set, the valid range of uWaveLen is from 1 to 100.
 | DIS_FRQ | [0x0010] The value in uWaveLen is the frequency, or the number of times the wave repeats.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function applies the wave in the pAmplitudes array. You can repeat and rotate the wave in any direction. The pAmplitude data can be obtained from the L_GetCurvePoints function, or from the FreeHandWave Dialog .

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgFreeHandWave , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

/* This example will apply triangular wave on the loaded image*/
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT apUserPoint [4];
L_INT pAmplitudes[13];

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

apUserPoint [0].x = 0;
apUserPoint [0].y = 0;
apUserPoint [1].x = 3;
apUserPoint [1].y = 10;
apUserPoint [2].x = 9;
apUserPoint [2].y = -10;
apUserPoint [3].x = 12;
apUserPoint [3].y = 0;
L_GetCurvePoints(pAmplitudes, apUserPoint, 4, NULL, GUB_LINEAR);
L_FreeHandWaveBitmap (&LeadBitmap, pAmplitudes, 13, 100, 10, 0, 0, FILL_RPT | DIS_FRQ);


L_FreeICCProfile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeICCProfile(pICCProfile)

pMEMICCPROFILE pICCProfile;

/* pointer to a structure */

Frees the memory allocated by L_InitICCProfile .

Parameter | Description
pICCProfile | Pointer to the MEMICCPROFILE structure to be freed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When the MEMICCPROFILE structure initialized by L_InitICCProfile is no longer needed, the memory must be freed by calling L_FreeICCProfile.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadICCProfile, L_InitICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

// This example will extract an ICC profile embedded in a JPEG file.
MEMICCPROFILE iccProfile;

// initialize the MEMICCPROFILE structure
L_InitICCProfile(&iccProfile, sizeof(MEMICCPROFILE));

// load the embedded ICC profile
if(L_LoadICCProfile(TEXT("embeddedICC.jpg"), &iccProfile, NULL) == SUCCESS)
{
// use the ICC profile. Write your own MyCreateICMFile which
// creates a file, writes the data into the file and close the file
MyCreateICMFile(TEXT("ICC.ICM"), iccProfile.pData, iccProfile.uDataSize);

// when finished, free the memory allocated by the MEMICCPROFILE structure
L_FreeICCProfile(&iccProfile);
}


L_FreeICCProfileExt

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_FreeICCProfileExt(pICCProfile>;

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Frees the memory allocated by L_InitICCProfileExt.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to be freed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When the ICCPROFILEEXT structure initialized by L_InitICCProfileExt is no longer needed, the memory must be freed by calling L_FreeICCProfileExt.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Freeing an ICC Profile

Example

For an example, refer to L_InitICCProfileExt.


L_FreeICCTagType

#include "ltkrn.h"
#include "ltclr.h"

L_VOID EXT_FUNCTION L_FreeICCTagType(pTag, uTagTypeSig)

L_UCHAR L_FAR * pTag; | /* a pointer to a buffer */
L_UINT32 uTagTypeSig; | /* value that indicates the tag type signature */

Frees a tag type of the ICC profile.

Parameter | Description
pTag | A pointer to a buffer that contains the ICC tag type to free.
uTagTypeSig | A value that indicates the signature of the tag type to free.

Returns

None.

Comments

This function frees a tag that was originally created by the function L_CreateICCTagData.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GenerateICCPointer , L_GetICCTagTypeSig
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Freeing an ICC Profile

Example

For example, refer to L_CreateICCTagData.


L_FreeMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeMarkers(hMarkers)

HANDLE hMarkers;

/* markers handle */

Frees all the memory associated with the metadata markers referenced by hMarkers.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called when your program no longer needs the metadata markers.

If after calling L_FreeMarkers you want to use the same marker handle to load other metadata markers, use the L_LoadMarkers function or the L_CreateMarkers functions to reinitialize the marker handle.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_GetMarkers, L_SetMarkers
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to L_SetMarkers.


L_FreePlaneBendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreePlaneBendBitmap(pBitmap, pnCurve, uCurveSize, uScale, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR * pnCurve; | /* array of integer values */
L_UINT uCurveSize; | /* array size */
L_UINT uScale; | /* scaling factor */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Wraps the bitmap onto a 3D plane shaped by pnCurve. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
pnCurve | Array of integers that represent surface shape values. Valid values for each element in the pnCurve array range between –1000 and 1000. Positive values mean the curve is concave in and negative values mean the curve is concave out. The values in this array are divided internally by 1000.
uCurveSize | Size of the pnCurve array.
uScale | Factor used to multiply the various amplitude values in the pnCurve array. Each value in the pnCurve array is multiplied by this factor. For example, if you want to double the size of the amplitude values, use a uScale value of 2; to triple the amplitudes values, use a uScale value of 3, etc. The top practical limit for this parameter is the width and height of pBitmap.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT apUserPoint [4];
L_INT pnCurve[13];
L_UINT uCurveSize;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply the filter*/
apUserPoint [0].x = 0;
apUserPoint [0].y = 0;
apUserPoint [1].x = 3;
apUserPoint [1].y = 10;
apUserPoint [2].x = 9;
apUserPoint [2].y = -10;
apUserPoint [3].x = 12;
apUserPoint [3].y = 0;

L_GetCurvePoints(pnCurve, apUserPoint, 4, NULL, GUB_LINEAR);

uCurveSize = 13;

L_FreePlaneBendBitmap(&LeadBitmap, pnCurve, uCurveSize,200, RGB(255,0,0), FILL_CLR | FPB_VERT);


L_FreeRadBendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeRadBendBitmap(pBitmap, pnCurve, uCurveSize, uScale, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR * pnCurve; | /* array of integer values */
L_UINT uCurveSize; | /* array size */
L_UINT uScale; | /* scaling factor */
POINT CenterPt; | /* center point */
COLORREF crFill; | /* background color */
L_UINT uFlags; | /* flags */

Wraps the bitmap along its radius on a 3D surface shaped by pnCurve. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
pnCurve | Array of integers that represent surface shape values. Valid values for each element in the pnCurve array range between –1000 and 1000. Positive values mean the curve is concave in and negative values mean the curve is concave out. The values in this array are internally divided by 1000.
uCurveSize | Size of the pnCurve array. This can be any number, up to the size of the available buffer.
uScale | Factor used to multiply the various amplitude values in the pnCurve array. Each value in the pnCurve array is multiplied by this factor. For example, if you want to double the size of the amplitude values, use a uScale value of 2; to triple the amplitudes values, use a uScale value of 3, etc. The top practical limit for this parameter is the width and height of pBitmap.
CenterPt | POINT structure that contains the surface center.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreePlaneBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT apUserPoint [4];
L_INT pnCurve[13];
POINT CenterPt;
L_UINT uCurveSize;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply the filter*/
apUserPoint [0].x = 0;
apUserPoint [0].y = 0;
apUserPoint [1].x = 3;
apUserPoint [1].y = 10;
apUserPoint [2].x = 9;
apUserPoint [2].y = -10;
apUserPoint [3].x = 12;
apUserPoint [3].y = 0;

L_GetCurvePoints(pnCurve, apUserPoint, 4, NULL, GUB_LINEAR);

CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
uCurveSize = 13;

L_FreeRadBendBitmap(&LeadBitmap, pnCurve, uCurveSize,200, CenterPt, RGB(255,0,0), FILL_CLR | FILL_ROT);


L_FreeUserMatchTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FreeUserMatchTable(pTable)

L_UINT L_FAR * pTable;

/* pointer to the table */

Frees the table that is used to speed conversion when using a palette that you create.

Parameter | Description
pTable | The pointer to the table.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used with other functions in the following sequence:

1. | Call L_CreateUserMatchTable to create the table.
2. | Call L_SetUserMatchTable to make this the current table. (Having this as a separate function allows you to save tables in files and get the one you need, without creating it again.)
3. | Call L_ColorResBitmap with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call L_FreeUserMatchTable when the table is no longer needed.

The completed table occupies 64K bytes of memory. Creation of the table is a slow, memory-intensive process that is useful only if you are using your own palette more than once. For example, you may want to create the table once, save it to a file, and ship that file with your application.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmap, L_DefaultDithering, L_CreateUserMatchTable, L_SetUserMatchTable
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes

Example

Refer to L_CreateUserMatchTable.


L_FrqFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FrqFilterBitmap(pFTArray, prcRange, uFlags)

pFTARRAY pFTArray; | /* pointer to structure */
LPRECT prcRange; | /* pointer to range rectangle */
L_UINT uFlags; | /* flags */

Filters the frequency harmonics data produced by a Fourier Transform function using a range rectangle. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pFTArray | Pointer to an FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array holding the frequency components.
prcRange | Specifies the filter dimension that will be applied, it represents the frequency range to be kept or removed. The left value refers to the minimum X harmonic, the right refers to the maximum X harmonic, the top refers to the minimum Y harmonic and the bottom refers to the maximum Y harmonic. The maximum X harmonic equals Width –1 and the maximum Y harmonic equals Height –1.
uFlags | 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 X range and remove outside ones.
 | FRQ_OUTSIDE_X | [0x0002] Remove the X harmonics inside 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 Y range and remove outside ones.
 | FRQ_OUTSIDE_Y | [0x0020] Remove the Y harmonics inside Y range and keep outside ones.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used only when working with Fourier Transform functions.

Before using this function, call the L_AllocFTArray function to allocate a FTARRAY structure large enough to hold the Fourier Transform coefficients for pBitmap. When the array is no longer needed, free the allocated array by calling the L_FreeFTArray function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FFTBitmap, L_DFTBitmap, L_FTDisplayBitmap, L_FrqFilterMaskBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

/* this example filters the acxData of a pFTARRAY structure produced by the Fast Fourier Transform function*/
BITMAPHANDLE LeadBitmap;
RECT rcRange;

pFTARRAY pFTArray;

L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

rcRange.left = 0;
rcRange.right = LeadBitmap.Width / 4;
rcRange.top = 0;
rcRange.bottom = LeadBitmap.Height / 2;

/*Allocate FT buffer*/

L_AllocFTArray(&LeadBitmap, &pFTArray, sizeof(FTARRAY));

/*lpFTData is known*/
/* filters the frequencies*/
L_FrqFilterBitmap(pFTArray, &rcRange, FRQ_INSIDE_X | FRQ_INSIDE_Y);


L_FrqFilterMaskBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FrqFilterMaskBitmap(pMaskBitmap, pFTArray, bOnOff)

pBITMAPHANDLE pMaskBitmap; | /* pointer to the Mask bitmap handle */
pFTARRAY pFTArray; | /* pointer to structure */
L_BOOL bOnOff; | /* flag */

Creates a mask filter to remove specific frequency components from a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pMaskBitmap | Pointer to the bitmap handle of the mask bitmap.
pFTArray | Pointer to an FTARRAY structure. The acxData field is a two-dimensional array holding the frequency components.
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 in its location in acxData will be removed, otherwise no change. A component is "removed" when both members of the corresponding L_COMPLEX structure are set to 0.
 | FALSE | The frequency component in the pixel location in acxData will be multiplied by the value of the pixel divided by 255.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used only when you are dealing with Fourier Transform functions.

The Mask bitmap will be treated as grayscale bitmap. The (0,0) frequency located in mask bitmap center; 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. Mask bitmap’s dimensions must be equal to acxData’s dimensions.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FFTBitmap, L_DFTBitmap, L_FTDisplayBitmap, L_FrqFilterBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

/* This example cleans noise from an input data. It assumes the two bitmaps being loaded. It also assumes the acxData field of pFTArray structure is large enough to hold the frequency components. See the example for L_FFTBitmap to see how to allocate the acxData field*/
BITMAPHANDLE MaskBitmap, NoisyBitmap;
pFTARRAY pFTArray;

/* Load the noisy bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("NoisyXRay.CMP"), &NoisyBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Load the mask bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("NoisyMask.CMP"), &MaskBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Allocate FT buffer*/
L_AllocFTArray(&NoisyBitmap, &pFTArray, sizeof(FTARRAY));

/* Assume acxData field of pFTArray is the correct size*/
/* apply DFT*/
L_DFTBitmap(&NoisyBitmap, pFTArray, NULL, DFT_DFT | DFT_GRAY);

/* filter frequencies */
L_FrqFilterMaskBitmap(&MaskBitmap, pFTArray, TRUE);

/* apply inverse DFT */
/* After this call, the image should be clean */
L_DFTBitmap(&NoisyBitmap, pFTArray, NULL, DFT_IDFT | DFT_ALL| DFT_IDFT_SCL);


L_FTDisplayBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FTDisplayBitmap(pBitmap, pFTArray, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pFTARRAY pFTArray; | /* pointer to structure */
L_UINT uFlags; | /* flags */

This function is used to display the results of a Fast Fourier Transform or a Discrete Fourier analysis as a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap.
pFTArray | Pointer to a FTARRAY structure. The acxData member of the FTARRAY structure is a two-dimensional array holding the frequency components. Its dimensions must equal the bitmap dimensions.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function converts the acxData member of the FTARRAY structure computed by L_FFTBitmap or L_DFTBitmap functions 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 located in bitmap center, positive X harmonics in the right half and positive Y harmonics located in the lower half of the bitmap.

This function does not work on regions . If a bitmap has a region the function ignores it and processes the entire bitmap.

Bitmap should be allocated prior to calling this function. The size of the bitmap must be the same size as the bitmap that was used to generate acxData.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FFTBitmap, L_DFTBitmap, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_AllocFTArray, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Fourier Transform
 | Removing Noise

Example

/* This example loads a bitmap, applies the Discrete Fourier Transform function to it, and displays the data*/
RECT rcRange;
BITMAPHANDLE LeadBitmap, DisplayBitmap; /* Bitmap handle to hold the loaded image. */
pFTARRAY pFTArray;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_CopyBitmap(&DisplayBitmap, &LeadBitmap, sizeof(BITMAPHANDLE));

/*Allocates buffer*/
L_AllocFTArray(&LeadBitmap, &pFTArray, sizeof(FTARRAY));

rcRange.left = 0;
rcRange.right = LeadBitmap.Width / 4;
rcRange.top = 0;
rcRange.bottom = LeadBitmap.Height / 2;

/* apply DFT*/
L_DFTBitmap(&LeadBitmap, pFTArray, &rcRange, DFT_DFT | DFT_GRAY | DFT_RANGE| DFT_INSIDE_X| DFT_OUTSIDE_Y);

/*plot frequency magnitude*/
L_FTDisplayBitmap(&DisplayBitmap, pFTArray, DSP_FT_MAG | DSP_FT_LOG);

/*Frees buffer*/
L_FreeFTArray(pFTArray);


L_FunctionalLightBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FunctionalLightBitmap(pBitmap, pLightParams)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPLIGHTPARAMS pLightParams; | /* lighting parameters */

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. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
pLightParams | Pointer to the LIGHTPARAMS structure that contains information about the required light.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Controls the brightness of the bitmap according to the method selected for generating the light.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_DiceEffectBitmap, L_RingEffectBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Example

/* This example loads a bitmap and generates a linear lighting effect with a center at (uXOrigin,uYOrigin). */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
LIGHTPARAMS LightParams;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Initialize all needed members in the LIGHTPARAMS structure to achieve the linear lighting effect. */

LightParams.uStructSize = sizeof(LIGHTPARAMS);
LightParams. uRAmp = 75;
LightParams. uFlags = FL_LINEAR_QUADRATIC | FL_LINEAR_OUTER;
LightParams. uXOrigin = (L_UINT)(LeadBitmap.Width/2);
LightParams. uYOrigin = (L_UINT)(LeadBitmap.Height/2);

/* Apply the linear lighting effect */
L_FunctionalLightBitmap (&LeadBitmap, & LightParams);


L_GammaCorrectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GammaCorrectBitmap(pBitmap, uGamma)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uGamma; | /* unsigned integer that represents the gamma value */

Adjusts the intensity of colors in a bitmap by changing the gamma constant that is used to map the intensity values.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to change.
uGamma | Unsigned integer that represents the gamma value. It can be any number greater than 0.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_ChangeBitmapIntensity, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_DlgGammaAdjustment , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_GammaCorrectBitmapExt

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies gamma correction. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set a gamma value of 2.5 */
L_GammaCorrectBitmap(&LeadBitmap, 250 );


L_GammaCorrectBitmapExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GammaCorrectBitmapExt(pBitmap, uGamma, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uGamma; | /* gamma value */
L_UINT uFlag; | /* flag */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uGamma | Any value greater than 0 that represents the gamma value. This value is divided internally by 100.
uFlag | Flag that indicates which color space to use. Possible values are:
 | Value | Meaning
 | RGB_SPACE | [0x0001] Adjust the intensity of the pixel colors across the RGB color space.
 | YUV_SPACE | [0x0002] Adjust the intensity of the pixel colors across the YUV color space.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is like the L_GammaCorrectBitmap function, 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_GammaCorrectBitmap, L_ChangeBitmapIntensity, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_DlgGammaAdjustment , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

/* The following example sets the gamma value of the bitmap to 2.5 in the YUV color space: */
BITMAPHANDLE LeadBitmap;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap,sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_GammaCorrectBitmapExt (&LeadBitmap, 250, YUV_SPACE);


L_GaussianFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GaussianFilterBitmap(pBitmap, nRadius)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_INT nRadius; | /* radius of the neighborhood */

Smooths or blurs an image by applying a Gaussian filter to the specified bitmap.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the bitmap to process with the Gaussian filter.
nRadius | Value that indicates the radius of the neighborhood on which the filter is applied.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Each pixel in the bitmap is blurred based on neighborhood pixels. The parameter nRadius determines the size of the neighborhood to consider when blurring a pixel. The result is a blurred version of the original image.

The amount of blur is controlled by specifying the size of the neighborhood used for blurring or smoothing. The value of the nRadius parameter determines the size and values of the mask.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_SolarizeBitmap, L_DlgGaussianBlur , L_WindowLevel, L_UnsharpMaskBitmap, L_HighPassFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and applies the Gaussian filter */
BITMAPHANDLE LeadBitmap;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_GaussianFilterBitmap (&LeadBitmap, 20);


L_GenerateICCFile

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_GenerateICCFile(pICCProfile, pszFileName)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_TCHAR L_FAR * pszFileName; | /* name of the file to generate */

Generates an ICC profile file.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that will be used to generate the ICC profile file.
pszFileName | Character string containing the name of the file in which to save the ICC profile.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will generate an ICC profile file that can be used in other applications.

The pData member of the ICCPROFILEEXT structure points to one block of memory that contains the entire ICC profile. The uDataSize contains the size of the material pointed to by pData. As tags are added or deleted, these members are not automatically updated. Ordinarily, to update these members, you must call L_GenerateICCPointer. However, this function updates these members itself, without requiring a separate call to L_GenerateICCPointer.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCPointer , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This function will generate an ICC profile file */
L_VOID GenFile(pICCPROFILEEXT pICCProfile, L_TCHAR L_FAR * pszFilename)
{
L_GenerateICCFile(pICCProfile, pszFilename);
}


L_GenerateICCPointer

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_GenerateICCPointer(pICCProfile)

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Generates a block of memory that contains all the ICC profile data in big Indian format.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that will be used to generate the pointer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The block of memory generated by this function can be accessed through the pData field inside the ICCPROFILEEXT structure. Its size is stored in the uDataSize field of the same structure.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This function will generate an ICC profile pointer */
L_VOID MakeICCPointer(pICCPROFILEEXT pICCProfile)
{
L_GenerateICCPointer(pICCProfile);
}


L_GetAutoCADFilesColorScheme

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetAutoCADFilesColorScheme(lpFlags)

L_UINT32 L_FAR * lpFlags;

/* pointer to a variable to be updated */

Gets the current color scheme that LEADTOOLS uses when loading AutoCAD (DXF and DWG) files.

Parameter | Description
lpFlags | Pointer to a variable, to be updated with a value that represents the current AutoCAD color scheme that LEADTOOLS uses when loading AutoCAD files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

More options are available in the LOADFILEOPTION structure.

For an explanation of how LEADTOOLS uses the AutoCAD color scheme flags, refer to L_SetAutoCADFilesColorScheme.

Before calling this function, you must declare a variable of data type L_UINT32. You can then pass the address of the variable in the pFlags parameter, which this function will update with a value that represents the current color scheme used by LEADTOOLS for loading AutoCAD files.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_SetAutoCADFilesColorScheme, L_2DSetViewMode, L_2DGetViewMode, L_2DGetViewport, L_2DSetViewport
Topics: | Raster Image Functions: Loading Files
 | Vector Images

Example

For an example, refer to L_SetAutoCADFilesColorScheme.


L_GetAutoTrimRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetAutoTrimRect(pBitmap, uThreshold, pRect)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* delta value for detecting blank space */
RECT L_FAR * pRect; | /* address of the variable to be updated */

Gets the rectangle that that would be used to trim the bitmap if L_AutoTrimBitmap were used.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be trimmed.
uThreshold | 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 uThreshold is considered blank space. Valid values are 0 to 255.
pRect | Address of the RECT variable to be updated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function in conjunction with L_TrimBitmap instead of L_AutoTrimBitmap when you want to modify the trim rectangle. For example, you could let the user preview the rectangle, or you could add a margin.

This function uses bitmap coordinates to specify the area to be trimmed. Therefore, you must account for the view perspective of the bitmap. For information about bitmap coordinates, refer to Accounting for View Perspective.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AutoTrimBitmap, L_TrimBitmap, L_CopyBitmapRect, L_WindowLevel
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

/* This example loads an image, gets the AutoTrim RECT, modifies it, */
/* and then trims the bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
RECT rc;
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Get the RECT for AutoTrim with 0 tolerance */
L_GetAutoTrimRect ( &LeadBitmap, 0, &rc );
/* Trim the bitmap with modified RECT */
L_TrimBitmap ( &LeadBitmap, rc.left - 10, rc.top - 10, rc.right - rc.left + 20, rc.bottom - rc.top + 20 );


L_GetBitmapAlpha

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapAlpha(pBitmap, pAlpha, uStructSize)

pBITMAPHANDLE pBitmap; | /* points to the source bitmap handle */
pBITMAPHANDLE pAlpha; | /* points to the destination bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pAlpha */

Creates a grayscale bitmap from the source bitmap's alpha channel data.

Parameter | Description
pBitmap | Points to the source bitmap handle.
pAlpha | Points to the destination bitmap handle to hold the alpha channel data.
uStructSize | Size in bytes, of the structure pointed to by pAlpha, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Only 16-, 32-, and 64-bit images can have an alpha channel. If the source bitmap has another color resolution, the result is an image filled with zeros.

Typically, the alpha channel contains a mask that is used for transparency, as shown in the example for L_SetBitmapAlpha.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapAlpha, L_CreateMaskFromBitmapRgn, L_SetBitmapRgnFromMask
Topics: | Defining and Using a Bitmap Region
 | Color Halftone and Halftone Images
 | Saving a Region

Example

For an example, refer to L_SetBitmapAlpha.


L_GetBitmapClipSegments

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapClipSegments(pBitmap, nRow, pSegmentBuffer, puSegmentCount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nRow; | /* number of the row */
L_UINT L_FAR * pSegmentBuffer; | /* pointer to a buffer */
L_UINT L_FAR * puSegmentCount; | /* pointer to a variable to be updated */

Gets the segments contained in the region for a particular row.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
nRow | 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.
pSegmentBuffer | Pointer to the buffer to be updated with the segments from row nRow contained in the region. This buffer should be large enough to contain twice as many values as indicated in *puSegmentCount.
puSegmentCount | Address of a variable to be updated with the number of segments from row nRow that are contained in the region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, first call L_GetBitmapRgnBounds with pXForm set to NULL, to get the bitmap boundaries. The bounding rectangle will indicate which rows are contained in the region. Go through all the rows contained in the region to get the segments contained in the region.

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. pSegmentBuffer 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 pBitmap->Width – 1 is OUTSIDE the region

It is recommended that you allocate a buffer large enough to hold all the possible segments. To get the maximum number of segments, call L_GetBitmapClipSegmentsMax. Allocate an array of unsigned values that can contain the largest number of segments. See the example for more details.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapRgnBounds, L_GetBitmapClipSegmentsMax
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

/* This example will set the pixels from the first row inside the region to black. */
L_VOID ClearFirstRow(pBITMAPHANDLE pBitmap)
{
L_UINT uSegments;
L_UINT L_FAR*pSegments;
RECT rcClip;
L_UINT i, j;

// get the maximum number of elements in a row, so I know how big the array of segments should be
L_GetBitmapClipSegmentsMax(pBitmap, &uSegments);

// allocate an array large enough to store the maximum number of segments. Note that
// L_GetBitmapClipSegmentsMax took into account that each segment has two extremities.
pSegments = (L_UINT *)GlobalAllocPtr(GMEM_MOVEABLE, uSegments * sizeof(L_UINT));
if(!pSegments)
return; // not enough memory!!

// get the region bounds, so I know which is the first row
L_GetBitmapRgnBounds(pBitmap, NULL, &rcClip);

// get the segments for the first row
L_GetBitmapClipSegments(pBitmap, rcClip.top, pSegments, &uSegments);

// do something with the segments.
// to keep this example simple, we will set the pixels in the segment to 0
for(i = 0; i < uSegments; i++)
for(j = pSegments[i * 2]; j < pSegments[i * 2 + 1]; j++)
L_PutPixelColor(pBitmap, rcClip.top, j, 0);

// free the segments array
GlobalFreePtr(pSegments);
}


L_GetBitmapClipSegmentsMax

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetBitmapClipSegmentsMax(pBitmap, puMaxSegments)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR * puMaxSegments; | /* pointer to a variable to be updated */

Gets the number of elements required to hold the clip segments for any row in the bitmap. Use this function in conjunction with L_GetBitmapClipSegments.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
puMaxSegments | Pointer to a variable to be updated with the maximum number of segments in a row within the region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapClipSegments
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

For an example, refer to L_GetBitmapClipSegments.


L_GetBitmapColorCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapColorCount(pBitmap, puCount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT32 L_FAR * puCount; | /* address of the variable to be updated */

Gets the number of unique colors in an image.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
puCount | Address of the variable to be updated with the number of unique colors.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPixelColor, L_PutPixelColor, L_WindowLevel
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Color Halftone and Halftone Images

Example

/* This example displays the number of unique colors in the specified bitmap. */
void TestCount(pBITMAPHANDLE pBitmap)
{
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
L_UINT32 dwColors; /* Number of colors in the bitmap */
/* Get the number of colors in the bitmap */
L_GetBitmapColorCount(pBitmap, &dwColors);
/* Display the result in a message */
wsprintf( szMessage, TEXT("The bitmap has %ld colors"), dwColors );
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
}


L_GetBitmapColors

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapColors(pBitmap, nIndex, nCount, pPalette)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nIndex; | /* index to the first color to get */
L_INT nCount; | /* number of colors to get */
LPRGBQUAD pPalette; | /* array values that make up your palette */

Loads your palette with selected colors from a bitmap handle's palette.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
nIndex | The index to the first color to get.
nCount | The number of colors to get.
pPalette | The array of RGBQUAD values that make up your palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Your palette can be smaller than the bitmap's palette, as long as it is big enough to hold the selected colors. For the reverse action, refer to L_PutBitmapColors.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetFixedPalette, L_ColorResBitmap, L_CreatePaintPalette, L_PutBitmapColors, L_DupPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes
 | Color Halftone and Halftone Images

Example

/* This example darkens the first 50 colors in a bitmap’s palette. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the current image */
void TestFunction(HWND hWnd)
{
RGBQUAD pPalette[50]; /* Temporary palette */
int i; /* Loop counter */
/* Convert the current 24-bit bitmap to 8 bits per pixel with an optimized palette */
L_ColorResBitmap(&LeadBitmap, &LeadBitmap, sizeof(BITMAPHANDLE), 8,
CRF_FLOYDSTEINDITHERING|CRF_OPTIMIZEDPALETTE,
NULL, NULL, 0, NULL, NULL );
/* Get the first 50 colors from the bitmap's palette */
L_GetBitmapColors(&LeadBitmap, 0, 50, pPalette);
/* Reduce the intensity of each color component by half */
for (i=0; i < 50; i++)
{
pPalette[i].rgbBlue = (BYTE) (pPalette[i].rgbBlue / 2);
pPalette[i].rgbGreen = (BYTE) (pPalette[i].rgbGreen / 2);
pPalette[i].rgbRed = (BYTE) (pPalette[i].rgbRed / 2);
}
/* Update the bitmap's palette with the changed colors */
L_PutBitmapColors(&LeadBitmap, 0, 50, pPalette);
/* Update the paint palette */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_GetBitmapHistogram

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapHistogram(pBitmap, pHisto, uHistoLen, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT32 L_FAR * pHisto; | /* an array to hold the histogram */
L_UINT uHistoLen; | /* length of the histogram */
L_UINT uFlags; | /* flags */

Creates an array that charts how many times each intensity level occurs in a bitmap. This function can chart red, green, and blue separately or together. It is used for all resolutions, including 12 and 16-bit grayscale.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the bitmap.

pHisto

An array of unsigned 32-bit integers that charts the number of times each intensity level occurs in the image.

uHistoLen

Length of the histogram.

uFlags

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

[0x0000] All channels.

CHANNEL_RED

[0x0001] Red channel only.

CHANNEL_GREEN

[0x0002] Green channel only.

CHANNEL_BLUE

[0x0003] 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 handle.

HIST_ALL_BITS

[0x0010] Use all the bits for calculating the histogram (the LowBit and HighBit values from the bitmap handle are ignored.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, and 32 bit color bitmaps, 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 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 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.

This functions also works on 12 and 16-bit grayscale images. Intensity values in these bitmaps can range from 0 to (2^16 – 1) for 16-bit grayscale or from 0 to (2^12 – 1) for 12- bit grayscale. 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 using L_GetMinMaxBits or by looking at the corresponding fields in the BITMAPHANDLE itself.

Specifically, the table must hold at least 2^(HighBit – LowBit + 1) entries if HIST_LOWHIGH_BITS is set in uFlags. If HIST_ALL_BITS is set in uFlags, the table must hold at least 4096 for 12-bit bitmaps and 65536 for 16-bit bitmaps.

For example, suppose HIST_LOWHIGH_BITS is set in uFlags and you have a 16-bit grayscale image with LowBit = 2 and HighBit = 7. There are 2^(7-2+1) = 64 possible grayscale intensities. The table must therefore hold at least 64 entries. The number of grayscale values with bits 2 – 7 set to 0 can be found in pHisto [0]. The number of grayscale values with bit 2 set to 1 and bits 3 – 7 set to 0 can be found in pHisto [1], and so on up to pHisto [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 pHisto array of the number of grayscale values having the corresponding settings. For example, pHisto [0] contains the number of grayscale values of intensity 0 (all bits set to 0). pHisto [1] contains all the grayscale values with intensity 4 (the 2 bit position set to 1). pHisto [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 pHisto
all 0s | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | pHisto [0]
all 0s | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | pHisto [1]
all 0s | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | pHisto [2]
all 0s | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | pHisto [3]
all 0s | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | pHisto [4]
… |  |  |  |  |  |  | … | … | and so on
all 0s | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | pHisto [63]

As another example, suppose you have a 16-bit grayscale image with LowBit = 0 and HighBit = 15. The table must hold 2^16 = 65,536 L_UINT32 values.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_WindowLevel , L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Color Halftone and Halftone Images

Example

/* This example loads a bitmap at 24 bit per pixel and creates a red-channel histogram, finds the brightest
and darkest intensities in the histogram, and displays the values */
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
L_UINT32 Histogram[256]; /* Array for the histogram */
L_INT nIndex; /* Array index */
L_INT nBrightest; /* Brightest value */
L_INT nDarkest; /* Darkest value */
/* Load the bitmap at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Create the red-channel histogram */
L_GetBitmapHistogram(&LeadBitmap, Histogram, 256, CHANNEL_RED | HIST_ALL_BITS);
/* Initialize the darkest and brightest index values */
nDarkest = 0;
nBrightest = 0;
/* Find the brightest and darkest intensities in the histogram */
for(nIndex = 0; nIndex < 256; nIndex++)
{
if (Histogram[nIndex] != 0)
{
nBrightest = nIndex;
if (nDarkest == 0)
nDarkest = nIndex;
}
}
/* Display the values in a message box */
wsprintf (szMessage, TEXT("Darkest red = %d; Brightest red = %d"), nDarkest, nBrightest);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);


L_GetBitmapHistogramGray

This function has been removed. To achieve the same functionality, use the L_GetBitmapHistogram function.


L_GetBitmapListCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapListCount(hList, puCount)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT L_FAR * puCount; | /* address of the variable to be updated */

Gets the number of bitmaps in a list of bitmaps.

Parameter | Description
hList | Handle to the list of bitmaps.
puCount | Address of the variable to be updated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For a short example, refer to L_GetBitmapListItem. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_GetBitmapListItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapListItem(hList, uIndex, pBitmap, uStructSize)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uIndex; | /* position of the bitmap in the list */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Gets a bitmap handle that references a bitmap in a list.

Parameter | Description
hList | Handle to the list of bitmaps.
uIndex | Position of the bitmap in the list. Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.
pBitmap | Pointer to the bitmap handle that will reference the bitmap in the list.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bitmap handle that this function gets is a copy of the bitmap handle stored internally in the list. If you modify the bitmap using this handle, you can update the internal bitmap handle to reflect the changes by using the L_SetBitmapListItem function.

You should not use this handle to free the bitmap. Instead, use L_DeleteBitmapListItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example changes the hue of bitmaps in a list, then updates
the paint palette and the target bitmap's palette for animation playback.
When changing the hue, it preserves the transparent color. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the target bitmap */
HPALETTE hpalPaint; /* Paint palette handle */
void TestList(HWND hWnd, HBITMAPLIST hList, LPRGBQUAD TransparentColor)
{
HDC hdc; /* Device context of the current window */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for manipulating the list */
L_UINT i; /* Loop counter */
L_UINT uCount; /* Number of bitmaps in the list */
/* Change the hue of each bitmap in the list,
and restore the transparent color as the last color in the palette */
L_GetBitmapListCount(hList, &uCount);
for (i = 0; i < uCount; ++i)
{
L_GetBitmapListItem(hList, i, &TmpBitmap, sizeof(BITMAPHANDLE));
L_ChangeBitmapHue(&TmpBitmap, i * 10);
L_PutBitmapColors(&TmpBitmap, 255, 1, TransparentColor);
L_SetBitmapListItem(hList, i, &TmpBitmap);
}
/* Get an optimized palette for the whole list */
L_ColorResBitmapList(hList, 8,
CRF_NODITHERING|CRF_OPTIMIZEDPALETTE,
NULL, NULL, 0);
/* Update the paint palette that is used for playback */
L_GetBitmapListItem(hList, 0, &TmpBitmap, sizeof(BITMAPHANDLE));
hdc = GetDC (hWnd);
hpalPaint = L_CreatePaintPalette (hdc, &TmpBitmap);
ReleaseDC (hWnd, hdc);
/* Update the target bitmap's background color, based on the new palette */
LeadBitmap.Background = L_TranslateBitmapColor(&TmpBitmap, &LeadBitmap,
LeadBitmap.Background);
/* Copy the new palette to the target bitmap */
L_CopyBitmapPalette(&LeadBitmap, &TmpBitmap);
}


L_GetBitmapMemoryInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapMemoryInfo(pBitmap, puMemoryType, puTileSize, puTotalTiles, puConvTiles, puMaxTileViews, puTileViews);

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_UINT L_FAR * puMemoryType; | /* pointer to the variable to be updated with the memory type */
L_UINT L_FAR * puTileSize; | /* pointer to the variable to be updated with the tile size */
L_UINT L_FAR * puTotalTiles; | /* pointer to the variable to be updated with the number of tiles in the image */
L_UINT L_FAR * puConvTiles; | /* pointer to a variable to be updated with the number of tiles present in conventional memory */
L_UINT L_FAR * puMaxTileViews; | /* pointer to a variable to be updated with the maximum number of tiles which will be accessible at one time */
L_UINT L_FAR * puTileViews; | /* pointer to the current number of tiles which can be accessible at one time */

Gets information about a bitmap’s memory allocation.

Parameter | Description
pBitmap | Pointer to the BITMAPHANDLE that references the bitmap for which to get the memory information. This bitmap must be allocated and this pointer cannot be NULL.
puMemoryType | Pointer to a variable to be updated with the memory type. Possible values are:
 | Value | Meaning
 | TYPE_CONV | The bitmap is allocated in conventional memory. The other parameters will be ignored.
 | TYPE_DISK | The bitmap is allocated entirely on disk. The other parameters will be ignored.
 | TYPE_COMPRESSED | The bitmap is allocated in conventional memory and it is using run-length 1-bit compression. The other parameters will be ignored.
 | TYPE_SUPERCOMPRESSED | The bitmap is allocated in conventional memory and is using SuperCompression (JPEG24-bit or 1-bit Fax G4). The other parameters will be ignored.
 | TYPE_TILED | The bitmap is tiles and can contain a combination of conventional tiles and disk tiles. The other parameters will be updated with information about the tiles.
puTileSize | Pointer to a variable to be updated with the tile size. 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 pBitmap->BytesPerLine. All the tiles in the bitmap (except 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:
 | pBitmap->Size – (*puTotalTiles – 1) * *puTileSize
 | Pass NULL if you do not wish to get this information.
puTotalTiles | Pointer to a variable to be updated with the total number of tiles. Pass NULL if you do not wish to get this information.
puConvTiles | Pointer to a variable to be updated with the number of tiles stored in conventional memory. Pass NULL if you do not wish to get this information.
puMaxTileViews | Pointer to a variable to be updated with the maximum number of tile views. The tile views are used to cache the disk access. Pass NULL if you do not wish to get this information.
puTileViews | Pointer to a variable to be updated with the number of cache views currently allocated. Pass NULL if you do not wish to get this information.

Comments

You can pass NULL for all parameters except pBitmap and puMemoryType if you are not interested in some parameters.

This function is used for informational purposes. You can use L_SetBitmapMemoryInfo 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).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetMemoryThresholds, L_GetMemoryThresholds, L_SetBitmapMemoryInfo, L_SetTempDirectory, L_GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

/* Double the maximum number of disk tile views. But does not allow the maximum number of tile views to exceed the number of disk tiles. The toolkit will also automatically do that, but we will do this here so you see how to calculate the number of disk tiles. */
L_UINT uMemoryType;
L_UINT uMaxTileViews;
L_UINT uTotalTiles;
L_UINT uConvTiles;
L_UINT uTileViews;
BITMAPHANDLE Bitmap;

L_GetBitmapMemoryInfo(&Bitmap, &uMemoryType, NULL, &uTotalTiles, &uConvTiles, &uMaxTileViews, uTileViews);

if(uMemoryType == TYPE_TILED)
{
uMaxTileViews = min(uTileViews * 2, uTotalTiles – uConvTiles);
L_SetBitmapMemoryInfo (&Bitmap, 0, 0, 0, 0, uMaxTileViews, 0, SETMEM_MAXTILEVIEWS);
}


L_GetBitmapRgnArea

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapRgnArea(pBitmap, puArea)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
L_UINT32 L_FAR * puArea; | /* address of the variable to be updated */

Gets the total number of pixels in the bitmap region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
puArea | Address of the variable to be updated with the pixel count.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an L_UINT32 variable for the pixel count. You can then pass the address of the variable in the puArea parameter, and the function will update the variable.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_BitmapHasRgn, L_FreeBitmapRgn, L_IsPtInBitmapRgn
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For complete sample code, refer to the FEATURE3 example.

/* This example displays the area of the current bitmap region */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
L_UINT32 dwArea; /* Number of pixels in the region */
/* Get the number of pixels in the region */
L_GetBitmapRgnArea(&LeadBitmap, &dwArea);
/* Display the result in a message */
wsprintf( szMessage, TEXT("The region area is %ld pixels"), dwArea );
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
}


L_GetBitmapRgnBounds

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapRgnBounds(pBitmap, pXForm, pRect)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */
RECT L_FAR * pRect; | /* address of the RECT structure to be updated */

Gets the bounding rectangle of the bitmap region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pRect | Address of the RECT variable for the bounding rectangle that this function is to update.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_OffsetBitmapRgn
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For complete sample code, refer to the STATUS.C module of the DEMO example.

/****************************************************************************************
This example, which uses a button click to display the bounding rectangle of the bitmap region,
includes sections from a program’s message-processing function. The sample code uses the
following global variables: */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_INT DisplayWidth, DisplayHeight; /* Dimensions of the displayed image */
/* TestFunction(), used in this example, can be copied from the example for L_SetBitmapRgnEllipse.
*****************************************************************************************/
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{
o
o
o
int DisplayMode; /* ROP2 code used for drawing */
HDC hdc; /* Device context used with the palette functions */
RGNXFORM XFormFromBitmap; /* Structure for transforming bitmap coordinates */
RECT rRgn; /* Bounding rectangle of the bitmap region */
switch (Message)
{
case WM_CREATE:
/* Load the bitmap and create the region */
TestFunction(hWnd);
o
o
o
case WM_RBUTTONDOWN:
/* Set XFormFromBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormFromBitmap.uViewPerspective = TOP_LEFT;
XFormFromBitmap.nXScalarNum = DisplayWidth;
XFormFromBitmap.nXScalarDen = BITMAPWIDTH(&LeadBitmap);
XFormFromBitmap.nYScalarNum = DisplayHeight;
XFormFromBitmap.nYScalarDen = BITMAPHEIGHT(&LeadBitmap);
XFormFromBitmap.nXOffset = 0;
XFormFromBitmap.nYOffset = 0;
/* Get the bounding rectangle, relative to the bitmap */
L_GetBitmapRgnBounds(&LeadBitmap, &XFormFromBitmap, &rRgn);
/* Get the current device context */
hdc = GetDC(hWnd);
/* Select drawing objects */
SelectObject(hdc, GetStockObject(WHITE_PEN));
SelectObject(hdc, GetStockObject(NULL_BRUSH));
/* Save the current display mode */
DisplayMode = GetROP2(hdc);
/* Change the display mode to invert colors when we display the rectangle */
SetROP2(hdc, R2_NOT);
/* Draw the region's bounding rectangle */
Rectangle(hdc, rRgn.left, rRgn.top, rRgn.right, rRgn.bottom);
/* Restore the saved display mode */
SetROP2(hdc, DisplayMode);
return (0);
o
o
o
o


L_GetBitmapRgnHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapRgnHandle(pBitmap, pXForm, phRgn)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */
HRGN L_FAR * phRgn; | /* pointer to the Windows region handle */

Creates a Windows region that is a snapshot of the bitmap region and assigns the handle to a variable that you supply.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
phRgn | Pointer to the Windows region handle. You do not have to create the region. You just declare the HRGN variable and pass its address.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

If you want to assign a region from one bitmap to another, you must use the L_GetBitmapRgnHandle function to get region from the first bitmap; then use the L_SetBitmapRgnHandle function to assign the region to the second bitmap.

You are responsible for deleting the Windows region to free memory when the region is no longer needed. To do so, use the Windows DeleteObject function. The following is a list of Windows functions that relate to Windows regions:

CombineRgn creates a region by combining two regions.

CreateEllipticRgn creates an elliptical region.

CreateEllipticRgnIndirect creates and elliptical region.

CreatePolygonRgn creates a polygonal region.

CreatePolyPolygonRgn creates a region consisting of polygons.

CreateRectRgn creates a rectangular region.

CreateRectRgnIndirect creates a rectangular region using a RECT structure.

CreateRoundRectRgn creates a rectangular region with round corners.

DeleteObject deletes a Windows GDI object, such as a region.

EqualRgn compares two regions for equality.

FillRgn fills a region with the specified brush.

FrameRgn draws a border around a region.

GetRgnBox retrieves the bounding rectangle for a region.

InvertRgn inverts the colors in a region.

OffsetRgn moves a region by the specified offsets.

PaintRgn fills a region with the brush in the device context.

PtInRegion queries whether a point is in a region.

RectInRegion queries whether a rectangle overlaps a region.

SetRectRgn changes a region into a specified rectangle.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnHandle
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For a short example, refer to L_SetBitmapRgnHandle. For complete sample code, refer to the DRAW example.


L_GetBitmapRow

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetBitmapRow(pBitmap, pBuffer, nRow, uBytes)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to the target buffer */
L_INT nRow; | /* number of the row to retrieve */
L_UINT32 uBytes; | /* number of bytes in the row to retrieve */

Retrieves a row from a specified bitmap.The buffer to which pBuffer points should contain uncompressed data whether pBitmap is compressed or not.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to get the row from.
pBuffer | Pointer to the buffer to hold the image data that this function gets. You must allocate the buffer before calling this function, and the buffer must be large enough to hold the image data.
nRow | The number of the row to retrieve. The first row is 0, and the last row is 1 less than the bitmap height.
uBytes | The number of bytes in the row to retrieve. To get a full row, use the value in the BytesPerLine field in the bitmap handle.
 | When getting less than full row, you must consider the bits per pixel. For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For 48-bit images, every six bytes represents one pixel. For 64-bit images, every eight bytes represents one pixel.
 | You can use the bitmap handle's BitsPerPixel field with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.BitsPerPixel * NumberOfPixels) / 8;
 | if ((Bitmap.BitsPerPixel * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */

Returns

>=1 | The number of bytes gotten.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function copies image data from the bitmap to a buffer that you specify. The data is copied exactly as it is stored in the image. The bitmap memory must be locked when you use this function. Normally, you can call L_AccessBitmap to lock the memory before starting an operation that uses this function, then call L_ReleaseBitmap when the operation is finished.

Use the BytesPerLine field in the bitmap handle to determine the byte count of each line. Color order is determined by the Order field in the bitmap handle. This value can be ORDER_RGB, ORDER_BGR, ORDER_GRAY or ORDER_ROMM. ORDER_GRAY is only valid for 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For complete sample code, refer to the GETROW example.

/* This example gets each row from a bitmap, inverts the color values, and puts the row back into the bitmap. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
L_UCHAR L_FAR *pBuf; /* Buffer to hold the row */
HGLOBAL hBuf; /* Handle to the buffer */
L_INT nRow; /* Row counter */
L_UINT uByte; /* Byte counter */
/* Load the bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Allocate and lock the buffer */
hBuf = GlobalAlloc(GMEM_MOVEABLE,LeadBitmap.BytesPerLine);
pBuf = (L_UCHAR L_FAR *)GlobalLock( hBuf );
/* Process each row in the bitmap */
L_AccessBitmap(&LeadBitmap);
for(nRow = 0; nRow < LeadBitmap.Height; nRow++)
{
L_GetBitmapRow(&LeadBitmap, pBuf, nRow, LeadBitmap.BytesPerLine);
for(uByte = 0; uByte < LeadBitmap.BytesPerLine; uByte++)
pBuf[uByte] ^= 0xFF;
L_PutBitmapRow(&LeadBitmap, pBuf, nRow, LeadBitmap.BytesPerLine);
}
L_ReleaseBitmap(&LeadBitmap);
/* Free memory that we no longer need */
GlobalUnlock(hBuf);
GlobalFree(hBuf);


L_GetBitmapRowCol

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetBitmapRowCol(pBitmap, pBuffer, nRow, nCol, uBytes)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to the target buffer */
L_INT nRow; | /* number of the row to retrieve */
L_INT nCol; | /* column offset within the row to retrieve */
L_UINT32 uBytes; | /* number of bytes to retrieve */

Accepts a column offset to retrieve data from a bitmap and place it in a buffer. The buffer to which pBuffer points will be filled with uncompressed data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to get the image data from.
pBuffer | Pointer to the buffer to hold the image data that this function gets. You must allocate the buffer before calling this function, and the buffer must be large enough to hold the image data.
nRow | The number of the row to retrieve. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to retrieve. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uBytes | The number of bytes to retrieve. Consider the bits per pixel, and avoid specifying a number that goes past the end of the row.
 | For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For 48-bit images, every six bytes represents one pixel. For 64-bit images, every eight bytes represents one pixel.
 | You can use the bitmap handle's BitsPerPixel field with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.BitsPerPixel * NumberOfPixels) / 8;
 | if ((Bitmap.BitsPerPixel * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */

Returns

>=1 | The number of bytes gotten.
< 1 | An error occurred. Refer to Return Codes.

Comments

By using this low-level function to get any part of a row, you can write a procedure that accesses a single pixel or a rectangular area within the bitmap.

This function accepts an offset parameter (nCol) in pixels and a length (uBytes) in bytes. Therefore, you must consider the bits per pixel of the bitmap when specifying these parameters. The following table describes the rules:

Bits Per Pixel | Column Offset (in Pixels) | Bytes to Get
1 | Must be a multiple of 8 (such as 0, 8, or 16). | Can be any number up to the end of the row. Consider that there are 8 pixels per byte.
4 | Must be an even number (such as 0, 2, or 4). | Can be any number up to the end of the row. Consider that there are 2 pixels per byte.
8 | Can be any column within the bitmap. | Can be any number up to the end of the row. Consider that there is 1 pixel per byte.
16 | Can be any column within the bitmap. | Must be a multiple of 2 (such as 2, 4, or 6), because there are 2 bytes per pixel.
24 | Can be any column within the bitmap. | Must be a multiple of 3 (such as 3, 6, or 9), because there are 3 bytes per pixel.
32 | Can be any column within the bitmap. | Must be a multiple of 4 (such as 4, 8, or 12), because there are 4 bytes per pixel.

The bitmap memory must be locked when you use this function. Normally, you can call L_AccessBitmap to lock the memory before starting an operation that uses this function, then call L_ReleaseBitmap when the operation is finished.

Color order is determined by the Order field in the bitmap handle. This value can be ORDER_RGB, ORDER_BGR, ORDER_GRAY or ORDER_ROMM. ORDER_GRAY is only valid for 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

The following example is designed to work with bitmaps that have a bottom-left or top-left view perspective:

/* This example uses L_GetBitmapRowCol and L_PutBitmapRowCol to invert
the colors of a rectangle in the upper left part of the displayed image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
L_INT XOffset; /* Column offset of the rectangle to process */
L_INT XSize; /* Pixel width of the rectangle to process */
L_INT YOffset; /* Row offset of the rectangle to process */
L_INT YSize; /* Pixel height of the rectangle to process */
L_UCHAR L_FAR *pBuf; /* Buffer to hold the row */
HGLOBAL hBuf; /* Handle to the buffer */
int i, n; /* Counters */
/* Load the bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* This example does not work with rotated view perspectives */
if ( (LeadBitmap.ViewPerspective != TOP_LEFT) || (LeadBitmap.ViewPerspective != BOTTOM_LEFT) )
L_ChangeBitmapViewPerspective ( NULL, &LeadBitmap, sizeof(BITMAPHANDLE), TOP_LEFT );
/* Specify a rectangle in the top left part of the displayed image */
XOffset = BITMAPWIDTH(&LeadBitmap) / 8;
XSize = BITMAPWIDTH(&LeadBitmap) / 3;
YOffset = BITMAPHEIGHT(&LeadBitmap) / 8;
YSize = BITMAPHEIGHT(&LeadBitmap) / 3;
/* Adjust the YOffset if the view perspective is bottom left */
if (LeadBitmap.ViewPerspective == BOTTOM_LEFT)
{
YOffset = LeadBitmap.Height - YOffset - YSize;
}
/* Allocate the buffer */
hBuf = GlobalAlloc(GMEM_MOVEABLE, XSize * 3);
pBuf = (L_UCHAR L_FAR *)GlobalLock( hBuf );
/* Invert the colors of pixels in the rectangle */
L_AccessBitmap(&LeadBitmap);
for(i=YOffset; i < (YOffset + YSize); i++)
{
L_GetBitmapRowCol(&LeadBitmap, pBuf, i, XOffset, XSize * 3);
for(n=0; n < (XSize * 3); n++)
pBuf[n] = pBuf[n] ^ 0xFF;
L_PutBitmapRowCol(&LeadBitmap, pBuf, i, XOffset, XSize * 3);
}
L_ReleaseBitmap(&LeadBitmap);
/* Free memory that we no longer need */
GlobalFree(hBuf);


L_GetBitmapRowColCompressed

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetBitmapRowColCompressed(pBitmap, pWorkBuffer, pRunBuffer, nRow, nCol, uWidth)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pWorkBuffer; | /* pointer to a work buffer */
L_UINT16 L_FAR * pRunBuffer; | /* pointer to the target buffer */
L_INT nRow; | /* number of the row to retrieve */
L_INT nCol; | /* column offset within the row to retrieve */
L_UINT32 uWidth; | /* number of pixels to retrieve */

Retrieves a row (or part of a row) of 1-bit compressed data from a bitmap that has been loaded in its compressed format. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to get the image data from.
pWorkBuffer | NULL or a pointer to an optional work buffer. Allocating the work buffer speeds processing if you call this function more than once, because if you do not allocate a work buffer, the function allocates and frees a temporary buffer each time it is called. The size of this buffer should be the same as the bitmap handle's BytesPerLine field.
pRunBuffer | Pointer to the output buffer, which will be filled with 1-bit compressed image data. Calculate the required size of this buffer as follows: bytes required = (nWidth + 3) * 2.
nRow | The number of the row to retrieve. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to retrieve. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uWidth | The number of pixels to retrieve.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ExpandRow, L_CompressRow, L_PutBitmapRowColCompressed, L_GetBitmapRowCompressed, L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

For an example,refer to L_PutBitmapRowColCompressed.


L_GetBitmapRowCompressed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapRowCompressed(pBitmap, pWorkBuffer, pRunBuffer, nRow, nLines)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pWorkBuffer; | /* pointer to a work buffer */
L_UINT16 L_FAR * pRunBuffer; | /* pointer to the target buffer */
L_UINT nRow; | /* number of the first row to retrieve */
L_UINT nLines; | /* number of the rows to retrieve */

Retrieves one or more rows of 1-bit compressed data from a bitmap that has been loaded in its compressed format. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to get the data from.
pWorkBuffer | NULL or a pointer to an optional work buffer. Allocating the work buffer speeds processing if you call this function more than once, because if you do not allocate a work buffer, the function allocates and frees a temporary buffer each time it is called. The size of this buffer should be the same as the bitmap handle's BytesPerLine field.
pRunBuffer | Pointer to the output buffer, which will be filled with 1-bit compressed image data. Calculate the required size of this buffer as follows: bytes required = nLines * ((bitmap width + 3) * 2).
nRow | Number of the first row to retrieve.
nLines | Number of rows to retrieve.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ExpandRow, L_CompressRow, L_GetBitmapRowColCompressed, L_PutBitmapRowColCompressed, L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

The following example is designed to work with bitmaps that have a bottom-left or top-left view perspective:

/* This example demonstrates the low-level functions for accessing
1-bit compressed bitmap data. It demonstrates the ability to get and put
rows, and the ability to process rows in buffer-to-buffer processing.
The result of the function is an the first 50 lines are inverted. */

void TestLoad(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
L_UCHAR L_HUGE * pBuffer; /* Buffer to hold the expanded row */
L_UINT16 L_HUGE * pRunBuffer; /* Buffer to hold the compressed row */
HGLOBAL hBuffer; /* Handle to the pBuffer */
HGLOBAL hRunBuffer; /* Handle to the pRunBuffer */
L_INT n; /* Counters */
L_INT nRow = 0; /* first row to get */
L_INT nYSize = 50; /* # of rows to get */
L_INT nRet;
/* Load the bitmap, as compressed */
nRet = L_LoadFile(pszFilename,&LeadBitmap, sizeof(BITMAPHANDLE),1,0,
LOADFILE_COMPRESSED | LOADFILE_ALLOCATE | LOADFILE_STORE,
NULL, NULL, NULL, NULL);
/* if the ViewPerspective is not TOP_LEFT or BOTTOM_LEFT, make it TOP_LEFT */
/* Get/PutRow functions only work with TOP_LEFT or BOTTOM_LEFT */
if ( (LeadBitmap.ViewPerspective != TOP_LEFT)
|| (LeadBitmap.ViewPerspective != BOTTOM_LEFT) )
L_ChangeBitmapViewPerspective ( NULL, &LeadBitmap, sizeof(BITMAPHANDLE), TOP_LEFT );
if (LeadBitmap.ViewPerspective == BOTTOM_LEFT)
{
nRow = LeadBitmap.Height - nRow - nYSize;
}
/* Allocate the buffers */
hBuffer = GlobalAlloc(GMEM_MOVEABLE, (((LeadBitmap.Width + 31) &~31)/ 8) * nYSize);
pBuffer = (L_UCHAR L_FAR *)GlobalLock( hBuffer );
hRunBuffer = GlobalAlloc (GMEM_MOVEABLE, (L_UINT32)((LeadBitmap.Width + 3) * 2) * nYSize);
pRunBuffer = (L_UINT16 L_HUGE *)GlobalLock (hRunBuffer);
/* Access the bitmap */
L_AccessBitmap(&LeadBitmap);
/* Get the top nRow lines */
L_GetBitmapRowCompressed ( &LeadBitmap, NULL, pRunBuffer, nRow, nYSize );
/* Expand the compressed data */
L_ExpandRows( pRunBuffer, pBuffer, LeadBitmap.Width, nYSize);
/* Invert the data */
for(n=0; n < (L_INT)LeadBitmap.BytesPerLine * nYSize; n++)
pBuffer[n] = pBuffer[n] ^ 0xFF;
/* Compress the inverted data */
L_CompressRows( pRunBuffer, pBuffer, LeadBitmap.Width, nYSize);
/* Put the inverted, compressed data back into the bitmap */
L_PutBitmapRowCompressed ( &LeadBitmap, NULL, pRunBuffer, nRow, nYSize );
L_ReleaseBitmap(&LeadBitmap);
/* Free memory that we no longer need */
GlobalFree(hBuffer);
GlobalFree(hRunBuffer);
}


L_GetBitmapStatisticsInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetBitmapStatisticsInfo (pBitmap, pStatisticsInfo, uChannel, uStart, uEnd)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPSTATISTICSINFO pStatisticsInfo; | /* address of the STATISTICSINFO structure variable to be updated */
L_UINT uChannel; | /* the color planes to be evaluated */
L_UINT uStart; | /* the starting color value */
L_UINT uEnd; | /* the ending color value */

Returns statistical information about the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pStatisticsInfo | Address of the STATISTICSINFO structure variable to be updated with the image information.
uChannel | 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.
uStart | Indicates the beginning color value of the range for the evaluation.
uEnd | Indicates the ending color value of the range for the evaluation.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function calculates statistical information about the bitmap.

The uStart and uEnd parameters designate the range of colors that will be taken in consideration for producing the results. Only the values between uStart and uEnd 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.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ConvertToColoredGray, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_IsGrayScaleBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Raster Image Functions: Image Analysis
 | Color Halftone and Halftone Images

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
STATISTICSINFO StatisticsInfo;

/* Load a bitmap at 24 bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

/*Get statistical image information */
L_GetBitmapStatisticsInfo (&LeadBitmap, &StatisticsInfo,CHANNEL_MASTER, 0, 255);


L_GetComment

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetComment(uType, pComment, uLength)

L_UINT uType; | /* type of comment */
L_UCHAR L_FAR * pComment; | /* pointer to the target buffer */
L_UINT uLength; | /* size of the target buffer */

Gets a current field that is ready to be saved as a comment in a file. This lets you see the field that was specified with the L_SetComment function.

Parameter | Description
uType | The type of comment. Refer to Types of File Comments.
pComment | Pointer to your buffer that will hold the comment field. You can pass NULL if you only want to get the length of the field (the return value).
uLength | The size of your buffer that will hold the comment field.

Returns

>=0 | Length of the comment field.
< 0 | An error occurred. Refer to Return Codes.

Comments

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, you use the L_SetComment function to specify the comments to be saved.

The L_GetComment function lets you get any of the current comments that are ready to be saved, for example, if you want to let the user review the comments before saving a file. Before getting a comment, you must allocate a buffer for the field. If you do not know how big the buffer needs to be, you can call this function twice: the first time to get the length of the field (the return value), and the second time to actually get the field.

The L_ReadFileComment function lets you read comments that are already saved in a file header. For more information refer to the L_SetComment function.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_ReadFileCommentMemory, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_SetExtFileOption, L_SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetComment.


L_GetCompressFileStamp

This function has been removed. You can get the same functionality using L_ReadFileStamp.


L_GetCurvePoints

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetCurvePoints(pCurve, apUserPoint, uUserPointCount, puPointCount, uFlag)

L_INT L_FAR * pCurve; | /* array of integer values */
POINT L_FAR *apUserPoint; | /* array of points */
L_UINT uUserPointCount; | /* number of points in the array */
L_UINT L_FAR *puPointCount; | /* pointer to a variable to be updated */
L_UINT uFlag; | /* flag */

Updates the pCurve array based on a curve or lines that pass through the specified points.

Parameter | Description
pCurve | Pointer to the array to be filled by this function. To get the real value of the array elements, each of the values must be divided by 1000.
apUserPoint | Pointer to an array of POINT structures that contain the points on the curve used to determine the values for pCurve. The minimum x coordinate value is 0.
uUserPointCount | Number of points in the apUserPoint array.
puPointCount | Pointer to a variable to be updated with the number of entries in pCurve that were actually updated by this function.
uFlag | Flag that indicates the method to be used to update the buffer. Possible values are:
 | Value | Meaning
 | GUB_CURVE | [0x0000] Fill pCurve with the best curve that passes through the user points.
 | GUB_LINEAR | [0x0001] Fill pCurve with lines that pass through the user points.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will update pCurve using either the best curve or lines that pass through the points specified in the apUserPoint parameter. The points in the array may be sorted or not. In most cases, this function is used with the L_FreeHandShearBitmap, or L_FreeHandWaveBitmap functions.

To compute the size of the pCurve array:

Size = Maximum (apUserPoint.x) + 1;

The values stored in pCurve represent the y coordinates of the calculated curve based on the points in the apUserPoint array. In the pCurve array there can be only one y value for each x coordinate. Therefore, circles, ellipses, and spirals cannot be represented by pCurve.

The x coordinates for the user points are sorted internally automatically.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetFunctionalLookupTable, L_GetUserLookUpTable, L_FreeHandShearBitmap, L_FreeHandWaveBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to L_FreeHandShearBitmap or L_FreeHandWaveBitmap.


L_GetDefaultJ2KOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetDefaultJ2KOptions(pOptions, uStructSize)

pFILEJ2KOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Gets the default options for saving JP2 or J2K files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the default options used when saving JP2 or J2K files.
uStructSize | Size of the structure pointed to by pOptions.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetJ2KOptions, L_SetJ2KOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing JPEG 2000 Plug in Features

Example

// This example will reset the current JPEG2000 options to their default values
FILEJ2KOPTIONS J2KOptions;

//get the default values.
L_GetDefaultJ2KOptions(&J2KOptions, sizeof(FILEJ2KOPTIONS));

//make the default values be the current values.
//The next time a JPEG2000 file is saved, it will be saved using the default options.
L_SetJ2KOptions(&J2KOptions);


L_GetDefaultLoadFileOption

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetDefaultLoadFileOption(pLoadOptions, uStructSize)

pLOADFILEOPTION pLoadOptions; | /* pointer to a LOADFILEOPTION structure */
L_UINT uSize; | /* size of the LOADFILEOPTION structure */

Gets the default extended values that are used when loading a file.

Parameter | Description
pLoadOptions | Pointer to the LOADFILEOPTION structure to be updated with the current extended values.
uSize | Size of the LOADFILEOPTION structure pointed to by pLoadOptions. The size of this structure must be specified.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Functions that use the LOADFILEOPTION structure:

L_AnnLoad

L_AnnLoadOffset

L_AnnLoadMemory

L_DecompressBitmapMemory

L_DecompressMemory

L_ReadLoadResolutions

L_ReadFileTransforms

L_FileInfo

L_FileInfoMemory

L_GetCompressFileStamp

L_GetLoadResolution

L_GetFileCommentSize

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileTile

L_LoadFileOffset

L_LoadLayer

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentExt

L_ReadFileCommentMemory

L_ReadFileTag

L_ReadFileTagMemory

L_ReadFileStamp

L_StartFeedLoad

L_FileConvert

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_GetDefaultSaveFileOption

Example

For an example, refer to L_LoadFile.


L_GetDefaultSaveFileOption

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetDefaultSaveFileOption(pSaveOptions, uSructSize)

pSAVEFILEOPTION pSaveOptions; | /* pointer to a SAVEFILEOPTION structure */
L_UINT uStructSize; | /* size of the SAVEFILEOPTION structure */

Gets the default extended values that are used when saving a file.

Parameter | Description
pSaveOptions | Pointer to the SAVEFILEOPTION structure to be filled with the current extended values.
uSize | Size of the SAVEFILEOPTION structure pointed to by pSaveOptions. The size of this structure must be specified.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Functions that use the SAVEFILEOPTION structure:

L_FileConvert

L_CompressBitmapWithStamp

L_DeletePage

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveBitmapWithLayers

L_SaveFile

L_SaveFileMemory

L_SaveFileOffset

L_SaveFileTile

L_StartCompressBuffer

L_WriteFileCommentExt

L_WriteFileStamp

L_WriteFileTransforms

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_GetDefaultLoadFileOption

Example

For an example, refer to L_SaveBitmapList.


L_GetDisplayMode

#include "l_bitmap.h"

L_UINT32 EXT_FUNCTION L_GetDisplayMode(L_VOID)

Gets the painting control flags, which are set by the L_SetDisplayMode function.

Returns

The unsigned integer containing the painting control flags.

Comments

The following are the possible values:

Value | Meaning
DISPLAYMODE_ORDEREDDITHER | [0x00000001] Enables or disables ordered dithering when painting. Ordered dithering is faster than the default dithering method, which uses error diffusion, but the quality of the image is not as good.
DISPLAYMODE_FASTPAINT | [0x00000002] Enables or disables fast painting. Fast painting should be performed only if the current video driver is good, and the image does not need to be dithered or resized to paint. No safety check for a faulty driver is performed.
DISPLAYMODE_INDEXEDPAINT | [0x00000004] Enables or disables painting that is mapped directly to the selected palette. This is enabled by default; you can set this flag to disable it and let Windows do color matching between the paint palette and the selected palette.
DISPLAYMODE_DITHEREDPAINT | [0x00000008] Enables or disables dithered painting. This is enabled by default, but you can set this flag to false to disable it. When enabled, Floyd-Steinberg dithering is used to dither true color or high color images on devices that are 8 bits per pixel or less. When disabled, the device is responsible for color reduction.
DISPLAYMODE_SCALETOGRAY | [0x00000010] (Document/Medical only) 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. If you enable grayscaling, you must call L_CreatePaintPalette, then select and realize the palette before painting an image.
DISPLAYMODE_HALFTONEPRINT | [0x00000020] Enables use of the printing halftone (rather than the viewing halftone) when painting to a 1-bit device. This is useful if you are using the L_PaintDC function for printing.
DISPLAYMODE_FAVORBLACK | [0x00000040] (Document/Medical only) 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.
DISPLAYMODE_FIXEDPALETTE | [0x00000080] Forces the use of a fixed palette when painting to a device that supports 256 colors or less. When this flag is off, the bitmap handle controls palette usage. When this flag is on, the default is the LEAD fixed palette, but on 256-color devices, the Netscape palette is used if the DISPLAYMODE_NETSCAPEPALETTE flag is also set.
DISPLAYMODE_NETSCAPEPALETTE | [0x00000100] Sets the Netscape fixed palette as the preferred fixed palette when painting to a device that supports 256 colors. This fixed palette is employed by both Netscape Navigator and Microsoft Internet Explorer.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetDisplayMode
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For a short example, refer to L_SetDisplayMode. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_GetDJVOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetDJVOptions (pOptions, uStructSize);

pFILEDJVOPTIONS pOptions; | /* pointer to a structure */
L_INT uStructSize; | /* size of the structure */

Gets the current options used by LEADTOOLS when loading DjVu files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the current options used when loading a DjVu file.
uStructSize | Size of the structure pointed to by pOptions. Use sizeof(FILEDJVOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

To change the current options, change the values in the structure pointed to by pOptions and pass a pointer to the updated structure to L_SetDJVOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetDJVOptions
Topics: | Loading and Saving Images
 | Raster Image Functions: Loading Files

Example

For an example, refer to L_SetDJVOptions.


L_GetExtensionAudio

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetExtensionAudio(pExtensionList, nIndex, ppBuffer, puSize)

pEXTENSIONLIST pExtensionList; | /* pointer to a structure */
L_INT nIndex; | /* audio stream index */
L_CHAR L_FAR * L_CHAR * ppBuffer; | /* pointer to a pointer */
L_UINT L_FAR *puSize; | /* pointer to a variable to be updated */

Gets the embedded audio data from the specified extension list.

Parameter | Description
pExtensionList | Pointer to the EXTENSIONLIST structure that contains the audio data to get.
nIndex | Index of the audio stream to retrieve. The extensions may have more than one audio stream. This index is 0-based. Therefore, the first stream is stream 0, the second stream is stream 1, etc. To retrieve all the audio streams, retrieve the streams one by one until an error is returned.
ppBuffer | Pointer to be updated with a pointer to the retrieved audio data. This pointer will point into the pExtensionList. Therefore, this pointer will be valid as long as pExtensionList is valid. The memory will be freed when L_FreeExtensions is called, so do not try to free this memory.
puSize | Pointer to a variable to be updated with the size of the audio data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The audio data is stored inside extensions in the WAVE format. The audio data can be played directly from memory, or the data can be written to a disk file and played from the disk. When writing the audio data to a disk file, give the file a .WAV extension.

Required DLLs and Libraries

LTFIL
Exif file format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadFileExtensions, L_LoadExtensionStamp, L_FreeExtensions, L_ReadFileStamp
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

static L_INT
 LoadExtensionStamp(HWND hWnd, L_TCHAR L_FAR* pszName, pBITMAPHANDLE pBitmap)
{
pEXTENSIONLIST pExtensionList;
L_INT nRet;
L_TCHAR s[300];

nRet =  L_ReadFileExtensions (pszName, &pExtensionList, NULL);
if(nRet != SUCCESS)
{
wsprintf(s, TEXT("Error %d getting extensions!"), nRet);
MessageBox(hWnd, s, TEXT("ERROR"), MB_OK);
return nRet;
}

if(pExtensionList->uFlags & EXTENSION_AUDIO)
{
L_CHAR L_FAR*pData;
L_UINT uSize;

nRet = L_GetExtensionAudio(pExtensionList, 0, &pData, &uSize);
if(nRet != SUCCESS)
{
wsprintf(s, TEXT("Error %d getting the audio data"), nRet);
MessageBox(hWnd, s, TEXT("ERROR"), MB_OK);
}
else
{
#ifdef UNICODE

fd = _wfopen(TEXT("c:\\temp\\exif.wav"), TEXT("wb"));

#else

fd = fopen("c:\\temp\\exif.wav", "wb");

#endif

if(fd)
{
fwrite(pData, uSize, 1, fd);
fclose(fd);
}
}
}

L_FreeExtensions (pExtensionList);
return SUCCESS;
}


L_GetExtFileOption

This function has been removed. Now, the load/save functions take a new, optional parameter for the extended load/save options.

The following functions now take an optional pLOADFILEOPTION argument:

L_AnnLoad

L_AnnLoadOffset

L_AnnLoadMemory

L_DecompressBitmapMemory

L_DecompressMemory

L_ReadLoadResolutions

L_ReadFileTransforms

L_FileInfo

L_FileInfoMemory

L_GetCompressFileStamp

L_GetLoadResolution

L_GetFileCommentSize

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileTile

L_LoadFileOffset

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentExt

L_ReadFileCommentMemory

L_ReadFileTag

L_ReadFileTagMemory

L_ReadFileStamp

L_StartFeedLoad

L_FileConvert

The following functions now take an optional pSAVEFILEOPTION argument:

L_FileConvert

L_CompressBitmapWithStamp

L_DeletePage

L_WriteFileTransforms

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveFile

L_SaveFileMemory

L_SaveFileTile

L_SaveFileOffset

L_StartCompressBuffer

L_WriteFileCommentExt

L_WriteFileStamp

See Also

Functions:

L_GetDefaultLoadFileOption, L_GetDefaultSaveFileOption


L_GetFeretsDiameter

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetFeretsDiameter (pPoints, uSize, puFeretsDiameter, puFirstIndex, puSecondIndex)

POINT L_FAR * pPoints; | /* pointer to an array of object contour coordinate points */
L_UINT uSize; | /* number of points in the array */
L_UINT L_FAR * puFeretsDiameter; | /* pointer to a variable to be updated */
L_UINT L_FAR * puFirstIndex; | /* pointer to a variable to be updated */
L_UINT L_FAR * puSecondIndex; | /* pointer to a variable to be updated */

Computes the Feret’s diameter of an object (the maximum distance between the points of the perimeter of the region), and finds its end points. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pPoints | Pointer to an array of object contour coordinate points.
uSize | Array size.
puFeretsDiameter | Pointer to a variable to be updated with 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.
puFirstIndex | Pointer to a variable to be updated with index of the first end point of the Feret’s diameter.
puSecondIndex | Pointer to a variable to be updated with index of the second end point of the Feret’s diameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function calculates the Feret's Diameter (caliper length), the longest distance between any two points along the boundary. This is equivalent to the minimum diameter of a tube through which this object can pass.

This function does not call the status callback.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Raster Image Functions: Analysis Image Object or Region Analysis

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
RECT rcRect;
POINT L_FAR * pPoints;
L_UINT uSize, uFeretsDiam, uFstIndex, uSndIndex;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

rcRect.top = LeadBitmap.Height/4;
rcRect.bottom = LeadBitmap.Height*3/4;
rcRect.left = LeadBitmap.Width/4;
rcRect.right = LeadBitmap.Width*3/4;
L_SetBitmapRgnEllipse (&LeadBitmap, NULL, &rcRect, L_RGN_SET);
L_GetRgnContourPoints (&LeadBitmap, NULL, &pPoints, &uSize);
L_GetFeretsDiameter (pPoints, uSize, &uFeretsDiam, &uFstIndex, &uSndIndex);


L_GetFileCommentSize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetFileCommentSize(pszFile, uType, uLength, pLoadOptions)

L_TCHAR L_FAR * pszFile; | /* file name */
L_UINT uType; | /* type of comment */
L_UINT L_FAR * uLength; | /* pointer to the size, in bytes, of the comment field */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets the size, in bytes, of the comments.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
uType | The type of comment. Refer to Types of File Comments. A group of comments may be obtained such as CMNT_FPXSUMMARYINFORMATION, or more than one group of comments may be retrieved by using OR as in CMNT_FPXSUMMARYINFORMATION | CMNT_FPXFILESOURCEGROUP, or all comments may be obtained by using CMNT_ALL. See "Example" under L_ReadFileCommentExt. For more information concerning FlashPix file comments,see FlashPix File Comments.
uLength | Pointer to the size of the comments requested.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Presently this function only works with FlashPix files.

To write comments to a file, all the comments you wish to add to a file must be set using L_SetComment. L_SetComment sets each comment individually, but it does not save the comments to the file, it prepares the values for the next save. Once all comments are set, the comments are saved using any function which saves files, such as L_SaveFile or L_SaveBitmap when creating a new file. If you wish to change a comment in an existing file, use L_WriteFileCommentExt.

The basic order of function calls for reading comments is as follows:

Get the size of the comments with L_GetFileCommentSize

Allocate a buffer of a corresponding size.

Read the comments with L_ReadFileCommentExt or L_ReadFileComment.

Free the buffer

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadFileComment,
 | L_SetComment,
 | L_ReadFileCommentExt
 | L_WriteFileCommentExt
Topics: | Raster Image Functions: Maintaining File Comments,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For the following examples:

L_INT I;
L_TCHAR szTemp[80];
L_UINT32 uLength;
L_TCHAR szMessage[80];
HGLOBAL hTextToGet;
L_UCHAR L_FAR *pTextToGet;
L_FLOAT L_FAR *pFloat;
L_CHAR L_FAR *pString;

L_TCHAR szBuf[80];
L_INT nStatus;
FPXCOMMENT_HEADER_ARRAY L_FAR *pArray;
FPXCOMMENT_HEADER_ELEMENT L_FAR *pElement;

//Read one comment - data type: FlashPixFloatArray

nStatus = L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_FPXBRIGHTNESSVALUE,
&uLength, NULL);
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);
nStatus = L_ReadFileComment(TEXT("TEST.FPX"), CMNT_FPXBRIGHTNESSVALUE, pTextToGet, uLength, NULL);
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)pTextToGet;
if(pArray != NULL)
{
szMessage[0] = '\0';
pFloat = (L_FLOAT L_FAR *)(pArray + 1);
for(I = 0; I < (L_INT)pArray->elements; I++)
{
wsprintf(szTemp, TEXT("%5.2f"), pFloat[I]);
lstrcat(szMessage, szTemp);
}
MessageBox(NULL, szMessage, TEXT("Brightness Values"), MB_OK);
}
GlobalFree(hTextToGet);

//Read one comment - data type: FlashPixString

L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_FPXTITLE, &uLength, NULL);
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);
L_ReadFileComment(TEXT("TEST.FPX"), CMNT_FPXTITLE, pTextToGet, uLength, NULL);
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)pTextToGet;
if(pArray != NULL)
{
pString = (L_CHAR L_FAR *)(pArray + 1); /* points to first position after header*/

wsprintf (szBuf, TEXT("%hs"), pString);

MessageBox (NULL, szBuf, TEXT("Title"), MB_OK);
}
GlobalFree(hTextToGet);

//Read one comment - data type: FlashPixFloat

nStatus = L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_FPXEXPOSURETIME, &uLength, NULL);
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);

nStatus = L_ReadFileComment(TEXT("TEST.FPX"), CMNT_FPXEXPOSURETIME, pTextToGet, uLength, NULL);
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *)pTextToGet;
if(pElement != NULL)
{
pFloat = (L_FLOAT L_FAR *)(pElement + 1);
wsprintf(szMessage, TEXT("%f"), *pFloat);
MessageBox(NULL, szMessage, TEXT("Exposure Time"), MB_OK);
}
GlobalFree(hTextToGet);

See also the examples listed under L_ReadFileCommentExt.


L_GetFixedPalette

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetFixedPalette(pPalette, nBitsPerPixel)

LPRGBQUAD pPalette; | /* target palette */
L_INT nBitsPerPixel; | /* bits per pixel of the fixed palette */

Gets the colors of the LEAD fixed palette into the palette that you specify.

Parameter | Description
pPalette | The array of RGBQUAD values that make up the target palette.
nBitsPerPixel | The bits per pixel of the fixed palette.
 | You can specify 0 bits per pixel to create an 8-bit grayscale palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmap, L_CreatePaintPalette, L_GetBitmapColors, L_PutBitmapColors, L_DupPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For an example, refer to L_StartDithering.


L_GetFunctionalLookupTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetFunctionalLookupTable (pLookupTable, uLookupLen, uStart, uEnd, nFactor, uFlag)

L_INT L_FAR * pLookupTable; | /* lookup table */
L_UINT uLookupLen; | /* lookup table length */
L_UINT uStart; | /* first item */
L_UINT uEnd; | /* last item */
L_INT nFactor; | /* factor */
L_UINT uFlag; | /* flag */

Updates a range of entries in the lookup table, based on the specified mathematical function.

Parameter | Description
pLookupTable | Pointer to the lookup table to be filled by this function. The length of the lookup table is specified in the uLookupLen parameter.
uLookupLen | Length of the lookup table pointed to by the pLookupTable parameter. Possible values are:
 | Value | Meaning
 | 65536 | 16-bit / sample image
 | 4096 | 12-bit / sample image
 | 256 | 8-bit / sample image
uStart | Index of the first entry in the lookup table to update. The indices of the table correspond to the intensity values.
uEnd | Index of the last entry in the lookup table to update. The indices of the table correspond to the intensity values.
nFactor | Value that indicates the factor to be applied in the function operation specified in the uFlag parameter. This parameter is used only if uFlag is FLT_EXP, FLT_SIGMOID or FLT_LN. If FLT_EXP or FLT_SIGMOID is set in uFlag the value of this parameter can be any integer (+/-). If FLT_LN flag is set, its value should be >= 0. However, if nFactor = 0 the lookup table will be filled linearly from uStart to uEnd, regardless of the value set in uFlag.
uFlag | Flag that indicates the function used to update the lookup table. Possible values are:
 | Value | Meaning
 | FLT_EXP | [0x0000] Apply the exponential function.
 | FLT_LN | [0x0001] Apply the natural logarithm function.
 | FLT_LINEAR | [0x0002] Apply the linear function.
 | FLT_SIGMOID | [0x0003] Apply the sigmoid function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will update the lookup table array using the predefined function specified in the uFlag parameter. In most cases, this function is used with the L_RemapBitmapIntensity function.

The nFactor parameter is used for log, exp and sigmoid functions only. If nFactor = 0 the function performs a linear interpolation between the two points uStart and uEnd and stores the results in the lookup table, regardless of the value set in uFlag.

If uFlag is FLT_EXP the value of nFactor modifies the lookup table values (see figure below) according to the following equations:

Y | = | uStart | + | (uEnd – uStart) * (exp ((nFactor/10.0 * (x-uStart))/(uEnd-uStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where :

nFirstValue = exp(0).

nLastValue = exp(nFactor/10.0)

x = the intensity value of the selected point

If uFlag is FLT_LN 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.0 * (x-uStart))/(uEnd- uStart)) - nFirstValue)
 |  |  |  | (nLastValue – nFirstValue)

where:

nFirstValue = 0.

nLastValue = ln(1 + nFactor/10.0)

x = the intensity value of the selected point

If uFlag is FLT_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

If uFlag is FLT_LINEAR, nFactor is ignored. The function performs a linear interpolation between the two points uStart and uEnd and stores the results in the lookup table. The user determines the two points uStart and uEnd and their new values, nFirstValue and nLastValue. The value nFirstValue should be stored in the lookup table at the uStart position and nLastValue at the uEnd position of the lookup table before calling this function.

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:

pLookupTable[x] = newCol;

Call L_GetFunctionalLookupTable with uStart set to 0, uEnd set to x, and uFlag set to FLT_LINEAR.

Call L_GetFunctionalLookupTable with uStart set to x, uEnd set to 255, and uFlag set to FLT_LINEAR. (For the example, assume the image is 8-bits per pixel.)

For another example, please refer to the example for L_RemapBitmapIntensity.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetUserLookupTable, L_RemapBitmapIntensity, L_ApplyVOILUT, L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values

Example

/* This example will darken loaded bitmap by using lookup table affected by exponential function.*/

L_UINT LookupTable[256]; /* Array to hold lookup table*/
BITMAPHANDLE LeadBitmap; /*Bitmap handle to hold the loaded image */

/* Load the bitmap, force 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/*Get Lookup table where the array calculated by the exponential function for all the items of the array from 0 - 255*/
L_GetFunctionalLookupTable (LookupTable, 256,0, 255, 5, FLT_EXP);
L_RemapBitmapIntensity (&LeadBitmap, LookupTable, 256,CHANNEL_MASTER);


L_GetGeoKey

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetGeoKey(uTag, puType, puCount, pData)

L_UINT16 uTag; | /* GeoKey ID */
L_UINT L_FAR *puType; | /* pointer to a variable */
L_UINT L_FAR *puCount; | /* pointer to a variable */
L_VOID L_FAR *pData; | /* pointer to the buffer */

Gets the data that is ready to be saved as GeoKeys in a GeoTIFF file.

Parameter | Description
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.
puType | Pointer to the variable to be updated with the GeoKey type. It indicates whether the data pointed to by pData is SHORT, DOUBLE or ASCII. Possible values are:
 | Value | Meaning
 | TAG_ASCII | [2] The data pointed to by pData is an array of ASCII bytes.
 | TAG_SHORT | [3] The data pointed to by pData is an array of SHORT values (2 bytes each).
 | TAG_DOUBLE | [12] The data pointed to by pData is an array of floating points in DOUBLE format (8 bytes each).
puCount | Pointer to the variable to be updated with the number of items required for the pData buffer. Note that this is not the required number of bytes. The required number of will be (*puCount) * number of bytes per value (1 for ASCII, 2 for SHORT, 8 for DOUBLE). If pData passed as NOT NULL, this variable will be updated with the number of data items.
pData | Pointer to the buffer to be updated with the data. You can pass NULL if you want to use this function's return value to determine the required buffer size.

Returns

> 0 | The length of the GeoKey data in bytes.
0 | There is no GeoKey data with this GeoKey.
< 0 | An error occurred. Refer to Return Codes.

Comments

You can use this function to obtain GeoKey data that will be saved the next time you save a GeoTIFF (FILE_GEOTIFF) file.

If you want to get the GeoKey data from a particular file, use the L_ReadFileGeoKey function.

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, specifying NULL in the pData parameter, and using the return value to determine the required size of the buffer.
2. | Allocate the buffer.
3. | Call the function the second time, passing a pointer to your buffer in the pData parameter.

For more information about GeoKeys, refer to Implementing GeoKeys (GeoTIFF tags).

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetGeoKey, L_WriteFileGeoKey, L_ReadFileGeoKey, L_EnumFileGeoKeys, L_SaveFile, L_SaveBitmap
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

/* 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 */
L_UINT16 L_FAR*pData = NULL;
L_UINT uCount;
L_UINT uType;
L_INT nSize;

nSize = L_GetGeoKey(1024, &uType, &uCount, NULL);
if(nSize <= 0)
MessageBox(NULL, "The GeoKey was not set, or an error occurred!", "FAILURE", MB_OK);
else
{
// allocate an array large enough to store the GeoKey data
pData = (L_UINT16 L_FAR*)malloc(nSize);
if(pData != NULL)
{
nSize = L_GetGeoKey(1024, &uType, &uCount, pData);
if(nSize <= 0)
MessageBox(NULL, "Error getting the GeoKey!", "FAILURE", MB_OK);
else
{
// do whatever you want with the GeoKey data
}
free(pData); //// free the pData buffer
}
}


L_GetICCTagData

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_GetICCTagData(pICCProfile, pTagData, uTagSignature)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR L_FAR * pTagData; | /* pointer to a buffer */
L_UINT32 uTagSignature; | /* a value that indicates the tag signature */

Gets a tag from the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag to get.
pTagData | Pointer to a buffer to be updated with the tag data.
uTagSignature | A value that indicates the signature of the tag to get from the ICC profile. Possible values include private tags and the values listed in ICCTAGSIGNATURE. Signatures of private tags must be registered with the ICC.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The pTagData pointer should point to a structure of the same type as the tag type to be retrieved by this function. In case of a private tag type, the pTagData must point to a structure of type ICCTAG_UNKNOWN_TYPE.

If only the tag is private, this function returns ERROR_ICC_UNKNOWN_TAG. If only the tag type is private, this function returns ERROR_ICC_UNKNOWN_TYPE. If both the tag and the type are private, this function returns ERROR_ICC_UNKNOWN_TAG_AND_TYPE. In all three of these cases however, the pTagData parameter is updated correctly with the tag in the ICC profile.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GenerateICCPointer , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This example will load an ICC profile, get a tag, and then free the ICCPROFILEEXT structure */
ICCPROFILEEXT iccProfile;
ICCTAG_DATE_TIME_TYPE iccDateTimeType;
// Initialize the ICC profile
L_InitICCProfileExt (&iccProfile, sizeof(ICCPROFILEEXT));
// Load the ICC profile from an image
L_LoadICCProfileExt (TEXT("image1.jpg"), &iccProfile, NULL);
// Get Calibration Date and Time tag
L_GetICCTagData(&iccProfile, &iccDateTimeType, CALIBRATIONDATETIMETAG);
// Free the ICC profile
L_FreeICCProfileExt (&iccProfile);


L_GetICCTagTypeSig

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_GetICCTagTypeSig(pICCProfile, uTagSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UINT32 uTagSig; | /* value that indicates the tag signature */

Gets the ICC tag type signature of the tag in the ICC profile that has the specified tag signature.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag for which to get the type tag signature.
uTagSig | A value that indicates the signature of the tag for which to get the tag type. Possible values include private tag signatures and the values listed in ICCTAGSIGNATURE.

Returns

> 0 | A value that indicates the signature of the tag type. This value must be one of the values listed in ICCTAGTYPESIGNATURE, or a private tag type signature.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_SetICCTagData , L_GetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GenerateICCPointer , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This function gets back the tag type signature of an ICC tag */
L_VOID GetTypeSig(pICCPROFILEEXT pICCProfile, L_UINT32 uTagSig)
{
L_GetICCTagTypeSig(pICCProfile, uTagSig);
}


L_GetJ2KOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetJ2KOptions(pOptions, uStructSize)

pFILEJ2KOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Gets the file options used by LEADTOOLS when loading JP2 or J2K files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the options used when loading JP2 or J2K files.
uStructSize | Size of the structure pointed to by pOptions.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetJ2KOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing JPEG 2000 Plug in Features

Example

For an example, refer to L_SetJ2KOptions.


L_GetJBIG2Options

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetJBIG2Options(pOptions, uStructSize)

pFILEJBIG2OPTIONS pOptions; | /* pointer to a FILEJBIG2OPTIONS structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pOptions */

Gets the file options used by LEADTOOLS for saving JBIG2 files.

Parameter | Description
pOptions | Pointer to the FILEJBIG2OPTIONS structure to be updated with the options used for saving JBIG2 files.
uStructSize | Size in bytes, of the structure pointed to by pOptions, for versioning. Use sizeof(FILEJBIG2OPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

Required DLLs and Libraries

LTFIL

File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetJBIG2Options
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

For an example, refer to L_SetJBIG2Options.


L_GetLinearVOILUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetLinearVOILUT(pBitmap, pCenter, pWidth, uFlags);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_DOUBLE L_FAR * pCenter; | /* pointer to a variable to be updated */
L_DOUBLE L_FAR * pWidth; | /* pointer to a variable to be updated */
L_UINT uFlags; | /* flags */

Gets the window center and the window width, if the LUT stored inside pBitmap is linear. If the LUT stored inside pBitmap is not linear, the function will fail.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
pCenter | Pointer to a variable to be updated with the center of the range of color intensities that define your window of interest, if the LUT is linear. Cannot be NULL.
pWidth | Pointer to a variable to be updated with the range of color intensities that define your window of interest, if the LUT is linear. Cannot be NULL.
uFlags | Reserved for future use. Pass 0 for now.

Returns

SUCCESS | LUT is Linear (success).
0 | LUT is not linear (fail).
<0 | An error occurred. Refer to Return Codes.

Comments

You have to pay attention to your signed images LUT. The upper half should contain negative values and lower half contains positive values.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowLevel, L_WindowLevelFillLUT, L_GetUserLookupTable, L_RemapBitmapIntensity, L_ApplyLinearVOILUT
Topics: | Raster Image Functions: Palettes

Example

/* check the linearity of the LUT and computes its window width and center by using L_GetLinearVOILUT function.*/
L_INT TestFunction(pBITMAPHANDLE pBitmap, L_DOUBLE * pCenter, L_DOUBLE *pWidth)
{
return L_GetLinearVOILUT (pBitmap, pCenter, pWidth, 0);
}


L_GetLoadInfoCallbackData

#include "l_bitmap.h"

L_VOID L_FAR * EXT_FUNCTION L_GetLoadInfoCallbackData(L_VOID)

Returns the current user data pointer for the LOADINFOCALLBACK, which was set using L_SetLoadInfoCallback.

Returns

Pointer to the previous user data. You can assign this return value to a variable, then use the variable to restore the previous value.

Comments

If no previous user data value has been assigned, then this function will return NULL.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetComment, L_SetComment, L_SetLoadInfoCallback
Topics: | Raster Image Functions: Input and Output
 | Working with the RAW File Filter
 | Loading and Saving Files

Example

For an example, refer to L_SetLoadInfoCallback.


L_GetLoadResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetLoadResolution(nFormat, pWidth, pHeight, pLoadOptions)

L_INT nFormat; | /* file format */
L_UINT32 L_FAR * pWidth; | /* address of the width variable to be updated */
L_UINT32 L_FAR * pHeight; | /* address of the height variable to be updated */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets the last values set by the L_SetLoadResolution function.

Parameter | Description
nFormat | File format. The following are possible values:
 | Value | Meaning
 | FILE_PCD | [57] Kodak PhotoCD
 | FILE_FPX | [80] Kodak FlashPix
 | FILE_JBIG | [115] JBIG
 | FILE_JP2 | [163] JPEG 2000. This file format contains image data and extra information about the contents and organization of the file.
 | FILE_J2K | [164] JPEG 2000. This file format contains only a stream of image data.
 | FILE_CMW | [165] Wavelet CMP.
pWidth | Address of the variable to be updated with the last width value that was set.
pHeight | Address of the variable to be updated with the last height value that was set.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadLoadResolutions, L_SetLoadResolution For Vector files: L_2DGetViewMode, L_2DSetViewMode, L_2DGetViewPort, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing PhotoCD and FlashPix Features
 | Implementing JBIG Features

Example

For an example, refer to L_ReadLoadResolutions.


L_GetLoadStatus

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetLoadStatus();

Detects whether the image that was last loaded has an error.

Returns

SUCCESS | 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.
< 1 | Another error occurred while loading the last image. Refer to Return Codes.

Comments

The returned error code describes a warning that portions of the image that was last loaded might be corrupted.

This function should be called after a load function returned SUCCESS. 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 function returned an error code, then this function should not be used, as its return value is undefined.

Note that the return value is valid for the current thread. So L_GetLoadStatus should be called in the same thread as the load function.

This function is valid for all of the functions that will load a bitmap. Examples of such functions: L_LoadBitmap, L_LoadFile, L_LoadFileOffset, L_FeedLoad, etc.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadFile, L_LoadBitmap, L_FeedLoad, L_LoadMemory, L_LoadFileOffset, L_LoadBitmapList, L_LoadFileTile
Topics: | Raster Image Functions: Loading Files Loading and Saving Images

Example

/* This example will load an image and display a message box indicating whether the image has corrupted areas or not */
L_VOID TestLoadStatus(HWND hWnd)
{
BITMAPHANDLE Bitmap;
L_INT nRet = L_LoadBitmap("image.jpg", &Bitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
if(nRet == SUCCESS)
{
L_INT nLoadStatus = L_GetLoadStatus();
if(nLoadStatus == SUCCESS)
MessageBox(hWnd, TEXT("The image was loaded successfully and with no errors"), "SUCCESS", MB_OK);
else
MessageBox(hWnd, TEXT("The image was loaded, but it might have corrupted areas"), "Warning!", MB_OK);
L_FreeBitmap(&Bitmap);
}
else
MessageBox(hWnd, TEXT("The load failed!"), "ERROR", MB_OK);
}


L_GetMarker

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMarker(hMarkers, uIndex, puMarker, puMarkerSize, pMarkerData)

HANDLE hMarkers; | /* marker handle */
L_UINT uIndex; | /* marker index */
L_UINT L_FAR * puMarker; | /* marker type */
L_UINT L_FAR * puMarkerSize; | /* marker size */
L_UCHAR L_FAR * pMarkerData; | /* marker data */

Gets the specified marker in the collection.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function.
uIndex | Index of the marker to retrieve.
puMarker | Pointer to a variable to be updated with a value that represents the type (ID) of marker to get. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which markers are allowed.
puMarkerSize | Pointer to a variable to be updated with the marker size if pMarkerData is not NULL. The variable should be filled, by the user, with the size of the pMarkerData buffer.
pMarkerData | Pointer to a buffer to be updated with the marker data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function lets you get access to each individual marker without the use of a callback function.

This function is not as efficient as L_EnumMarkers because the data for each marker is copied to your buffer.

To get the size of the specified marker, call this function with pMarkerData set to NULL. puMarkerSize will be filled with the size of the marker data.

If pMarkerData is not NULL, then puMarkerSize should be filled with the size of pMarkerData. If the size is not large enough to hold the marker, the function will fail and return ERROR_BUFFER_TOO_SMALL.

If uIndex is larger than the number of markers present in hMarkers, the function will fail and return ERROR_MARKER_INDEX.

Typically, you would call this function twice:

Call it the first time with pMarkerData set to NULL, to find out the size of the marker.

Call it the second time with the pMarkerData set to the buffer you have allocated.

You can also allocate a buffer of 0xFFFD bytes and use it to hold any marker. You can do this because the size of a marker is limited to 0xFFFD (65533) bytes.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

// This example will get all the markers using a static buffer
L_UCHAR MarkerBuf[0xFFFD]; // static buffer large enough to contain any marker

L_INT MyEnumMarkers(HANDLE hMarkers, HWND hWnd)
{
L_UINT uCount; // number of markers present in hMarkers
L_UINT uIndex; // index of the marker I am retrieving
L_UINT uMarker; // marker ID (0x01 .. 0xFE)
L_UINT uMarkerSize; // size of marker (0 .. 0xFFFD)
L_INT nRet; // return code
L_TCHAR buf[256]; // buffer used for messages

nRet = L_GetMarkerCount (hMarkers, &uCount);
if(nRet == SUCCESS)
{
for(uIndex = 0; uIndex < uCount; uIndex++)
{
// Since I pass MarkerBuf, fill uMarkerSize with the buffer size
uMarkerSize = 0xFFFD;
nRet = L_GetMarker(hMarkers, uIndex, &uMarker, &uMarkerSize, MarkerBuf);
if(nRet != SUCCESS)
{
#ifdef UNICODE

_itow(nRet, buf, 10);

#else

itoa(nRet, buf, 10);

#endif

MessageBox(hWnd, buf, TEXT("Error calling L_GetMarker"), MB_OK);
return nRet;
}
// the function succeeded
// display the results. Note that the some of
// the marker data displayed is meaningless if uMarkerSize is < 4
wsprintf(buf, TEXT("Marker %d: 0x%02X, size=%d, buf = %02X,%02X,%02X,%02X"), uIndex, uMarker, uMarkerSize, MarkerBuf[0], MarkerBuf[1], MarkerBuf[2], MarkerBuf[3]);
MessageBox(hWnd, buf, TEXT("SUCCESS"), MB_OK);
}
MessageBox(hWnd, TEXT("Done"), TEXT("SUCCESS"), MB_OK);
}
return SUCCESS;
}


L_GetMarkerCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMarkerCount(hMarkers, puCount)

HANDLE hMarkers; | /* marker handle */
L_UINT L_FAR * puCount; | /* number of markers */

Gets the number of markers contained in the specified collection.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function.
puCount | Pointer to a variable to be updated with the number of markers in the collection. This cannot be NULL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to L_GetMarker.


L_GetMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMarkers(phMarkers, uFlags)

HANDLE L_FAR * phMarkers; | /* pointer to the markers handle */
L_UINT uFlags; | /* flags that determine function behavior */

Gets a copy of the last markers set with L_SetMarkers.

Parameter | Description
phMarkers | Pointer to a variable to be updated with a handle to a copy of the collection of markers last set with L_SetMarkers. This cannot be NULL.
uFlags | Reserved for future use. Pass 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Since you have a copy, anything you do with the handle will not modify the markers, which can be saved by calling a Save function. To modify the markers being saved, call L_SetMarkers.

When the marker collection handle is no longer needed, use L_FreeMarkers function to free it.

When calling L_GetMarkers, the phMarkers parameter cannot be NULL. However, if no markers have been set using L_SetMarkers, the phMarkers parameter will be updated with NULL when the function returns.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetMarkers, L_FreeMarkers
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

// This example tells you whether you have set any markers or not
HANDLE hMarkers;

if(L_GetMarkers(&hMarkers, 0) != SUCCESS)
MessageBox(NULL, TEXT("Error calling L_GetMarkers!"), TEXT("ERROR"), MB_OK);
else
{
if(hMarkers)
{
MessageBox(NULL, TEXT("You have set markers!"), TEXT("Info"), MB_OK);
 L_FreeMarkers (hMarkers);
}
else
MessageBox(NULL, TEXT("You have not set any markers!"), TEXT("Info"), MB_OK);
}


L_GetMarksCenterMassBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMarksCenterMassBitmap (pBitmap, pMarkPoints, pMarkCMPoints, uMarksCount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT L_FAR * pMarkPoints; | /* pointer to an array of registration mark locations */
POINT L_FAR * pMarkCMPoints; | /* pointer to an array to be filled with points representing the center of mass for each of the supplied registration marks */
L_UINT uMarksCount; | /* number of marks, must be 3 */

Finds the center of mass for each of the registration marks specified by pMarkPoints. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be used in center of mass computation.
pMarkPoints | Pointer to an array of points containing mark locations.
pMarkCMPoints | Pointer to an array that will be filled with points which represent the center of mass for each of the supplied registration marks. The first center of mass point corresponds to the first registration mark in the pMarkPoints array and so on…
uMarksCount | Number of marks, must be 3.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is used to determine the center of mass for each supplied registration mark, to be used in detecting image rotation, scaling and translation.

The results (that is, the points representing each center of mass) returned by this function are multiplied by 100 in order to obtain more precision (00.00). To get the actual results, divide by 100.

This functions uses values that are divided internally by 100.

This function can be used in the following manner:

Use L_SearchRegMarksBitmap to find the registration marks.

Pass data from pMarkDetectedPoints to this function to determine the points representing the center of mass for each registration mark.

Pass these points to L_GetTransformationParameters to detect the image rotation, scaling and translation.

This function does not use L_SetStatusCallback.

If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_RotateBitmap, L_SizeBitmap, L_ResizeBitmap, L_DeskewBitmap, L_IsRegMarkBitmap, L_SearchRegMarksBitmap, L_GetTransformationParameters.
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to L_GetTransformationParameters.


L_GetMemoryThresholds

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_GetMemoryThresholds(pnTiledThreshold, pnMaxConvSize, pnTileSize, pnConvTiles, pnConvBuffers);

L_INT L_FAR * pnTiledThreshold; | /* pointer to a variable to be updated with the tiled threshold */
L_INT L_FAR * pnMaxConvSize; | /* pointer to a variable to be updated with the maximum size for conventional memory */
L_INT L_FAR * pnTileSize; | /* pointer to a variable to be updated with the tile size */
L_INT L_FAR * pnConvTiles; | /* pointer to a variable to be updated with the maximum number of conventional tiles */
L_INT L_FAR * pnConvBuffers; | /* pointer to a variable to be updated with the number of buffers in conventional memory */

Gets the current memory restrictions set using L_SetMemoryThresholds.

Parameter | Description
pnTiledThreshold | Pointer to a variable to be updated with a value that represents the minimum amount of free memory required to allow the allocation of conventional bitmaps. For more information, refer to L_SetMemoryThresholds.
pnMaxConvSize | Pointer to a variable to be updated with a value that represents the maximum size for a conventional bitmap. For more information, refer to L_SetMemoryThresholds.
pnTileSize | Pointer to a variable to be updated with a value that represents the size of the tile for tiled bitmaps. For more information, refer to L_SetMemoryThresholds.
pnConvTiles | Pointer to a variable to be updated with a value that represents the maximum number of tiles that will reside in conventional memory at any time. For more information, refer to L_SetMemoryThresholds.
pnConvBuffers | Pointer to a variable to be updated with the number of buffers in conventional memory. For more information, refer to L_SetMemoryThresholds.

Comments

This function will allow you to retrieve the parameters set with L_SetMemoryThresholds. For more information on the various thresholds, refer to L_SetMemoryThresholds.

Pass NULL for any parameter you are not interested in retrieving.

Returns

None.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetMemoryThresholds, L_GetBitmapMemoryInfo, L_SetBitmapMemoryInfo, L_SetTempDirectory, L_GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

/* This example doubles the maximum size for a conventional bitmap */
L_INT nMaxConvSize;

/* Get only the max conventional size value */
L_GetMemoryThresholds (NULL, &nMaxConvSize, NULL, NULL, NULL);

/* Double the max conventional size value */
L_SetMemoryThresholds (0, nMaxConvSize * 2, 0, 0, 0, MEM_MAXCONVSIZE);


L_GetMinMaxBits

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMinMaxBits(pBitmap, pLowBit, pHighBit)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR *pLowBit; | /* address of a low bit variable to be updated */
L_INT L_FAR *pHighBit; | /* address of a high bit variable to be updated */

Returns the low and high bits of the values present in a 12 or 16-bit grayscale and 48 and 64-bit image. This function is available in the Document/Medical Toolkits only.

Parameter | Description
pBitmap | Pointer to the bitmap handle of a 12-bit or 16-bit grayscale and 48 and 64-bit bitmap.
pLowBit | Address of a variable that will be updated with the lowest bit set in the bitmap.
pHighBit | Address of a variable that will be updated with the highest bit set in the bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The minimum and maximum bit values can be used to specify the range of useful bits and to create a lookup table, for use in L_WindowLevel or L_WindowLevelBitmap.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetMinMaxVal, L_WindowLevel, L_WindowLevelBitmap
Topics: | Raster Image Functions: Palettes
 | Color Halftone and Halftone Images
 | Grayscale Images
 | Raster Image Functions: Processing an Image

Example

This example gets the minimum and maximum bits for an image.

BITMAPHANDLE LeadBitmap; /* Bitmap handle of the image. */
L_INT L_FAR nLowBit; /* the low bit variable */
L_INT L_FAR nHighBit; /* the high bit variable */
/* get min/max bits */
L_GetMinMaxBits(&LeadBitmap, &nLowBit, &nHighBit);


L_GetMinMaxVal

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetMinMaxVal(pBitmap, pMinVal, pMaxVal)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT L_FAR *pMinVal; | /* address of the minimum value variable to be updated */
L_INT L_FAR *pMaxVal; | /* address of the maximum value variable to be updated */

Returns the minimum and maximum intensity values present in a 12 or 16-bit grayscale and 48 and 64-bit image. This function is available in the Document/Medical Toolkits only.

Parameter | Description
pBitmap | Pointer to the bitmap handle of a 12-bit or 16-bit grayscale and 48 and 64-bit bitmap.
pMinVal | Address of a variable that will be updated with the minimum intensity value present in the bitmap.
pMaxVal | Address of a variable that will be updated with the maximum intensity value present in the bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The minimum and maximum values can be used to create a lookup table, for use in L_WindowLevel or L_WindowLevelBitmap.

For signed bitmaps, the minimum intensity and the maximum intensity values can be negative.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetMinMaxBits, L_WindowLevel, L_WindowLevelBitmap
Topics: | Raster Image Functions: Palettes
 | Color Halftone and Halftone Images
 | Grayscale Images
 | Raster Image Functions: Processing an Image

Example

This example gets the minimum and maximum pixel values for an image.

BITMAPHANDLE LeadBitmap; /* Bitmap handle of the image. */
L_INT L_FAR nLow; /* the minimum value */
L_INT L_FAR nHigh; /* the maximum value*/
/* get min/max values */
L_GetMinMaxVal(&LeadBitmap, &nLow, &nHigh);


L_GetObjectInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetObjectInfo (pBitmap,puX, puY, pnAngle, puRoundness, bWeighted)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR * puX; | /* pointer to a variable to be updated */
L_UINT L_FAR * puY; | /* pointer to a variable to be updated */
L_INT L_FAR * pnAngle; | /* pointer to a variable to be updated */
L_UINT L_FAR * puRoundness; | /* pointer to a variable to be updated */
L_BOOL bWeighted; | /* flag */

Determines the position, orientation and roundness of the object in the image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
puX | Address of a variable to be updated with the x coordinate (in pixels) of the object’s center of mass.
puY | Address of a variable to be updated with the y coordinate (in pixels) of the object’s center of mass.
pnAngle | Address of a variable to be updated with 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.
puRoundness | Address of a variable to be updated with the object’s roundness (compactness). This ratio will be 0 for a line and 100 for a circle.
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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

All the objects in the image are considered to be a single object. This function determines various attributes of the object in the image to identify the objects and to determine their position and orientation. If you do not need certain values pass NULL instead.

The results puX, puY and pnAngle obtained by this function are multiplied by 100 in order to obtain more precision. To get the actual results, divide by 100.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Raster Image Functions: Analysis Image Object or Region Analysis

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
L_UINT uX, uY, uRound;
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Get the objects center of mass and it’s roundness. I am not interested in the axis’ orientation, so I pass NULL… */
L_GetObjectInfo (&LeadBitmap, &uX, &uY, NULL, &uRound, FALSE);


L_GetOverlayAttributes

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetOverlayAttributes(pBitmap, nIndex, pOverlayAttributes, uStructSize, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_INT nIndex; | /* the overlay index */
pOVERLAYATTRIBUTES pOverlayAttributes; | /* pointer to the overlay attributes structure to be updated */
L_UINT uStructSize; | /* the size of the OVERLAYATTRIBUTES structure pointed to by pOverlayAttributes */
L_UINT uFlags; | /* flags that determine which attributes to retrieve */

Gets one or more overlay attributes for the specified index. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay for which to get the attributes. This index is zero-based.
pOverlayAttributes | Pointer to the structure to be updated with the specified overlay attributes.
uStructSize | Size of the OVERLAYATTRIBUTES structure pointed to by pOverlayAttributes. Pass sizeof(OVERLAYATTRIBUTES).
uFlags | Flags that determine which attributes to retrieve. You can ‘or’ these flags. Possible values are:
 | Value | Meaning
 | OVERLAYATTRIBUTES_ORIGIN | [0x0001] The top-left position should be retrieved. pOverlayAttributes ->ptOrigin will be updated with the top-left offset.
 | OVERLAYATTRIBUTES_COLOR | [0x0002] Indicates the color should be retrieved. pOverlayAttributes ->crColor will be updated with the color.
 | OVERLAYATTRIBUTES_FLAGS | [0x0004] Indicates the flags should be retrieved. pOverlayAttributes ->uFlags will be updated with the flags.
 | OVERLAYATTRIBUTES_BITINDEX | [0x0008] Indicates the corresponding bitplane position should be retrieved. pOverlayAttributes-> uBitPosition will be updated with the bitplane index.
 | OVERLAYATTRIBUTES_DICOM | [0x0010] Indicates that the DICOM-related attributes should be retrieved, this includes:
 |  | pOverlayAttributes->uRows,
 |  | pOverlayAttributes->uColumns,
 |  | pOverlayAttributes->szType,
 |  | pOverlayAttributes->uBitsAllocated,
 |  | pOverlayAttributes->szDescription,
 |  | pOverlayAttributes->szSubtype,
 |  | pOverlayAttributes->szLabel,
 |  | pOverlayAttributes->nROIArea,
 |  | pOverlayAttributes->fROIMean,
 |  | pOverlayAttributes->fROIStandardDeviation,
 |  | pOverlayAttributes->nNumFramesInOverlay,
 |  | pOverlayAttributes->uImageFrameOrigin,
 |  | pOverlayAttributes->szActivationLayer

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The retrieved values will be stored in the structure pointed by pOverlayAttributes. pOverlayAttributes ->uStructSize will be set to the value of the parameter uStructSize. Only the uStructSize member of pOverlayAttributes and the values retrieved by the function will be updated. The other values are left unchanged.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_GetOverlayBitmap, L_SetOverlayAttributes, L_UpdateBitmapOverlayBits, L_GetOverlayCount, OVERLAYATTRIBUTES, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview

Example

For an example, refer to L_SetOverlayAttributes.


L_GetOverlayBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetOverlayBitmap (pBitmap, nIndex, pOverlayBitmap, uStructSize, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_INT nIndex; | /* the overlay index */
pBITMAPHANDLE pOverlayBitmap; | /* pointer to the overlay bitmap handle */
L_UINT uStructSize; | /* the size of the BITMAPHANDLE structure */
L_UINT uFlags; | /* flags that determine setting options */

Gets the overlay bitmap for the specified index. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay being retrieved. This index is zero-based.
pOverlayBitmap | Pointer to the overlay bitmap handle to be updated with the overlay bitmap at the specified index. This cannot be NULL.
uStructSize | Size of the BITMAPHANDLE structure pointed to by pOverlayBitmap. Pass sizeof(BITMAPHANDLE).
uFlags | Flags that determine how to retrieve the bitmap. You cannot combine these flags. Possible values are:
 | Value | Meaning
 | OVERLAY_COPY | [0x0000] A copy of the overlay bitmap is retrieved from the overlay list.
 | OVERLAY_NOCOPY | [0x0001] 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 | [0x0003] The actual overlay bitmap is retrieved. The bitmap is also removed from the overlay list. This is recommended over OVERLAY_NOCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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. For more information on using OVERLAY_NOCOPY, refer to the "Comments" section of L_SetOverlayBitmap.

If OVERLAY_MOVE is set in uFlags, the overlay bitmap from the corresponding index will be invalidated.

pOverlayBitmap is assumed to be unallocated and uninitialized. It will be filled without freeing the existing data.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_SetOverlayAttributes, L_GetOverlayAttributes, L_UpdateBitmapOverlayBits, L_GetOverlayCount, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview

Example

/* This example will get the overlay bitmaps and save them to separate files. */
L_VOID SaveOverlays(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_INT nRet;
BITMAPHANDLE OverlayBitmap;
L_INT i;
L_TCHAR s[100];

for(i = 0; i < MAX_OVERLAYS; i++)
{
// note that I am using OVERLAY_NOCOPY, so I should not free the overlay bitmap!
nRet = L_GetOverlayBitmap(pBitmap, i, &OverlayBitmap, sizeof(BITMAPHANDLE), OVERLAY_NOCOPY);
if(nRet == SUCCESS)
{
wsprintf(s, TEXT("e:\\i\\overlay%d_copy.cmp"), i);
nRet = L_SaveBitmap(s, &OverlayBitmap, FILE_LEAD1BIT, 1, 1, NULL);
if(nRet != SUCCESS)
MessageBox(hWnd, TEXT("Error saving file!"), s, MB_OK);
}
}
}


L_GetOverlayCallback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetOverlayCallback(ppfnCallback, ppUserData, puFlags)

OVERLAYCALLBACK L_FAR * ppfnCallback; | /* pointer to be updated with the callback function */
L_VOID L_FAR * L_FAR * ppUserData; | /* void pointer to be updated with user data */
L_UINT L_FAR * puFlags; | /* pointer to a variable */

Gets the current overlay callback function, user data and flags, which were set using L_SetOverlayCallback.

Parameter | Description
ppfnCallback | Pointer to a pointer to a callback function to be updated with the last overlay callback function set using L_SetOverlayCallback.
ppUserData | Void pointer to be updated with the value of user defined data associated with the overlay callback. If you are not interested in the user-defined data, pass NULL for this parameter.
puFlags | Pointer to a variable to be updated with the flags used to determine the methods to perform when loading an overlay file and the order in which to perform the methods. These were also previously set using L_SetOverlayCallback.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The overlay callback set using L_SetOverlayCallback becomes the current overlay callback. To get the current overlay callback, call L_GetOverlayCallback.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetOverlayCallback, OVERLAYCALLBACK, L_LoadBitmap
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to the OVERLAYCALLBACK function.


L_GetOverlayCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetOverlayCount (pBitmap, puCount, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_UINT L_FAR* puCount; | /* variable to be updated with the overlay count */
L_UINT uFlags; | /* reserved for future use */

Gets the number of overlays that have been defined for the specified main bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
puCount | Pointer to a variable to be updated with the number of overlays.
uFlags | Reserved for future use. Pass 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will count how many overlays have been defined. The overlays are defined by calling L_SetOverlayBitmap or L_SetOverlayAttributes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_GetOverlayBitmap, L_SetOverlayAttributes, L_GetOverlayAttributes, L_UpdateBitmapOverlayBits, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview

Example

/* This example will count the overlays from pBitmap which has been defined and initialized elsewhere. */
L_UINT uCount;

L_GetOverlayCount(pBitmap, &uCount, 0);
/* now uCount contains the number of overlays */


L_GetPaintContrast

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPaintContrast(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Gets the current contrast value for the specified bitmap. This value is set by the L_SetPaintContrast function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap from which to retrieve the contrast value. This cannot be NULL.

Returns

The current contrast setting. Possible values are -1000 to +1000.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetPaintContrast, L_GetPaintGamma, L_SetPaintGamma, L_GetPaintIntensity, L_SetPaintIntensity
Topics: | Raster Image Functions: Displaying Images

Example

L_VOID TestFunc(pBITMAPHANDLE pBitmap)
{
/* This example gets the current paint settings, and then */
/* updates the bitmap to reflect those values */
L_INT nContrast;
L_UINT uGamma;
L_INT nIntensity;

/* Get the values */
nContrast = L_GetPaintContrast(pBitmap);
uGamma = L_GetPaintGamma(pBitmap);
nIntensity = L_GetPaintIntensity(pBitmap);

/* Update the bitmap */
L_ChangeBitmapContrast(pBitmap, nContrast);
L_GammaCorrectBitmap(pBitmap, uGamma);
L_ChangeBitmapIntensity(pBitmap, nIntensity);
}


L_GetPaintGamma

#include "l_bitmap.h"

L_UINT EXT_FUNCTION L_GetPaintGamma(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Gets the current gamma correction value for the specified bitmap. This value is set by the L_SetPaintGamma function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap from which to retrieve the gamma value. This cannot be NULL.

Returns

Because this is an unsigned integer, the return value is 100 times the actual gamma value. For example, 235 represents a gamma value of 2.35. Gamma can be any number greater than 0. The default value is 100.

Comments

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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPaintContrast, L_SetPaintContrast, L_SetPaintGamma, L_GetPaintIntensity, L_SetPaintIntensity, L_DlgGammaAdjustment
Topics: | Raster Image Functions: Displaying Images

Example

Refer to L_GetPaintContrast.


L_GetPaintIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPaintIntensity(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Gets the current intensity value for the specified bitmap. This value is set by the L_SetPaintIntensity function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap from which to retrieve the intensity value. This cannot be NULL.

Returns

The current intensity setting. Possible values are -1000 to +1000.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPaintContrast, L_SetPaintContrast, L_GetPaintGamma, L_SetPaintGamma, L_SetPaintIntensity
Topics: | Raster Image Functions: Displaying Images

Example

For an example, refer to L_GetPaintContrast.


L_GetPCDResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPCDResolution(pszFile, pPCDInfo)

L_TCHAR, L_FAR * pszFile; | /* name of the PhotoCD file */
pPCDINFO pPCDInfo; | /* pointer to the LEAD PCDINFOPCDINFO structure */

Examines a PhotoCD file to determine which resolutions it contains.

Parameter | Description
PszFile | Character string containing the name of the PhotoCD file.
PPCDInfo | Pointer to the LEAD PCDINFO structure.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, declare a variable for a PCDINFO structure. Then, after calling this function, look at the values in the structure to see which resolutions are available.

The PCDINFO structure is specified as follows in the LTFIL.H file:

typedef struct pcdinfo
{
L_INT resolution[6];
} PCDINFO, L_FAR *pPCDINFO

The structure contains an array of integers, and the value of each integer can be 0 or 1. The following symbolic constants are defined for use as indexes into the array:

Constant Used as Index | Meaning
L_PCD_BASE_OVER_64 | [0] Resolution 64 x 96
L_PCD_BASE_OVER_16 | [1] Resolution 128 x 192
L_PCD_BASE_OVER_4 | [2] Resolution 256 x 384
L_PCD_BASE | [3] Resolution 512 x 768
L_PCD_4BASE | [4] Resolution 1024 x 1536
L_PCD_16BASE | [5] Resolution 2048 x 3072

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_SetExtFileOption, L_GetComment, L_SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example checks for a high resolution PCD image and loads it if possible */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
PCDINFO PCDinfo; /* PCD information structure */
/* Get the PCD resolution information. (LEADTOOLS does not supply PCD files.) */
L_GetPCDResolution(TEXT("IMG0024.PCD"), &PCDinfo);
/* Use high resolution if possible */
if (PCDinfo.resolution[L_PCD_4BASE])
{
L_SetPCDResolution(L_PCD_4BASE);
MessageBox( NULL, TEXT("Loading 1024 x 1536"), TEXT("Notice"), MB_OK );
}
else
{
L_SetPCDResolution(L_PCD_BASE);
MessageBox( NULL, TEXT("Loading 512 x 768"), TEXT("Notice"), MB_OK );
}
/* Load the bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMG0024.PCD"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Reset the default PCD resolution */
L_SetPCDResolution(L_PCD_BASE);


L_GetPDFInitDir

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPDFInitDir(pszInitDir, uBufSize)

L_TCHAR L_FAR * pszInitDir; | /* path of the initialization directory */
L_UINT uBufSize; | /* size in bytes of the data buffer pointed to by pszInitDir */

Retrieves the current path of the PDF initialization directories.

Parameter | Description
pszInitDir | Character string containing the PDF initialization directory path to update.
uBufSize | The size (in bytes) of the data buffer that pszInitDir points to.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function retrieves the current path of the PDF 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 function returns an empty string (length = 0), then the engine will look for the PDF initialization files in the default PDF initialization directories path (specified by the registry key).

To set a new path for the PDF initialization directories, call L_SetPDFInitDir.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPDFInitDir
Topics: | Implementing PDF Plug in Features
 | Raster Image Functions: Input/Output File Filters

Example

For an example, refer to L_SetPDFInitDir.


L_GetPDFOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPDFOptions(pOptions, uStructSize)

pFILEPDFOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Gets the file options used by LEADTOOLS when loading PDF, PS or EPS files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the options used when loading PDF, PS or EPS files.
uStructSize | Size of the structure pointed to by pOptions.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPDFOptions
Topics: | Raster Image Functions: Loading Files
 | Implementing PDF Plug in Features

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetPDFOptions.


L_GetPDFSaveOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPDFSaveOptions(pSaveOptions, uStructSize)

pFILEPDFSAVEOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Retrieves the current PDF saving options.

Parameter | Description
pSaveOptions | Pointer to a structure to be updated with the current PDF saving options.
uStructSize | Size of the structure pointed to by pSaveOptions. Use sizeof(FILEPDFSAVEOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPDFSaveOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing PDF Plug in Features

Example

For an example, refer to L_SetPDFSaveOptions.


L_GetPixelColor

#include "l_bitmap.h"

COLORREF EXT_FUNCTION L_GetPixelColor(pBitmap, nRow, nCol)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */

Returns the color of the specified pixel.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
nRow | The row number of the pixel. This is a zero-based value.
nCol | The column number of the pixel. This is a zero-based value.

Returns

This function returns a COLORREF value which may represent an index into a bitmap's palette, a grayscale value (Medical Imaging only), or red, green, and blue color values.

If an error occurs, this function returns 0x80000000.

Comments

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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter. please note that just because a bitmap has a palette, that does not mean the returned COLORREF value is automatically an index.

In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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. This is not a standard Windows value. Therefore, LEADTOOLS functions will recognize a COLORREF having this format, but Windows functions will not. To use a COLORREF value of this type in a non-LEADTOOLS function, you must do the following:

COLORREF color;

color = L_GetPixelColor(pBitmap, x, y);
if(color & COLORREF_GRAY16)
{ // nonstandard colorref value, convert it to a windows COLORREF
// get an 8 bit gray value corresponding to the 16 bit gray value
L_UCHAR gray = (color & 0xFFFF) >> 8;
// use the standard windows RGB macro to get a windows COLORREF
color = RGB(gray, gray, gray);
}

You can use the L_PutPixelColor function to assign the returned value to another pixel.

This function uses bitmap coordinates to specify the pixel. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.

If you specify a pixel that is outside the bitmap or outside the region (if the bitmap has one), this function returns an error.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_PutPixelColor, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Using Color Values in LEADTOOLS

Example

/* This example uses L_GetPixelColor and L_PutPixelColor to invert
the colors of the pixels in a line in the upper left part of the displayed image. */
L_INT InvertLine (L_TCHAR L_FAR * szFilename, BITMAPHANDLE * pBitmap)
{
L_INT XOffset; /* Column offset of the line to process */
L_INT XSize; /* Pixel width of the line to process */
L_INT YOffset; /* Row offset of the line to process */
L_INT oldXOffset; /* Column offset of the line to process */
L_INT oldYOffset; /* Column offset of the line to process */
COLORREF PixelColor; /* Current pixel color */
int i; /* Counter */
L_INT nRet;
/* Load the bitmap, at its own bits per pixel */
nRet = L_LoadBitmap (szFilename, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Specify a line of pixels */
XOffset = BITMAPWIDTH(pBitmap) / 8;
XSize = BITMAPWIDTH(pBitmap) / 3;
YOffset = BITMAPHEIGHT(pBitmap) / 8;
/* Invert the colors of pixels in the line */
for(i=0; i < XSize; i++)
{
oldXOffset = XOffset;
oldYOffset = YOffset;
/* Adjust the XOffset and YOffset in case the view perspective is not TOP_LEFT */
L_PointToBitmap ( pBitmap, TOP_LEFT, &XOffset, &YOffset );
PixelColor = L_GetPixelColor(pBitmap, YOffset, XOffset);
PixelColor = PixelColor ^ 0x00FFFFFF;
L_PutPixelColor(pBitmap, YOffset, XOffset, PixelColor);
XOffset = oldXOffset; /* Restore XOffset */
YOffset = oldYOffset; /* Restore YOffset */
XOffset++;
}
return nRet;
}


L_GetPixelData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPixelData(pBitmap, pData, nRow, nCol, nSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_VOID L_FAR * pData; | /* pointer to a buffer */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
L_INT nSize; | /* size of the buffer */

Gets the data of the specified pixel. No transformations are performed on the pixel data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
pData | Pointer to a buffer to be updated with the pixel data. This buffer should be able to store nSize bytes.
nRow | The row number of the pixel. This is a zero-based value.
nCol | The column number of the pixel. This is a zero-based value.
nSize | Size of the buffer pointed to by pData. The size should be large enough to contain the data for the pixel. The minimum size can be calculated with the following formula: (pBitmap->BitsPerPixel + 7) / 8.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called only for 8, 16, 24, 32, 48 and 64-bit bitmaps. Here is how it works:

For 8-bit bitmaps, this function will retrieve the palette index for the specified pixel.

For 16-bit bitmaps, the function will retrieve the 2-byte value that forms the pixel.

For grayscale 16-bit bitmaps, the data will contain the gray value. LowBit and HighBit members of the BITMAPHANDLE structure indicate the valid pixel data.

For color 16-bit bitmaps, the data contains packed 5-bit R, G and B values. The high bit contains the alpha information. The Order member in BITMAPHANDLE structure determines whether the data is RGB or BGR.

For 24-bit bitmaps, the function will retrieve the 3 bytes containing the pixel color. The Order member in BITMAPHANDLE structure determines whether the data is RGB or BGR.

For 32-bit bitmaps, the function will retrieve the 4 bytes containing the pixel color and alpha information. The first 3 bytes contain the pixel color. The Order member in BITMAPHANDLE structure determines whether the data in the first 3 bytes is RGB or BGR. The 4th byte is the alpha channel information.

For 48-bit bitmaps, the function will retrieve the 6 bytes containing the pixel color. The Order member in BITMAPHANDLE structure determines whether the data is RGB or BGR. Each color component is stored as a 16-bit value, where 0 corresponds to black and 0xFFFF corresponds to full white.

For 64-bit bitmaps, the function will retrieve the 8 bytes containing the pixel color and alpha information. The Order member in BITMAPHANDLE structure determines whether the data in the first 6 bytes is RGB or BGR. Each color component is stored as a 16-bit value, where 0 corresponds to black and 0xFFFF corresponds to full white. The last two bytes contain the alpha information (also stored as a short value).

This function will return an error if nSize is smaller than it should be. The minimum value for nSize is indicated in a formula above.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor, L_PutPixelData
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

/* This example uses L_GetPixelData and L_PutPixelData to swap the R and G values for a particular pixel. This example will work only with 24, 32, 48 and 64-bit bitmaps*/

L_VOID SwapRGBtoBGR(pBITMAPHANDLE pBitmap, L_INT nRow, L_INT nCol)
{
L_UINT uVal;

if(pBitmap->BitsPerPixel == 24 || pBitmap->BitsPerPixel == 32)
{
L_UCHAR aPixel[4]; // make it large enough for both bitmap types
L_GetPixelData(pBitmap, aPixel, nRow, nCol, sizeof(aPixel));
// swap the R and B values
uVal = aPixel[0]; aPixel[0] = aPixel[2]; aPixel[2] = (L_UCHAR)uVal;
// put back the transformed pixel
L_PutPixelData(pBitmap, aPixel, nRow, nCol, sizeof(aPixel));
}
else if(pBitmap->BitsPerPixel == 48 || pBitmap->BitsPerPixel == 64)
{
L_UINT16 aPixel[4]; // make it large enough for both bitmap types
L_GetPixelData(pBitmap, aPixel, nRow, nCol, sizeof(aPixel));
// swap the R and B values
uVal = aPixel[0]; aPixel[0] = aPixel[2]; aPixel[2] = (L_UINT16)uVal;
// put back the transformed pixel
L_PutPixelData(pBitmap, aPixel, nRow, nCol, sizeof(aPixel));
}
}


L_GetPlaybackDelay

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPlaybackDelay(hPlayback, puDelay)

HPLAYBACK hPlayback; | /* playback handle */
L_UINT32 L_FAR * puDelay; | /* address of the variable to be updated */

Gets the time remaining in the current wait state of an animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.
puDelay | Address of the variable to be updated with the number of milliseconds remaining.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CancelPlaybackWait, L_CreatePlayback, L_DestroyPlayback, L_ProcessPlayback, L_ClearPlaybackUpdateRect, L_GetPlaybackIndex, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/* This example cancels the playback wait state if the current delay is more than 10 milliseconds. */
void TestPlayback(HWND hWnd, pBITMAPHANDLE pTargetBitmap, HBITMAPLIST hList)
{
HPLAYBACK hPlayback; /* Animation playback */
L_UINT uState; /* Next state in the playback */
RECT rcUpdate; /* Source clipping rectangle used in playback */
RECT rcDisplay; /* Display rectangle used in playback */
HDC hdc; /* Device context of the current window */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hpalPaint = NULL;
L_UINT32 uDelay; /* Variable to be updated with the time left */
/* Use the client area as the display rectangle */
GetClientRect(hWnd,&rcDisplay);
/* Create and run the playback */
L_CreatePlayback(&hPlayback, pTargetBitmap, hList);
do
{
L_ProcessPlayback(hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_WAITDELAY:
L_GetPlaybackDelay(hPlayback, &uDelay);
if (uDelay > 10)
L_CancelPlaybackWait(hPlayback);
break;
case PLAYSTATE_POSTRENDER:
L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE);
hdc = GetDC(hWnd);
if (hpalPaint)
{
hPalette = SelectPalette (hdc, hpalPaint, TRUE);
RealizePalette(hdc);
}
L_PaintDC(hdc, pTargetBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY);
if (hpalPaint)
SelectPalette (hdc, hPalette, TRUE);
ReleaseDC(hWnd, hdc);
break;
}
}while(uState != PLAYSTATE_END);
/* Clean up */
L_DestroyPlayback(hPlayback, NULL);
}


L_GetPlaybackIndex

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPlaybackIndex(hPlayback, pnIndex)

HPLAYBACK hPlayback; | /* playback handle */
L_INT L_FAR * pnIndex; | /* address of the variable to be updated */

Gets the list index of the current bitmap during animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.
pnIndex | Address of the variable to be updated with the index of the current bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ProcessPlayback, L_ClearPlaybackUpdateRect, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/* This example uses L_GetPlaybackIndex and L_SetPlaybackIndex to skip
bitmaps during a playback. */
void TestPlayback(HWND hWnd, pBITMAPHANDLE pTargetBitmap, HBITMAPLIST hList)
{
HPLAYBACK hPlayback; /* Animation playback */
L_UINT uState; /* Next state in the playback */
RECT rcUpdate; /* Source clipping rectangle used in playback */
RECT rcDisplay; /* Display rectangle used in playback */
HDC hdc; /* Device context of the current window */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
L_UINT uIndex = 0; /* Current index to the bitmap list */
L_UINT uCount = 0; /* Number of bitmaps in the list */
HPALETTE hpalPaint;

/* Use the client area as the display rectangle */
GetClientRect(hWnd,&rcDisplay);
/* Get the number of bitmaps in the list */
L_GetBitmapListCount(hList, &uCount);
/* Create and run the playback */
L_CreatePlayback(&hPlayback, pTargetBitmap, hList);
do
{
L_ProcessPlayback(hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_PRERENDER:
L_GetPlaybackIndex(hPlayback, &uIndex);
L_SetPlaybackIndex(hPlayback, ++uIndex);
break;
case PLAYSTATE_POSTRENDER:
L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE);
hdc = GetDC(hWnd);
if (hpalPaint)
{
hPalette = SelectPalette (hdc, hpalPaint, TRUE);
RealizePalette(hdc);
}
L_PaintDC(hdc, pTargetBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY);
if (hpalPaint)
SelectPalette (hdc, hPalette, TRUE);
ReleaseDC(hWnd, hdc);
break;
}
} while(uIndex < uCount);
/* Clean up */
L_DestroyPlayback(hPlayback, NULL);
}


L_GetPlaybackState

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPlaybackState(hPlayback, puState)

HPLAYBACK hPlayback; | /* playback handle */
L_UINT L_FAR * puState; | /* address of the variable to be updated */

Gets the current state of the animation playback engine.

Parameter | Description
hPlayback | Handle that references the animation playback.
puState | Address of the variable to be updated with a constant that describes the current state of the animation playback engine. For possible values, refer to Animation Playback States.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ProcessPlayback, L_ClearPlaybackUpdateRect, L_GetPlaybackIndex, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_AppendPlayback. For complete sample code, refer to the FRAME.C module of the DEMO example.


L_GetPlaybackUpdateRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPlaybackUpdateRect(hPlayback, prcUpdate, fClear)

HPLAYBACK hPlayback; | /* playback handle */
LPRECT prcUpdate; | /* address of the RECT structure to be updated */
L_BOOL fClear; | /* TRUE if you want to clear the rectangle */

Gets the update rectangle in the target bitmap during an animation playback. The rectangle uses bitmap coordinates, and it is cumulative.

Parameter | Description
hPlayback | Handle that references the animation playback.
prcUpdate | Address of the RECT structure that this function will fill with the coordinates of the update rectangle
fClear | TRUE if you want to clear the rectangle; FALSE if you do not.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You usually call this after the following states, which you can get with the L_GetPlaybackState function:

Constant

Meaning

PLAYSTATE_POSTCLEAR

[0x0001] Indicates that the target bitmap has been cleared.

PLAYSTATE_POSTRENDER

[0x0003] Indicates that an image has been rendered to the target bitmap.

PLAYSTATE_POSTDISPOSE

[0x0005] Indicates that the current image has been disposed of. The index is incremented after processing this state.

This function uses bitmap coordinates to specify the update rectangle. Therefore, you must account for the bitmap's view perspective. For more information, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ProcessPlayback, L_GetPlaybackIndex, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_ProcessPlayback. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_GetPLTOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPLTOptions(pOptions, uStructSize)

pFILEPLTOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the FILEPLTOPTIONS structure */

Gets the file options used by LEADTOOLS when loading HPGL files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the options used when loading HPGL files.
uStructSize | Size in bytes, of the structure pointed to by pOptions, for versioning. Use sizeof(FILEPLTOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

To set the options to use when loading HPGL files, use L_SetPLTOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPLTOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetPLTOptions.


L_GetPTKOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetPTKOptions(pOptions, uStructSize);

pFILEPTKOPTIONS pOptions; | /* pointer to a structure */
L_INT uStructSize; | /* size of the structure */

Gets the file options used by LEADTOOLS when loading PTOCA and AFP:PTOCA files.

Parameter | Description
POptions | Pointer to a structure to be updated with the options used when loading PTOCA and AFP:PTOCA files.
uStructSize | Size of the structure pointed to by pOptions. Use sizeof(FILEPTKOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetPTKOptions
Topics: | Loading and Saving Images
 | Raster Image Functions: Loading Files

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetPTKOptions.


L_GetResizedRowCol

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetResizedRowCol(pResizeData, pBuffer, nRow, nCol, uBytes)

L_VOID L_FAR pResizeData; | /* pointer to the bitmap handle */
L_UCHAR, L_FAR * pBuffer; | /* pointer to the target buffer */
L_INT nRow; | /* number of the row to retrieve */
L_INT nCol; | /* column offset within the row to retrieve */
L_UINT32 uBytes; | /* number of bytes to retrieve */

Retrieves resized data, one line at a time.

Parameter | Description
pResizeData | Pointer to the resizing process. This is obtained from L_StartResizeBitmap.
pBuffer | Pointer to the buffer to hold the image data that this function gets. You must allocate the buffer before calling this function, and the buffer must be large enough to hold the image data.
nRow | The number of the row to retrieve. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to retrieve. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uBytes | The number of bytes to retrieve. Consider the bits per pixel, and avoid specifying a number that goes past the end of the row.
 | For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For 48-bit images, every six bytes represents one pixel. For 64-bit images, every eight bytes represents one pixel.
 | You can use the bitmap handle's BitsPerPixel field with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.BitsPerPixel * NumberOfPixels) / 8;
 | if ((Bitmap.BitsPerPixel * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */

Returns

>=1 | The number of bytes gotten.
< 1 | An error occurred. Refer to Return Codes.

Comments

By using this low-level function to get any part of a row, you can write a procedure that accesses a single pixel or a rectangular area within the bitmap.

This function accepts an offset parameter (nCol) in pixels and a length (uBytes) in bytes. Therefore, you must consider the bits per pixel of the bitmap when specifying these parameters. The following table describes the rules:

Bits Per Pixel | Column Offset (in Pixels) | Bytes to Get
1 | Must be a multiple of 8 (such as 0, 8, or 16). | Can be any number up to the end of the row. Consider that there are 8 pixels per byte.
4 | Must be an even number (such as 0, 2, or 4). | Can be any number up to the end of the row. Consider that there are 2 pixels per byte.
8 | Can be any column within the bitmap. | Can be any number up to the end of the row. Consider that there is 1 pixel per byte.
16 | Can be any column within the bitmap. | Must be a multiple of 2 (such as 2, 4, or 6), because there are 2 bytes per pixel.
24 | Can be any column within the bitmap. | Must be a multiple of 3 (such as 3, 6, or 9), because there are 3 bytes per pixel.
32 | Can be any column within the bitmap. | Must be a multiple of 4 (such as 4, 8, or 12), because there are 4 bytes per pixel.
48 | Can be any column within the bitmap. | Must be a multiple of 6 (such as 6, 12, or 18), because there are 6 bytes per pixel.
64 | Can be any column within the bitmap. | Must be a multiple of 8 (such as 8, 16, or 24), because there are 8 bytes per pixel.

Do not pass a value in uBytes that goes past the end of the row.

The process is faster when rows are retrieved sequentially, either top-down or bottom-up.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_StartResize, L_StopResize, RESIZECALLBACK

Example

For an example, refer to L_StartResizeBitmap.


L_GetRgnContourPoints

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetRgnContourPoints (pBitmap pXForm, ppPoints, puSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
POINT L_FAR * L_FAR * ppPoints; | /* pointer to a pointer */
L_UINT L_FAR * puSize; | /* pointer to a variable to be updated */

Returns the contour coordinates of a region.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
ppPoints | Pointer to a pointer to be updated with an array that contains the coordinate points of the contour for the specified region. A memory buffer for this array is allocated by the function. When the array is no longer needed, the user should free it by calling the GlobalFreePtr macro.
puSize | Address of a variable to be updated with the number of points in the buffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function works only on bitmaps having a region. If a bitmap does not have a region the function returns the error: Not Initialized.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Analysis Image Object or Region Analysis

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
RECT rcRect;
POINT L_FAR * pPoints;
L_UINT uSize;
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
rcRect.top = LeadBitmap.Height/3;
rcRect.bottom = LeadBitmap.Height*2/3;
rcRect.left = LeadBitmap.Width/3;
rcRect.right = LeadBitmap.Width*2/3;
L_SetBitmapRgnEllipse (&LeadBitmap, NULL, &rcRect, L_RGN_SET);
L_GetRgnContourPoints (&LeadBitmap, NULL, &pPoints, &uSize);


L_GetRgnPerimeterLength

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetRgnPerimeterLength (pBitmap, pXForm, puLength)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
L_UINT L_FAR * puLength; | /* pointer to a variable to be updated */

Computes the length of the perimeter of a region.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
puLength | Address of a variable to be updated with the perimeter length of the region. The length is expressed in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function works only on bitmaps having a region. If a bitmap does not have a region the function returns the error: Not Initialized.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Working with the Existing Bitmap Region
 | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Analysis Image Object or Region Analysis

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
RECT rcRect;
L_UINT uPerimeter;
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
rcRect.top = LeadBitmap.Height/3;
rcRect.bottom = LeadBitmap.Height*2/3;
rcRect.left = LeadBitmap.Width/3;
rcRect.right = LeadBitmap.Width*2/3;
L_SetBitmapRgnEllipse (&LeadBitmap, NULL, &rcRect, L_RGN_SET);
L_GetRgnPerimeterLength(&LeadBitmap, NULL, &uPerimeter);


L_GetRTFOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetRTFOptions(pOptions, uStructSize)

pFILERTFOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Gets the file options used by LEADTOOLS when loading RTF files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the options used when loading RTF files.
uStructSize | Size of the structure pointed to by pOptions.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The options obtained by this function are valid for the current thread.

To set the options used when loading RTF files, use L_SetRTFOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetRTFOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetRTFOptions.


L_GetSaveResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetSaveResolution(puCount, pResolutions)

L_UINT, L_FAR * puCount; | /* address of the count variable to be updated */
pDIMENSION pResolutions; | /* pointer to the array to be updated */

Gets the information saved by the last L_SetSaveResolution.

Parameter | Description
puCount | Address of the puCount variable to be updated with the number of resolutions set by L_SetSaveResolution.
pResolutions | Pointer to the array of DIMENSION structures to be updated with the physical resolutions set by the last call to L_SetSaveResolution. You can pass NULL if you only want to update the count variable.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Currently, this function only works with the JBIG format.

You must allocate the array to be updated. One way to do this is to declare an array of the maximum size (29 elements). Another way is to call this function twice – the first time with NULL in the pResolutions parameter, so that you can get the number of elements and allocate storage of the appropriate size.

For JBIG files, only pResolutions[0].nWidth and pResolutions[0].nHeight are used when a save operation is performed. However, the exact values specified in the last call to L_SetSaveResolution are returned.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetSaveResolution, L_ReadLoadResolutions, L_SetLoadResolution, L_GetLoadResolution For Vector files: L_2DGetViewMode, L_2DSetViewMode, L_2DGetViewPort, L_2DSetViewPort
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing JBIG Features

Example

/* This example gets the dimensions set by
the last call to L_SetSaveResolution and displays them */

void GetDimensions(void)
{
L_TCHAR szMessage[256];/* MessageBox string */
L_UINT uCount;/*variable to be updated with the number of resolutions */
pDIMENSION pDimensions;/* Pointer to the array to be updated */
HGLOBAL hDimensions;/* Handle to the buffer for the array */
L_UINT i;/*loop variable*/

/* Count the number of dimensions */
L_GetSaveResolution (&uCount,NULL);
/* Allocate memory to hold the array of DIMENSION structures */
hDimensions = GlobalAlloc(GMEM_MOVEABLE, sizeof(DIMENSION)* uCount);
pDimensions = (pDIMENSION)GlobalLock( hDimensions );
/*Get the information saved by the last L_SetSaveResolution*/
L_GetSaveResolution(&uCount,pDimensions);
/*Display a message box that shows the available sizes
In the case of JBIG only pDimensions[0].nWidth,
pDimensions[0].nHeight are valid */
wsprintf (szMessage,TEXT("Available dimensions:\n"));
for(i = 0; i < uCount; ++i)
{
wsprintf (szMessage,TEXT("%s\n%d x %d"),szMessage,
pDimensions[i].nWidth, pDimensions[i].nHeight);
}
MessageBox( NULL,szMessage, TEXT("File Information"), MB_OK );
/* Free the memory that we allocated */
GlobalUnlock (hDimensions);
GlobalFree (hDimensions);
}


L_GetStatusCallBack

#include "l_bitmap.h"

STATUSCALLBACK EXT_FUNCTION L_GetStatusCallBack(ppUserData)

L_VOID L_FAR * ppUserData;

/* void pointer to be updated with user data */

Returns the current status callback function that can be used with some functions for updating a status bar and detecting a user interrupt.

Parameter | Description
ppUserData | Void pointer to be updated with the value of user defined data associated with the status callback. If you are not interested in the user defined data, pass NULL for this parameter.

Returns

Pointer to the current status callback function.

Comments

A status callback function can be associated with the following functions:

L_AddBitmapNoise
L_AverageFilterBitmap
L_BinaryFilterBitmap
L_ChangeBitmapContrast
L_ChangeBitmapHue
L_ChangeBitmapIntensity
L_ChangeBitmapSaturation
L_ClearBitmap
L_ColorMergeBitmap
L_ColorSeparateBitmap
L_CombineBitmap
L_DeskewBitmap
L_DespeckleBitmap
L_EmbossBitmap
L_FillBitmap
L_FlipBitmap
L_GammaCorrectBitmap
L_GetBitmapHistogram
L_GrayScaleBitmap
L_HalfToneBitmap
L_HistoEqualizeBitmap
L_IntensityDetectBitmap
L_InvertBitmap
L_MedianFilterBitmap
L_MMConvertFromBitmapList(Video Module only)
L_MMSaveFile(Video Module only)
L_MosaicBitmap
L_PaintDCEffect
L_PosterizeBitmap
L_PrintBitmap
L_RemapBitmapIntensity
L_ResampleBitmap
L_ResizeBitmap
L_ReverseBitmap
L_RotateBitmap
L_RotateBitmapFine
L_SharpenBitmap
L_ShearBitmap
L_SizeBitmap
L_SpatialFilterBitmap
L_StretchBitmapIntensity
L_UnderlayBitmap

This function is the only way to retrieve the user-defined data associated with the status callback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | STATUSCALLBACK, L_SetStatusCallBack
Topics: | Using Callback Functions

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.


L_GetTag

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_GetTag(uTag, pType, pCount, pData)

L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16, L_FAR * pType; | /* address of the variable for the data type */
L_UINT32, L_FAR * pCount; | /* address of the variable for the count */
L_VOID L_FAR * pData; | /* pointer to the buffer for the data */

Gets the data that is ready to be saved as tagged data in a TIFF file. This lets you see the data that was specified with the L_SetTag function.

Parameter | Description
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the L_SetTag function.
pType | Address of the variable to be updated with the tagged data type. The following are possible values:
 | 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.
pCount | Address of the variable to be updated with the count of data items. The count is based on the tagged data type. For example, if the count is 2 and the data type is TAG_DOUBLE, the required buffer size is 16.
pData | Pointer to the buffer to be updated with the data. You can pass NULL if you want to use this function's return value to determine the required buffer size.

Returns

>0 | Length of the tagged data, in bytes.
<= 0 | An error occurred. Refer to Return Codes.

Comments

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, specifying NULL in the pData parameter, and using the return value to determine the required size of the buffer.
2. | Allocate the buffer.
3. | Call the function the second time, passing a pointer to your buffer in the pData parameter.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

To detect whether a file has annotation information, you should call L_GetTag and see if ANNTAG_TYPE is present.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetTag, L_ReadFileTag, L_ReadFileTagMemory, L_DeleteTag
Topics: | Implementing TIFF Comments and Tags

Example

Refer to L_SetTag.


L_GetTempDirectory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetTempDirectory(pszTempDir, uSize)

L_TCHAR L_FAR *pszTempDir; | /* pointer to a buffer to be updated */
L_UINT uSize; | /* size (in bytes) of the buffer pointed by pszTempDir */

Gets the current temporary directory.

Parameter | Description
pszTempDir | Pointer to a buffer to be updated with the directory name. Make sure the buffer is large enough to contain the directory name. (Use a buffer of _MAX_PATH characters).
uSize | The size in bytes of the buffer pointed by pszTempDir. If the size is not large enough, the directory name will be truncated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetMemoryThresholds, L_GetMemoryThresholds, L_GetBitmapMemoryInfo, L_SetBitmapMemoryInfo, L_SetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

L_TCHAR aTempDir[_MAX_PATH];
L_GetTempDirectory(aTempDir, sizeof(aTempDir));
MessageBox(NULL, aTempDir, TEXT("Current temporary directory"), MB_OK);


L_GetTransformationParameters

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetTransformationParameters (pBitmap, pRefPoints, pTrnsPoints, pnXTranslation, pnYTranslation,pnAngle, puXScale, puYScale)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT L_FAR * pRefPoints; | /* pointer to an array of reference points */
POINT L_FAR * pTrnsPoints; | /* pointer to an array of transformed points */
L_INT L_FAR * pnXTranslation; | /* pointer to a variable to be updated */
L_INT L_FAR * pnYTranslation; | /* pointer to a variable to be updated */
L_INT L_FAR * pnAngle; | /* pointer to a variable to be updated */
L_UINT L_FAR * puXScale; | /* pointer to a variable to be updated */
L_UINT L_FAR * puYScale; | /* pointer to a variable to be updated */

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 function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the transformed bitmap.
pRefPoints | Pointer to an array of reference points. These points represent the center of mass points for the registration in the reference bitmap. You have to provide this information.
pTrnsPoints | Pointer to an array of transformed points. These points are the center of mass points in pBitmap. You have to provide this information.
pnXTranslation | Pointer to a variable to be updated by the bitmap x-translation, in hundredths of pixels.
pnYTranslation | Pointer to a variable to be updated by the bitmap y-translation, in hundredths of pixels.
pnAngle | Pointer to a variable to be updated with the bitmap rotation angle, in hundredths of degrees.
puXScale | Pointer to a variable to be updated with the bitmap x-scaling (resizing), in percent.
puYScale | Pointer to a variable to be updated with the bitmap y-scaling (resizing), in percent.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function detects transformation parameters of the transformed bitmap by comparing it with the reference bitmap. The number of reference and detected points must be three.

Use L_GetMarksCenterMassBitmap to fill the pRefPoints array with the points representing the center of masses for each of the reference marks from the reference bitmap.

Fill the pTrnsPoints array by peforming the following steps:

Use L_SearchRegMarksBitmap to find the new positions for the reference marks

Using L_GetMarksCenterMassBitmap to fill the pTrnsPoint array with points representing the center of masses for each of the transformed reference marks.

The values pnXTranslation, pnYTranslation, pnAngle, puXScale and puYScale are internally divided by 100. For example, a pnAngle of 500 would mean to rotate the bitmap 5 degrees clockwise.

The results of this function must be sent without any modification to the L_ApplyTransformationParameters function in order to correct the image.

If you want to correct the image yourself, you have to perform the inverse operations in this order:

Shift the image by (-*pXTranslation / 100, -*pYTranslation / 100) using L_CombineBitmap or L_CombineBitmapExt

Rotate without resizing by – (*pnAngle)

Resize using scaling factors of (100 / *puXScale, 100 / *puYScale) using L_SizeBitmap or L_ResizeBitmap

This function does not use L_SetStatusCallback.

If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_RotateBitmap, L_SizeBitmap, L_ResizeBitmap, L_IsRegMarkBitmap, L_SearchRegMarksBitmap, L_GetMarksCenterMassBitmap
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

/* This example loads a bitmap, and computes the translation parameters. The example makes the assumption that you have saved the position of the registration marks of the reference bitmap in a file. It also assumes you have a function which loads these positions, namely, ‘LoadRefParameters’. You should modify this example and replace LoadRefParameters with your own function before testing this example.
*/
BITMAPHANDLE LeadBitmap; // Bitmap handle for the image
L_INT nAngle;
L_UINT uXScale, uYScale, uXTranslation, uYTranslation;
SEARCHMARKS aSearchMarks[3];
POINT aMarkPoints[3];
POINT aMarkCMPoints[3];
POINT aRefPoints[3];

POINT CenterPt;

// Load a bitmap at its own bits per pixel
L_LoadBitmap (TEXT("e:\\IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

// bend the image around it is center
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap.Height/2;

/* Get aRefPoints from pre-calculated saved values. You have to implement LoadRefParameters */
LoadRefParameters(aRefPoints);

/*Get registration marks CM*/
SET_SIZE(&aSearchMarks[0]);

aSearchMarks[0].uType = RGS_T;
aSearchMarks[0].uMinScale = 90;
aSearchMarks[0].uMaxScale = 110;
aSearchMarks[0].uWidth = 31;
aSearchMarks[0].uHeight = 29;
SetRect(&aSearchMarks[0].rcRect, 0,0,100,100);
aSearchMarks[0].uSearchMarkCount = 1;
aSearchMarks[0].pMarkDetectedPoints = (POINT L_FAR *)
malloc(aSearchMarks[0].uSearchMarkCount * sizeof(POINT));

aSearchMarks[1].uType = RGS_T;
aSearchMarks[1].uMinScale = 90;
aSearchMarks[1].uMaxScale = 110;
aSearchMarks[1].uWidth = 31;
aSearchMarks[1].uHeight = 29;
SetRect(&aSearchMarks[0].rcRect, 200,150,100,100);
aSearchMarks[1].uSearchMarkCount = 1;
aSearchMarks[1].pMarkDetectedPoints = (POINT L_FAR *) malloc(aSearchMarks[1].uSearchMarkCount * sizeof(POINT));

aSearchMarks[2].uType = RGS_T;
aSearchMarks[2].uMinScale = 90;
aSearchMarks[2].uMaxScale = 110;
aSearchMarks[2].uWidth = 31;
aSearchMarks[2].uHeight = 29;
SetRect(&aSearchMarks[0].rcRect, 300,300,100,100);
aSearchMarks[2].uSearchMarkCount = 1;
aSearchMarks[2].pMarkDetectedPoints = (POINT L_FAR *) malloc(aSearchMarks[2].uSearchMarkCount * sizeof(POINT));

L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

L_SearchRegMarksBitmap (&LeadBitmap,aSearchMarks,3);

aMarkPoints[0]= *aSearchMarks[0].pMarkDetectedPoints;
aMarkPoints[1]= *aSearchMarks[1].pMarkDetectedPoints;
aMarkPoints[2]= *aSearchMarks[2].pMarkDetectedPoints;

free(aSearchMarks[0].pMarkDetectedPoints);
free(aSearchMarks[1].pMarkDetectedPoints);
free(aSearchMarks[2].pMarkDetectedPoints);

L_GetMarksCenterMassBitmap (&LeadBitmap, aMarkPoints, aMarkCMPoints, 3);

L_GetTransformationParameters (&LeadBitmap, aRefPoints, aMarkCMPoints, &uXTranslation, &uYTranslation, &nAngle, &uXScale, &uYScale);

L_ApplyTransformationParameters (&LeadBitmap, uXTranslation, uYTranslation,nAngle, uXScale, uYScale, SIZE_BICUBIC);


L_GetTXTOptions

#include "Ltfil.h"

L_INT EXT_FUNCTION L_GetTXTOptions(pOptions, uStructSize)

pFILETXTOPTIONS pOptions; | /* pointer to FILETXTOPTIONS structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pOptions */

Gets the file options used by LEADTOOLS when loading TXT files.

Parameter | Description
pOptions | Pointer to the FILETXTOPTIONS structure to be updated with the options used when loading TXT files.
uStructSize | Size in bytes, of the structure pointed to by pOptions, for versioning. Use sizeof(FILETXTOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To set the options used when loading TXT files, use L_SetTXTOptions.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetTXTOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to L_SetTXTOptions.


L_GetUserLookupTable

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetUserLookupTable (pLookupTable, uLookupLen, apUserPoint, UserPointCount, puPointCount)

L_UINT L_FAR * pLookupTable; | /* lookup table */
L_UINT uLookupLen; | /* lookup table length */
POINT L_FAR *apUserPoint; | /* array of points */
L_UINT UserPointCount; | /* number of points in the array */
L_UINT L_FAR *puPointCount; | /* pointer to a variable to be updated */

Updates the lookup table, based on a curve that passes through the specified points.

Parameter | Description
pLookupTable | Pointer to the lookup table to be filled by this function. The length of the lookup table is specified in the uLookupLen parameter.
uLookupLen | Length of the lookup table pointed to by the pLookupTable parameter. Possible values are:
 | Value | Meaning
 | 65536 | 16-bit / sample image
 | 4096 | 12-bit / sample image
 | 256 | 8-bit / sample image
apUserPoint | Pointer to an array of POINT structures that contain the points on the curve used to update the lookup table.
UserPointCount | Number of points in the apUserPoint array.
puPointCount | Pointer to a variable to be updated with the number of entries in the lookup table that were actually updated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will update the lookup table array using the best curve that passes through the points specified in the apUserPoint parameter. The points in the array may be sorted or not. In most cases, this function is used with the L_RemapBitmapIntensity function.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetFunctionalLookupTable, L_RemapBitmapIntensity, L_AdjustBitmapTint, L_GammaCorrectBitmapExt
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values

Example

/* This example will brighten the loaded bitmap using the lookup table updated by the L_GetUserLookupTable function.*/

L_UINT LookupTable[256]; /* Array to hold lookup table*/
BITMAPHANDLE LeadBitmap; /*Bitmap handle to hold the loaded image */
POINT apUserPoint[3] = {{0,0},{128,150},{255,255}};
/* Load the bitmap, force 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/*Get Lookup table where the array effected by user data function */
L_GetUserLookUpTable (LookupTable, 256,apUserPoint, 3, NULL);
L_RemapBitmapIntensity (&LeadBitmap, LookupTable, 256,CHANNEL_MASTER);


L_GetWMFResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetWMFResolution(lpXResolution, lpYResolution)

L_INT L_FAR * lpXResolution; | /* address of the variable to be updated */
L_INT L_FAR * lpYResolution; | /* address of the variable to be updated */

Gets the current DPI (dots per inch) value that LEADTOOLS uses when loading WMF/EMF files.

Parameter | Description
lpXResolution | Address of the variable, which this function will update with the current value that LEADTOOLS uses for WMF/EMF horizontal resolution.
lpYResolution | Address of the variable, which this function will update with the current value that LEADTOOLS uses for WMF/EMF vertical resolution.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

More options are available in the LOADFILEOPTION structure.

For an explanation of how LEADTOOLS uses the WMF/EMF file resolution value, refer to L_SetWMFResolution.

Before calling this function, you must declare two variables of data type L_INT. You can then pass the address of these variables in the pXResolution and pYResolution parameters, which this function will update with the current values that LEADTOOLS uses for WMF/EMF resolution.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_SetExtFileOption, L_GetComment, L_SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_SetWMFResolution.


L_GetZoomViewProps

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetZoomViewProps(hWnd, pZoomViewProps, uStructSize)

HWND hWnd; | /* handle to a window */
pZOOMVIEWPROPS pZoomViewProps; | /* pointer to a structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pZoomViewProps */

Gets the properties for the specified Zoom View. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.
pZoomViewProps | Pointer to a ZOOMVIEWPROPS structure to be updated with options for controlling the behavior of the zoomed view. You must fill pZoomViewProps->uIndex before calling this function.
uStructSize | Size in bytes, of the structure pointed to by pZoomViewProps, for versioning. Use sizeof(ZOOMVIEWPROPS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To attach a Zoom View to a window, call the L_CreateZoomView function.

When a Zoom View is no longer needed, call the L_DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

To change the current options for the specified Zoom View, change the values in the structure pointed to by pZoomViewProps and pass a pointer to the updated structure to L_UpdateZoomView.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_CreateZoomView, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

For an example, refer to L_UpdateZoomView.


L_GetZoomViewsCount

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GetZoomViewsCount(hWnd, uCount)

HWND hWnd; | /* handle to a window */
L_UINT uCount; | /* number of zoomed views associated with the window */

Gets the number of the zoomed views that have been associated with the specified Window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.
uCount | Variable to be updated with the number of zoomed views associated with the window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will count how many Zoom Views have been created for the specified window. Zoom Views are created by calling the L_CreateZoomView function.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

For an example, refer to L_CreateZoomView.


L_GlassEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GlassEffectBitmap(pBitmap, uCellWidth, uCellHeight, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uCellWidth; | /* cell width */
L_UINT uCellHeight; | /* cell height */
L_UINT uFlags; | /* flags */

Divides the bitmap into rectangular cells and makes it look as if it is being viewed through glass blocks. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uCellWidth | 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 uFlags. The valid range is between 2 and half the bitmap width.
uCellHeight | 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.
uFlags | Flags that indicate what type of data is in the uCellWidth and uCellHeight 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 uCellWidth parameter:
 | Value | Meaning
 | GLASS_WFRQ | [0x0001] The parameter uCellWidth is the number of cells along the width of the bitmap.
 | GLASS_WPER | [0x0002] The parameter uCellWidth is the width of the cell in pixels.
 | The following are the flags that indicate the type of data in the uCellHeight parameter:
 | Value | Meaning
 | GLASS_HFRQ | [0x0010] The parameter uCellHeight is the number of cells along the height of the bitmap.
 | GLASS_HPER | [0x0020] The parameter uCellWidth is the height of the cell in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and applies a glass effect to it: */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* apply glass effect */
L_GlassEffectBitmap(&LeadBitmap, 20,10, GLASS_WFRQ | GLASS_HPER );


L_GlowFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GlowFilterBitmap(pBitmap, uDim, uBright, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* size of the neighborhood */
L_UINT uBright; | /* brightness factor */
L_UINT uThreshold; | /* threshold value */

Makes the colored edges shine with a neon glow. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uDim | Size of the neighborhood used to determine the width of the glow.
uBright | 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.
uThreshold | 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 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 through 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255. Use this parameter to control the number of edge pixels found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uBright 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

uDim = 15;
uBright = 5;
uThreshold = 0;

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap, L_DiffuseGlowBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply glow effect on the image*/
L_GlowFilterBitmap (&LeadBitmap, 5, 3, 0);


L_GrayScaleBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GrayScaleBitmap(pBitmap, nBitsPerPixel)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nBitsPerPixel; | /* number of bits */

Converts a 1-, 4-, 8-, 16-, 24-, or 32-bit bitmap to an 8-bit, 12-bit, or 16-bit grayscale bitmap. Support for 12 and 16-bit grayscale images is available only in the Document/Medical Imaging editions .

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be converted.
nBitsPerPixel | Value indicating the number of bits in the destination bitmap. Valid values are 8, 12, or 16.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The resulting bitmap can be an 8-bit, 12-bit, or 16-bit grayscale bitmap. Once the function is complete, the GrayScale flag of the bitmap handle is set to TRUE.

When converting to 12-bit or 16-bit grayscale, a Lookup table is not used. When converting to 8-bit grayscale, a Lookup table is used to get the RGB for each input pixel. The grayscale value corresponding to that RGB triple is used in the destination bitmap.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_IsGrayScaleBitmap
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftone and Halftone Images

Example

For complete sample code, refer to the FEATURE2 example.

/* This example loads a bitmap and changes it to 8-bit grayscale. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Change the bitmap to grayscale */
L_GrayScaleBitmap(&LeadBitmap, 8 );


L_GrayScaleBitmapExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GrayScaleBitmapExt(pBitmapHndl, RedFact, GreenFact, BlueFact)

pBITMAPHANDLE pBitmapHndl; | /* pointer to the bitmap handle */
L_INT RedFact; | /* the red factor */
L_INT GreenFact; | /* the green factor */
L_INT BlueFact; | /* the blue factor */

Converts any Bitmap to a gray scale bitmap without changing its resolution.

Parameter | Description
pBitmapHndl | Pointer to the bitmap handle that references the bitmap to convert.
RedFact | Value that represents the percentage or weight given to the red value of each pixel in the bitmap. Possible values are 0 to 1000.
GreenFact | Value that represents the percentage or weight given to the green value of each pixel in the bitmap. Possible values are 0 to 1000.
BlueFact | Value that represents the percentage or weight given to the blue value of each pixel in the bitmap. Possible values are 0 to 1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

RedFact + GreenFact + BlueFact 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 RedFact, GreenFact and BlueFact 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 function is called with the RedFact set to 500, the GreenFact set to 250 and the BlueFact 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 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GrayScaleBitmap, L_IsGrayScaleBitmap, L_ConvertToColoredGray, L_BalanceColors, L_SwapColors
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Color Halftone and Halftone Images

Example

/* This example assumes there is a bitmap loaded into Bitmap, which is of type BITMAPHANDLE. */
L_INT RedFact , GreenFact , BlueFact;
BITMAPHANDLE Bitmap;
RedFact = 300;
GreenFact = 590;
BlueFact = 110;
L_GrayScaleBitmapExt(&Bitmap,RedFact,GreenFact,BlueFact);


L_GrayScaleToDuotone

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GrayScaleToDuotone(pBitmap, pNewColor, crColor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRGBQUAD pNewColor; | /* pointer to an array of colors */
COLORREF crColor; | /* color */
L_UINT uFlags; | /* flag that indicates whether colors will be mixed or replaced */

Converts the grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with new colors. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
pNewColor | Pointer to an RGBQUAD structure that specifies an array of colors that will be mixed with the original gray values. If this parameter is set to NULL, the crColor parameter must contain a valid color. Pass NULL when you want the function to create the array of colors, two colors when replacing both colors in a binary image, or 256 colors when using a custom array of colors.
crColor | An RGB color that will be used to create an array of colors internally. This parameter is used when the pNewColor structure is set to NULL. This parameter is ignored if the pNewColor value is something other than NULL.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function was designed for use with grayscale bitmaps. If the bitmap being used is not grayscale, this function only affects those pixels or areas of the bitmap where Red=Green=Blue.

This function 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 uFlags to DT_REPLACE, which clears the palette.

This function 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 L_IsGrayScaleBitmap function is called by L_GrayScaleToDuotone to determine the kind of grayscale palette being used. If L_IsGrayScaleBitmap returns GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to L_GrayScaleToDuotone will become the first color in the array generated by the toolkit, pNewColor[0], and the toolkit will create the second color in the array pNewColor[1].
 | If L_IsGrayScaleBitmap returns a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to L_GrayScaleToDuotone will become the second color in the array generated by the toolkit, pNewColor[1], and the toolkit will create the first color in the array pNewColor[0].
(b) | If the bitmap is grayscale (not binary) the L_GrayScaleToDuotone will take the color passed to it in the crColor parameter and generate a 256 color gradient in pNewColor.
(c) | If the bitmap is not grayscale (it is color) then the L_GrayScaleToDuotone will use the color passed to it in the crColor parameter and generate a 256 color gradient in pNewColor. 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 L_GrayScaleToDuotone with the two colors you wish to use in the pNewColor parameter.
(b) | If the bitmap is grayscale (not binary) call L_GrayScaleToDuotone with the 256 colors you wish to use in the pNewColor parameter.
(c) | If the bitmap is not grayscale (it is color) call L_GrayScaleToDuotone with the 256 colors you wish to use in the pNewColor parameter. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GrayScaleBitmap, L_IsGrayScaleBitmap, L_GrayScaleToMultitone
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftone and Halftone Images

Example

/* This example loads a bitmap and converts it to a Duotone. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
COLORREF crColor; /* New Color */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Change the bitmap to grayscale bitmap */
L_GrayScaleBitmap (&LeadBitmap, 8);

/* The new color is Red */
crColor = RGB(255, 0, 0);

/* Apply duotone conversion*/
L_GrayScaleToDuotone(&LeadBitmap, NULL, crColor, DT_REPLACE);


L_GrayScaleToMultitone

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_GrayScaleToMultitone(pBitmap, uToneType, uDistType, pColor, pGradient, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uToneType; | /* number of colors to add */
L_UINT uDistType; | /* type of color shade distribution */
LPCOLORREF pColor; | /* array of RGB colors that will be mixed with the bitmap’s palette */
LPRGBQUAD L_FAR * pGradient; | /* pointer to array of palette entries that hold the user-defined color shades */
L_UINT uFlags; | /* flag that indicates whether colors will be mixed or replaced */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
uToneType | Flag that indicates the number of colors to add to the grayscale bitmap. Possible values are:
 | Value | Meaning
 | DT_MONOTONE | [0x0000] Add one color.
 | DT_DUOTONE | [0x0001] Add two colors.
 | DT_TRITONE | [0x0002] Add three colors.
 | DT_QUADTONE | [0x0003] Add four colors.
uDistType | 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_USERDEFINE | [1] Use the user-defined gradient in the pGradient parameter.
pColor | Pointer to an array of RGB colors, that will be added to the grayscale bitmap. This parameter is ignored when the uDistType parameter 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 L_GrayScaleToMultitone is called. The number of entries in the array depends on the value of uToneType: 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.
pGradient | Pointer to a user-defined array of palette entries that will hold the set of color shade gradients. This parameter is used when the uDistType parameter is set to DT_USER.
 | The number of entries in this array should be 256 entries for each TONE.
uFlags | 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 | [0x0000] Mix the old colors with the new ones
 | DT_REPLACE | [0x0001] Replace the old colors with the new ones

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function was designed for use with grayscale bitmaps. If the bitmap being used is not grayscale, this function only affects those pixels or areas of the bitmap where Red=Green=Blue.

Monotone conversion is possible by setting uFlags to DT_REPLACE, which clears the palette.

This function 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 L_GrayScaleToMultitone with uToneType set to DT_MONOTONE, uDistType set to DT_LINEAR and the color you wish to use set in pColor. The L_IsGrayScaleBitmap function will be called by L_GrayScaleToDuotone to determine the kind of grayscale palette being used. If L_IsGrayScaleBitmap returns GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the pColor parameter to L_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 pColor array will be updated with these two colors.
 | If L_IsGrayScaleBitmap returns a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the pColor parameter to L_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 pColor parameter will be updated with these two colors.
(b) | If the bitmap is grayscale (not binary) call L_GrayScaleToMultitone with uDistType set to DT_LINEAR. The L_GrayScaleToMultitone function will take the color(s) passed to it in the pColor parameter and generate a 256 color gradient for each color.
 | (i) | If the uToneType is set to DT_DUOTONE, set two colors in the pColor parameter. The toolkit will create a 256 color array for each color. The pColor array will be updated with all 512 colors.
 | (ii) | If the uToneType is set to DT_TRITONE, set three colors in the pColor parameter. The toolkit will create a 256 color array for each color. The pColor array will be updated with all 768 colors.
 | (iii) | If the uToneType is set to DT_QUADTONE, set four colors in the pColor parameter. The toolkit will create a 256 color array for each color. The pColor array will be updated with all 1024 colors.
(c) | If the bitmap is not grayscale (it is color) call L_GrayScaleToMultitone with uDistType set to DT_LINEAR. The L_GrayScaleToMultitone function will take the color(s) passed to it in the pColor parameter 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 L_GrayScaleToMultitone with uToneType set to DT_MONOTONE, uDistType set to DT_USER and the two colors you wish to use in the pGradient parameter.
(b) | If the bitmap is grayscale (not binary) call L_GrayScaleToMultitone with uDistType set to DT_USER.
 | (i) | If the uToneType is set to DT_DUOTONE, set 512 colors (256 for each basic color) in the pGradient parameter.
 | (ii) | If the uToneType is set to DT_TRITONE, set 768 colors (256 for each basic color) in the pGradient parameter.
 | (iii) | If the uToneType is set to DT_QUADTONE, set 1024 colors (256 for each basic color) in the pGradient parameter.
(c) | If the bitmap is not grayscale (it is color) call L_GrayScaleToMultitone with uDistType 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.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GrayScaleBitmap, L_IsGrayScaleBitmap, L_GrayScaleToDuotone
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftone and Halftone Images

Example

/* This example loads a bitmap and applies Duotone conversion to it. */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
COLORREF crColor[2]; /* New Color */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Change the bitmap to grayscale bitmap*/
L_GrayScaleBitmap (&LeadBitmap, 8);

/* The new colors */
crColor[0] = RGB(255, 255, 0);
crColor[1] = RGB(255, 0, 0);

/* Apply Multitone conversion */
L_GrayScaleToMultitone(&LeadBitmap, DT_DUOTONE, DT_LINEAR, crColor, NULL, DT_MIX);


L_HalfToneBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HalfToneBitmap(pBitmap, uType, nAngle, uDim, hList)

pBITMAPHANDLE pBitmap; | /* Pointer to the bitmap handle */
L_UINT uType; | /* Type of halftoning to do */
L_INT32 nAngle; | /* Angle of rotation */
L_UINT uDim; | /* Size of the grain */
HBITMAPLIST hList; | /* Handle to the list of bitmaps */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be converted.
uType | Value that indicates the type of halftoning to perform. Possible values are:
 | Value | Meaning
 | HT_PRINT | [0x0000] Halftone for printing
 | HT_VIEW | [0x0001] Halftone for display
 | HT_RECT | [0x0002] Rectangular halftone
 | HT_CIRC | [0x0003] Circular halftone
 | HT_ELLIPS | [0x0004] Elliptical halftone
 | HT_RAND | [0x0005] Random halftone
 | HT_LINEAR | [0x0006] Linear halftone
 | HT_USERDEF | [0x0007] User defined halftone
nAngle | 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 HT_RECT, HT_CIRC or HT_RAND or HT_USERDEF.
uDim | Value that indicates the size of the grain. This value is ignored if the selected halftone pattern is HT_VIEW or HT_PRINT. If the pattern is not HT_VIEW or HT_PRINT, uDim should be >= 1. If this parameter is < 1 this function will return ERROR_INV_PARAMETER (-13).
hList | Handle to the list of bitmaps that will be used in half toning if the HT_USERDEF option is selected.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For the HT_USERDEF option, the number of bitmaps in the list must be at least equal to (uDim * uDim + 1). Bitmaps with higher indexes correspond to higher intensity values.

This function can process the whole image or a region of the image.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DefaultDithering, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_DlgHalftone , L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftone and Halftone Images

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HBITMAPLIST hList;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* fill hList by at least 26 bitmaps*/
/* Halftone the bitmap */
L_HalfToneBitmap(&LeadBitmap, HT_USERDEF,0, 5, hList);


L_HalfTonePatternBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HalfTonePatternBitmap(pBitmap, uContrast, uRipple, uAngleContrast, uAngleRipple, nAngleOffset, crForeGround, crBackGround, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uContrast; | /* pattern contrast */
L_UINT uRipple; | /* pattern frequency */
L_UINT uAngleContrast; | /* angular pattern contrast */
L_UINT uAngleRipple; | /* angular pattern frequency */
L_INT nAngleOffset; | /* angular pattern offset */
COLORREF crForeGround; | /* forground color */
COLORREF crBackGround; | /* background color */
L_UINT uFlag; | /* flag */

Creates a halftone screen effect for an image while keeping its continuous range of tones. This function is available only in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uContrast | Halftone pattern contrast. Increasing this value increases the pattern brightness, making it more visible.
uRipple | Halftone pattern frequency. Internally, this value is divided by 100. For example, if uRipple = 200 the actual frequency is 2. Increasing this value increases the number of dots, lines, etc. in the pattern.
uAngleContrast | 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.
uAngleRipple | 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.
uAngleOffset | 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.
crForeGround | The COLORREF value that specifies the foreground color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crBackGround | The COLORREF value that specifies the background color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to create a halftone screen effect for an image while keeping its continuous range of tones. Use the uContrast parameter to control the amount of the midtones in the image.

Use the L_ColorHalfToneBitmap 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 L_HalfToneBitmap function 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 L_GrayScaleBitmapExt function 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 L_HalfTonePatternBitmap function using the following settings:

Parameter | Value
uContrast | 1
uRipple | 20000
uAngleContrast | na
uAngleRipple | na
uAngleOffset | na
crForeGround | Black
crBackGround | White
uFlag | HTPATTERN_DOT

The following figure results:

As another example, if you were to use the same original bitmap but call L_HalfTonePatternBitmap using the following settings:

Parameter | Value
uContrast | 75
uRipple | 20000
uAngleContrast | 85
uAngleRipple | 4
uAngleOffset | 54
crForeGround | White
crBackGround | Brown
uFlag | HTPATTERN_CIRCLE

The following figure results:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DefaultDithering, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_HalfToneBitmap, L_PointillistBitmap, L_ColorHalfToneBitmap, L_ColorSeparateBitmap, L_ColorMergeBitmap, L_DesaturateBitmap, L_GetBitmapStatisticsInfo, L_GetBitmapHistogram, L_GetBitmapColorCount, L_GetBitmapColors, L_GetMinMaxBits, L_GetMinMaxVal, L_ConvertToColoredGray, L_ColorizeGrayBitmap, L_GetBitmapAlpha, L_ShiftBitmapData, L_SelectBitmapData, L_AnnSetAutoHilightPen, L_AnnSetAutoCursor, L_GetBitmapHistogramGray, L_IsGrayScaleBitmap, L_WindowLevel, L_WindowLevelBitmap, L_WindowLevelFillLUT
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

/* The following example loads a bitmap and applies the halftone pattern filter */
BITMAPHANDLE LeadBitmap;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Apply the filter*/
L_HalfTonePatternBitmap(&LeadBitmap, 100, 200, 12, 2, 4500, RGB(255,255,255), RGB(255,0,0), HTPATTERN_LINE);


L_HighPassFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HighPassFilterBitmap(pBitmap, uRadius, uOpacity)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uRadius; | /* radius of the neighborhood */
L_UINT uOpacity; | /* opacity */

Removes low frequency details in a bitmap, resulting in a sharpened image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the filter.
uRadius | Value greater than 0 that indicates the radius of the neighborhood on which the filter is applied, in pixels.
uOpacity | Value that represents the intensity of the effect. The valid range is from 0 to 100. At 100, only the object outlines remain.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This filter removes low-frequency detail in the bitmap. The effect is opposite to that of the Gaussian Blur filter (L_GaussianFilterBitmap).

To increase the thickness of the edges, increase the value of uRadius. Usually a low value for uRadius is better.

Unlike the L_UnsharpMaskBitmap function, when using this function image noise is not increased.

As an example, if you use the following image:

And you were to call L_HighPassFilterBitmap using the following settings:

Parameter | Value
uRadius | 6
uOpacity | 100

The following figure results:

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_SolarizeBitmap, L_WindowLevel, L_UnsharpMaskBitmap, L_GaussianFilterBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Sharpen image by applying the high pass filter*/
L_HighPassFilterBitmap(&LeadBitmap, 10, 100);


L_HistoContrastBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HistoContrastBitmap(pBitmap, nChange)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nChange; | /* amount of contrast change */

Increases or decreases the contrast of the image in a bitmap, using a histogram to determine the median brightness.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
nChange | Amount of contrast change. Valid values are -1000 to +1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_ChangeBitmapContrast function, which uses the middle possible value (128) rather than finding the actual median.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_DlgHistoContrast , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_GammaCorrectBitmapExt

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

/* This example loads a bitmap and increases its contrast. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Increase the contrast using the histogram by 25 percent of the possible range */
L_HistoContrastBitmap(&LeadBitmap, 250 );


L_HistoEqualizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HistoEqualizeBitmap(pBitmap, nFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFlag; | /* flag */

Linearizes the number of pixels, in a bitmap, based on the specified color space. This can be used to bring out the detail in dark areas of an image.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
nFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Previously this function 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 nFlag.

For the best results, set nFlag to YUV_SPACE.

This function can process the whole image or a region of the image.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies histogram equalization. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Histogram equalize the bitmap */
L_HistoEqualizeBitmap(&LeadBitmap, YUV_SPACE );


L_HolePunchRemoveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HolePunchRemoveBitmap(pBitmap, pHolePunch, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPHOLEPUNCH pHolePunch; | /* pointer to a structure */
HOLEPUNCHREMOVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Finds and removes hole punches. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap from which to remove hole punches.
pHolePunch | Pointer to the HOLEPUNCH structure that LEADTOOLS uses to remove hole punches.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in HOLEPUNCHREMOVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function detects and removes hole punches that are common in scanned documents. The behavior of this function can be modified by using its callback.

This function 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 function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | HOLEPUNCHREMOVECALLBACK, L_SmoothBitmap, L_LineRemoveBitmap, L_BorderRemoveBitmap, L_DotRemoveBitmap, L_InvertedTextBitmap, L_HolesRemovalBitmapRgn
Topics: | Cleaning Up 1-Bit Images

Example

//HolePunch Remove
//This example returns a windows region corresponding to hole punches
//For the example, a windows region is returned and converted to a LEAD region
//but in practice it would easier and faster to just return 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
//A callback is used to display information about each hole punch removed.
//The callback does NOT return a region

L_INT L_EXPORT EXT_CALLBACK ExampleHolePunchRemoveCB
(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iHoleIndex,
L_INT32 iHoleTotalCount,
L_INT32 iWhiteCount,
L_INT32 iBlackCount,
L_VOID L_FAR *pUserData
)
{
L_TCHAR szMsg[200];

wsprintf(
szMsg,
TEXT("Bounds[%d,%d][%d,%d]\tHole[%d] of [%d]\tWhiteCount[%d]\tBlackCount[%d]\n"),
pBoundingRect->left,
pBoundingRect->top,
pBoundingRect->right,
pBoundingRect->bottom,
iHoleIndex,
iHoleTotalCount,
iWhiteCount,
iBlackCount
);
OutputDebugString(szMsg);

return SUCCESS_REMOVE;
}

L_VOID ExampleHolePunchRemove(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
HOLEPUNCH hr;

hr.uStructSize = sizeof(HOLEPUNCH);
hr.iLocation = HOLEPUNCH_LEFT;
hr.iMinHoleCount = 2;
hr.iMaxHoleCount = 4;

hr.uFlags = HOLEPUNCH_SINGLE_REGION | HOLEPUNCH_USE_DPI | HOLEPUNCH_USE_COUNT | HOLEPUNCH_USE_LOCATION;

nRet = L_HolePunchRemoveBitmap(
pBitmap,
&hr,
(HOLEPUNCHREMOVECALLBACK)(ExampleHolePunchRemoveCB),
NULL
);

if (nRet == SUCCESS)
{
RECT rectRgn;

GetRgnBox(hr.hRgn, &rectRgn);
if (!IsRectEmpty(&rectRgn))
{
L_SetBitmapRgnHandle(pBitmap, NULL, hr.hRgn, L_RGN_SET);
DeleteObject(hr.hRgn);
hr.hRgn = NULL;
}
}
}


L_HolesRemovalBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_HolesRemovalBitmapRgn(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Removes all the holes in a region. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is designed to work on bitmaps that have a region. It removes the holes from the bitmap’s region. If this function is used with a bitmap that does not have a region, the "Invalid Parameter" error is returned.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_SetBitmapRgnMagicWand, L_SmoothBitmap, L_BorderRemoveBitmap, L_InvertedTextBitmap, L_DotRemoveBitmap, L_HolePunchRemoveBitmap
Topics: | Working with the Existing Bitmap Region
 | Raster Image Functions: Creating and Using a Region
 | Color Halftone and Halftone Images

Example

/* This example loads a bitmap, defines a region on it, and applies the holes removal filter */
BITMAPHANDLE LeadBitmap;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*put the predefined region*/
L_SetBitmapRgnHandle(&LeadBitmap,NULL, hRgn, L_RGN_SET);

/*Remove holes*/
L_HolesRemovalBitmapRgn (&LeadBitmap);


L_HSVtoRGB

#include "l_bitmap.h"

COLORREF EXT_FUNCTION L_HSVtoRGB(hsvColor)

HSVREF hsvColor;

/* HSV input value */

Returns a COLORREF value that is an equivalent representation of the specified HSV value.

Parameter | Description
hsvColor | The HSV input value.

Returns

A COLORREF that contains the RGB equivalent of the specified HSV value.

Comments

The HSV value is the Hue ,Saturation, Value color space. Traditionally, hue ranges from 0 to 359. However, the hue component of the HSVREF is represented by an unsigned byte. Therefore, 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 ranges from 0 to 255 where 0 means the highest amount of white and 255 means no white.

Value ranges from 0 to 255 where 0 means highest amount of black and 255 means no black.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RemapBitmapHue, L_SetBitmapRgnColorHSVRange, L_SetBitmapRgnColorRGBRange, L_RGBtoHSV, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Doing Color Space Conversion
 | Working with an Existing Bitmap Region
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Using Color Values in LEADTOOLS

Example

//This example takes displays the H,S,V value of a HSVREF
//and the equivalent RGB components
void ExampleHSVtoRGB(HSVREF hsvColor)
{
L_TCHAR szMsg[100];
COLORREF cr;

wsprintf(szMsg, TEXT("Hue[%d] Saturation[%d] Value[%d]\n"), hsvColor.uH, hsvColor.uS, hsvColor.uV);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);

cr = L_HSVtoRGB(hsvColor);

wsprintf(szMsg, TEXT("R[%d] G[%d] B[%d]\n"), GetRValue(cr), GetBValue(cr), GetGValue(cr));
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


L_IgnoreFilters

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_IgnoreFilters(pszFilters)

L_TCHAR L_FAR * pszFilters;

/* character string containing filters */

Specifies which file filters LEADTOOLS should NEVER load, even if present.

Parameter | Description
pszFilters | Character string containing which filters should be ignored and therefore not loaded. pszFilters has the same format as in L_PreLoadFilters .

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function 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 L_PreLoadFilters take priority over the files specified in L_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.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PreLoadFilters
Topics: | Raster Image Functions: Input/Output File Filters, Files To Be Included With Your Application

Example

This example tells LEADTOOLS not to load the CMP filter.

/* ignore CMP filter, never load CMP or JPEG files */
L_IgnoreFilters(TEXT("CMP"));


L_ImpressionistBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ImpressionistBitmap(pBitmap, uHorzDim, uVertDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uHorzDim; | /* horizontal size */
L_UINT uVertDim; | /* vertical size */

Makes a bitmap look like it was painted by an impressionist painter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uHorzDim | Horizontal effect size, in pixels. Possible values are range in between 1 and 100.
uVertDim | Vertical effect size, in pixels. Possible values are range in between 1 and 100.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgImpressionist , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply impressionist effect on the image*/
L_ImpressionistBitmap (&LeadBitmap, 10, 10);


L_InitBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InitBitmap(pBitmap, uStructSize, nWidth, nHeight, nBitsPerPixel)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle to initialize */
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */
L_INT nWidth; | /* width of the image in pixels */
L_INT nHeight; | /* height of the image in pixels */
L_INT nBitsPerPixel; | /* number of bits per pixel in the image */

Initializes the fields in a bitmap handle.

Parameter | Description
pBitmap | Pointer to the bitmap handle to initialize.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nWidth | Width of the image in pixels.
nHeight | Height of the image in pixels.
nBitsPerPixel | Number of bits per pixel in the image. Valid values are:
 | Value | Meaning
 | 1 | For a 1-bit image.
 | 2 | For a 2-bit image.
 | 3 | For a 3-bit image.
 | 4 | For a 4-bit image.
 | 5 | For a 5-bit image.
 | 6 | For a 6-bit image.
 | 7 | For a 7-bit image.
 | 8 | For an 8-bit image.
 | 12 | For a 12-bit image.
 | 16 | For a 16-bit image.
 | 24 | For a 24-bit image.
 | 32 | For a 32-bit image.
 | 48 | For a 48-bit image.
 | 64 | For a 64-bit image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This is a low-level function that is necessary only if you need to initialize the bitmap handle and allocate memory in separate steps when creating a bitmap from scratch. L_CreateBitmap is usually a better choice.

This function must be called before using L_AllocateBitmap. This function only initializes the fields in the bitmap handle; it does not allocate any memory. If all zeroes are passed as the nWidth, nHeight, and nBitsPerPixel into this function, then all fields in the bitmap handle will be set to 0. Otherwise, all fields will be set to zero except the fields listed below.

When this function is called, the following fields will be set:

Field | Value
Order | ORDER_RGB if you specify 8 bits per pixel or less; ORDER_GRAY for 12 or 16-bit grayscale; ORDER_BGR otherwise. ORDER_GRAY is valid only for 12 and 16-bit grayscale images and is only available in the Document/Medical Imaging editions . Please note that a 16-bpp image may be color or grayscale. If you are working with a 16-bit grayscale image, explicitly set BITMAPHANDLE.Order to ORDER_GRAY. By default, the order for a 16-bit image will be set to ORDER_BGR.
DitherMethod | Set by the L_DefaultDithering function
ViewPerspective | BOTTOM_LEFT [2]
Width | As passed into the function
Height | As passed into the function
BytesPerLine | Calculated using the specified width and bits per pixel, rounded on a 4-byte boundary
XResolution | 150
YResolution | 150

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | L_CreateBitmap, L_AllocateBitmap, L_FreeBitmap
Topics: | Raster Image Functions: Creating and Deleting Images

Example

For a short example, refer to L_ResizeBitmap. For complete sample code, refer to the RESIZE example.


L_InitICCHeader

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_InitICCHeader(pICCProfile)

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Initializes the ICC header with its default values.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure in which to initialize the header.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The header information is contained within the IccHeader member of the ICCPROFILEEXT structure. The ICCPROFILEECT should be initialized, by calling L_InitICCProfileExt, before calling this function. This function initializes the IccHeader member of the ICCPROFILEEXT structure with its default values. It must be called before filling any of the header fields. Once the header fields have been initialized, they can be set using the following functions:

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent

If this function is called after any of the functions listed above have been called, the header fields will be reinitialized to their default values, and the individually set values will be lost.

L_InitICCProfileExt should be called before calling L_InitICCHeader. If L_InitICCProfileExt is called after L_InitICCHeader, the default values set by L_InitICCHeader will be lost.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

/* This example, initializes an ICCPROFILEEXT structure, goes through all the steps of initializing and filling the fields of the header, creates some tags, generates ICC profile pointer, saves it into an ICC file, and then frees the ICCPROFILEEXT structure */
ICCPROFILEEXT iccProfile;
// Initialize the profile structure
L_InitICCProfileExt (&iccProfile, sizeof(ICCPROFILEEXT));
// Initialize the header
L_InitICCHeader(&iccProfile);
// Set the CMM type to zero
L_SetICCCMMType (&iccProfile, 0);
// Set the Device Class to Input Class
L_SetICCDeviceClass (&iccProfile, INPUTCLASS);
// Set the Color Space to RGB
L_SetICCColorSpace (&iccProfile, RGBDATA);
// Set the PCS to XYZ
L_SetICCConnectionSpace (&iccProfile, XYZDATA);
// Set the primary platform to zero
L_SetICCPrimaryPlatform (&iccProfile, 0);
// Set the profile flags into not embedded, and independent
L_SetICCFlags (&iccProfile, ICC_EMBEDDED_PROFILE_FALSE | ICC_USE_ANYWHERE);
// Set the device manufacturer signature to zero
L_SetICCDevManufacturer (&iccProfile, 0);
// Set the device model to 0
L_SetICCDevModel (&iccProfile, 0);
// Set the device attributes to be reflective, glossy, positive and colored media
L_SetICCDeciveAttributes(&iccProfile, ICC_REFLECTIVE | ICC_GLOSSY | ICC_MEDIA_POLARITY_POSITIVE | ICC_COLOR_MEDIA);
// Set the profile rendering intent
L_SetICCRenderingIntent (&iccProfile, PERCEPTUAL);
// Set the profile creator to 0
L_SetICCCreator (&iccProfile, 0);
// Free the ICCPROFILEEXT structure
L_FreeICCProfileExt (&iccProfile);


L_InitICCProfile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InitICCProfile(pICCProfile, nSize)

pMEMICCPROFILE pICCProfile; | /* pointer to a structure */
L_INT nSize; | /* size of the structure */

Initializes an MEMICCPROFILE structure.

Parameter | Description
pICCProfile | Pointer to the MEMICCPROFILE structure to initialize.
nSize | Value that indicates the size of the structure pointed to by pICCProfile. Pass sizeof(MEMICCPROFILE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

A MEMICCPROFILE structure must be initialized before loading an ICC profile. To initialize a MEMICCPROFILE structure, call L_InitICCProfile with the nSize parameter set to sizeof(MEMICCPROFILE).

When the MEMICCPROFILE structure is no longer needed, be sure to free the memory allocated by calling L_FreeICCProfile.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadICCProfile, L_FreeICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to L_FreeICCProfile.


L_InitICCProfileExt

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_InitICCProfileExt(pICCProfile, uStructSize)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UINT uStructSize; | /* size of a structure */

Initializes an ICCPROFILEEXT structure.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to initialize.
uStructSize | Value that indicates the size of the structure pointed to by pICCProfile. Pass sizeof(ICCPROFILEEXT).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The parameter pICCProfile must be allocated before sending it to the function.

An ICCPROFILEEXT structure must be initialized before loading an ICC Profile. To initialize an ICCPROFILEEXT structure, call L_InitICCProfileExt with the uStructSize parameter set to sizeof(MEMICCPROFILEEXT).

This function should be called before calling L_InitICCHeader. If this function is called after L_InitICCHeader, the default values set by L_InitICCHeader will be lost.

When the ICCPROFILEEXT structure is no longer needed, be sure to free the memory allocated by calling L_FreeICCProfileExt.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

/* This example initializes an ICC Profile, and then loads an ICC Profile from an Image, and after that it is freed */
ICCPROFILEEXT iccProfile;
// Initialize the ICCPROFILEEXT structure
L_InitICCProfileExt(&iccProfile, sizeof(ICCPROFILEEXT));
// Load an ICC Profile that is embedded in an image
L_LoadICCProfileExt (TEXT("image1.jpg"), &iccProfile, NULL);
// Fill the ICCPROFILEEXT structure with the ICC data loaded from the image
L_FillICCProfileStructure (&iccProfile, iccProfile.pData, iccProfile.uDataSize);
// Save the ICC Profile into another image
L_SaveICCProfile (TEXT("image2.jpg"), &iccProfile, NULL);
// Free the ICCPROFILEEXT structure
L_FreeICCProfileExt (&iccProfile);


L_InsertBitmapListItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InsertBitmapListItem(hList, uIndex, pBitmap)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uIndex; | /* position at which to insert the bitmap */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */

Inserts a bitmap handle into a list, or appends the bitmap handle to the end of the list.

Parameter | Description
hList | Handle to the list of bitmaps.
uIndex | Position in the list at which to insert the bitmap. Use (L_UINT)-1 to append the bitmap to the end of the list.
 | Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9. If you insert a bitmap within a list, the indexes of other bitmaps change to accommodate the insertion.
pBitmap | Pointer to the bitmap handle to insert.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After calling this function, the bitmap handle in the list references the original image data, not a copy. Therefore, you should not free the bitmap that you pass in, but should instead manage the memory using the related list functions (L_DeleteBitmapListItems and L_DestroyBitmapList).

You cannot use this function to update a bitmap list while it is being used in an animation playback. Refer to the L_AppendPlayback function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to L_CreateBitmapList.


L_InsertMarker

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InsertMarker(hMarkers, uIndex, uMarker, uMarkerSize, pMarkerData)

HANDLE hMarkers; | /* marker handle */
L_UINT uIndex; | /* position at which to insert the marker */
L_UINT uMarker; | /* marker’s type */
L_UINT uMarkerSize; | /* marker’s data size */
L_VOID L_FAR * pMarkerData; | /* marker’s data */

Inserts a marker in a marker collection.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function.
uIndex | Position in the list at which to insert the marker. Use 0xFFFFFFFF to append the marker to the end of the list. If there are fewer than uIndex markers in the collection, the marker will be appended to the end of the list.
 | Use zero-based indexing. For example, if there are 10 markers in a list, the index of the last one is 9. If you insert a marker within a list, the indexes of other markers change to accommodate the insertion.
uMarker | Value that represents the type of marker to insert. Recommended values are between 0xE0 and 0xFE. Other values are possible, but before using other values, study the JPEG specs to determine which markers are allowed.
uMarkerSize | The size of the marker data, in bytes. This must be between 0 and 0xFFFD.
pMarkerData | Pointer to the marker data. This parameter is needed only if uMarkerSize > 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You can insert a marker anywhere in the marker collection.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_EnumMarkers, L_GetMarkerCount, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

// Insert APP2 data at the end of the marker list
// The example assumes
// APP2_marker_size is the size of APP2 data
// APP2_marker_data points to the APP2 data

#define APP2 0xE2
HANDLE hMarkers;

L_InsertMarker(hMarkers, 0xFFFFFFFF, APP2, APP2_marker_size, APP2_marker_data);


L_IntensityDetectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_IntensityDetectBitmap(pBitmap, uLow, uHigh, crInColor, crOutColor, uChannel)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uLow; | /* lowest intensity to detect */
L_UINT uHigh; | /* highest intensity to detect */
COLORREF crInColor; | /* color used to fill the inner segment */
COLORREF crOutColor; | /* color used to fill the outer segment */
L_UINT uChannel; | /* channel to be processed */

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).

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
uLow | Lowest intensity to detect. Possible values range from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255..
uHigh | Highest intensity to detect. Possible values range from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.
crInColor | The color used to fill those pixels having an intensity value between uLow and uHigh. This parameter has no effect if the uChannel parameter is set to IDB_CHANNEL_MASTER. If for example the uChannel parameter is set to IDB_CHANNEL_RED, then the red component of crInColor will be used to fill the pixels having a red component value between uLow and uHigh.
crOutColor | The color used to fill those pixels having an intensity value less than uLow or greater than uHigh. This parameter has no effect if the uChannel parameter is IDB_CHANNEL_MASTER. If for example the uChannel parameter is set to IDB_CHANNEL_RED, then the red component of crOutColor will be used to fill the pixels having a red component value less than uLow or greater than uHigh.
uChannel | A value that indicates the channel to process. Possible values are:
 | Value | Meaning
 | IDB_CHANNEL_MASTER | [0x0000] Grayscale Channel.
 | IDB_CHANNEL_RED | [0x0001] Red Channel.
 | IDB_CHANNEL_GREEN | [0x0010] Green Channel.
 | IDB_CHANNEL_BLUE | [0x0100] Blue Channel.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The image is divided into two parts inner and outer according to the values of uLow and uHigh.

The function can process 2 or more channels at a time by OR-ing two or more flags.

The function can obtain the same result of the old L_IntensityDetectBitmap(pBitmap, uLow, uHigh) of version 13 and before by passing the following parameters:

L_IntensityDetectBitmap(pBitmap, uLow, uHigh, RGB(0, 0, 0), RGB(255, 255, 255), CHANNEL_RED | CHANNEL_GREEN | CHANNEL_BLUE);

This function also 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AutoBinaryBitmap, L_IntensityDetectBitmap, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgIntensityDetect , L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_HighPassFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and applies the filter on it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply the filter*/
L_IntensityDetectBitmap(&LeadBitmap, 128, 255, RGB(0, 0, 0), RGB(255, 255, 255), IDB_CHANNEL_MASTER);


L_InvertBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InvertBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Inverts the colors in the specified bitmap, making it like a photographic negative.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be converted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can also be used to invert the color of a 1-bit image, making the black white and the white black.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Modifying Intensity Values

Correcting Colors

Raster Image Functions: Correcting Colors

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and inverts it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Invert the colors of the bitmap */
L_InvertBitmap(&LeadBitmap);


L_InvertedTextBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_InvertedTextBitmap(pBitmap, pInvertedText, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPINVERTEDTEXT pInvertedText; | /* pointer to a structure */
INVERTEDTEXTCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Finds and modifies areas of inverted text in a 1-bit black and white image.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap in which to find inverted text.
pInvertedText | Pointer to the INVERTEDTEXT structure that LEADTOOLS uses to find and correct inverted text.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in INVERTEDTEXTCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function finds and modifies areas of inverted text that are common in scanned text documents. Below is an example of inverted text:

Modifying the area of inverted text yields the following:

The behavior of this function can be modified by using its callback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | INVERTEDTEXTCALLBACK, L_SmoothBitmap, L_LineRemoveBitmap, L_BorderRemoveBitmap, L_DotRemoveBitmap, L_HolePunchRemoveBitmap, L_HolesRemovalBitmapRgn
Topics: | Cleaning Up 1-Bit Images

Example

//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 callback is used to display additional information about the inverted text regions
//The callback does NOT return a region
//A LEAD region is returned by the function showing all of the changes

L_INT L_EXPORT EXT_CALLBACK ExampleInvertedTextCB
(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iWhiteCount,
L_INT32 iBlackCount,
L_VOID L_FAR *pUserData
)
{
L_TCHAR szMsg[200];

//Note: no hRgn to delete because it was not requested
wsprintf(
szMsg,
TEXT("Size[%dx%d]\tBounds[%d,%d][%d,%d]\tWhiteCount[%d]\tBlackCount[%d]\n"),
pBoundingRect->left,
pBoundingRect->top,
pBoundingRect->right,
pBoundingRect->bottom,
iWhiteCount,
iBlackCount);
OutputDebugString(szMsg);
return SUCCESS_REMOVE;
}

L_VOID ExampleInvertedText(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
BITMAPHANDLE BitmapRegion;
INVERTEDTEXT it;

memset(&BitmapRegion, 0, sizeof(BITMAPHANDLE));

it.uStructSize = sizeof(INVERTEDTEXT);

//Units are in thousandths of an inch
it.iMinInvertWidth = 5000;
it.iMinInvertHeight = 500;
it.iMinBlackPercent = 70;
it.iMaxBlackPercent = 95;
it.pBitmapRegion = &BitmapRegion;
it.uFlags = INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION | INVERTEDTEXT_USE_DPI;

nRet = L_InvertedTextBitmap(
pBitmap,
&it,
(INVERTEDTEXTCALLBACK)(ExampleInvertedTextCB),
NULL
);

if (nRet == SUCCESS)
{
RECT rectRgn;

//Delete the existing region
L_FreeBitmapRgn(pBitmap);

L_GetBitmapRgnBounds(it.pBitmapRegion, NULL, &rectRgn);
if (!IsRectEmpty(&rectRgn))
{
L_CopyBitmapHandle(pBitmap, it.pBitmapRegion, sizeof(BITMAPHANDLE));
}
}

}


L_IsGrayScaleBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_IsGrayScaleBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Returns an indicator that shows the kind of grayscale palette, if any, that a bitmap has.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to test.

Returns

GRAY_NO | [0] Not grayscale.
GRAY_ORDEREDNORMAL | [1] Normally ordered grayscale (dark to light).
GRAY_ORDEREDINVERSE | [2] Reverse ordered grayscale (light to dark).
GRAY_NOTORDERED | [3] Unordered grayscale.

Comments

Grayscale images can be 1-bit, 4-bit, 8-bit, 12-bit or 16-bit. With a 1-bit image, you can use this function to check for inversion (for example, white lines on a black background) caused by an inverted palette.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GrayScaleBitmap
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftone and Halftone Images

Example

/* Use L_IsGrayScaleBitmap to decide how to save an image */
L_INT nRet; /* Return value */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("TEST2.TGA"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* See if the bitmap is grayscale */
nRet = L_IsGrayScaleBitmap(&LeadBitmap);
/* Save 24-bit CMP for color, or 8-bit CMP for grayscale */
if (nRet == GRAY_NO)
L_SaveBitmap(TEXT("TEST.CMP"), &LeadBitmap, FILE_CMP, 24, QS, NULL);
else
L_SaveBitmap(TEXT("TEST.CMP"), &LeadBitmap, FILE_CMP, 8, QS, NULL);


L_ISISAcquire

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISAcquire(hWnd, pBitmap, uStructSize, uFlags)

HWND hWnd; | /* window handle */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_UINT32 uFlags; | /* option flags */

Loads a bitmap with a scanned image from the specified ISIS device. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle of the parent window.
pBitmap | Pointer to the bitmap handle that references the bitmap to be loaded.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
uFlags | Option flags. Valid values are:
 | Value | Meaning
 | ISIS_SHOWUI | [0x0001] Enable the ISIS user interface.
 | NULL | [0x0000] Do not show user interface.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If uFlags is not set, the ISIS user interface will not be activated and the function will only scan the image, using the current scanner driver tags.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISAcquireMulti
Topics: | Raster Image Functions: Scanning Images using ISIS,
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

BITMAPHANDLE Bitmap;
HWND hWndFrame;

L_VOID ISISAcquire(L_VOID)
{
L_INT nRet;

nRet = L_ISISLoadDriver(NULL);/* load current driver */
if (nRet == SUCCESS)
{
nRet = L_ISISAcquire (hWndFrame,
&Bitmap, sizeof(BITMAPHANDLE),
ISIS_SHOWUI);
L_ISISUnloadDriver();
}
return;
}


L_ISISAcquireMulti

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISAcquireMulti(hWnd, pszBaseFileName, uFlags, nFormat, bMultiPageFile, pnPagesDiscarded, pfnCallback, pUserData)

HWND hWnd; | /* window handle */
L_CHAR L_FAR * pszBaseFileName; | /* base string */
L_UINT32 uFlags; | /* option flags */
L_INT nFormat; | /* format type */
L_BOOL bMultiPageFile; | /* flag */
L_INT L_FAR *pnPagesDiscarded; | /* pointer to an integer */
ISISCALLBACK pfnCallback; | /* pointer to a callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Starts a multi-page ISIS scan. Each page will be saved in the specified format in either a multi-page file, or as individual files. This function is available in the Document/Medical Toolkits.

Parameter

Description

hWnd

Handle of the parent window.

pszBaseFileName

Character string containing the base string from which page names will be generated.

uFlags

Option flags. Valid values are:

Value

Meaning

ISIS_SHOWUI

[0x0001] Shows the ISIS UI.

ISIS_MULTI_NOSAVE

[0x0002] Do not save data to file.

NULL

[0x0000] Do not show user interface.

nFormat

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 short tag 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 nFormat 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 nFormat 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 nFormat 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 nFormat 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 nFormat 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.

bMultiPageFile

Flag that indicates whether to save as a multi-page file, or as individual files for each page.

pnPagesDiscarded

Pointer to an integer that holds the number of pages discarded if scanning were canceled while ScanAhead was enabled.

pfnCallback

Optional callback function for additional processing.

If you do not provide a callback function, use NULL as the value of this parameter.

If you do provide a callback function, use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in ISISCALLBACK Function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If bMultiPageFile is TRUE, the scanned pages will be saved as pages in a multi-page file. If bMultiPageFile is FALSE, each scanned page will be saved to an individual file. Filenames are created by concatenating the string in pszBaseFileName with the page number. 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).

You must supply a callback function in pfnCallback in order to process the images as they are scanned, instead of, or in addition to, saving them to file(s).

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISAcquire
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

/* global variables */
L_BOOL fKillProgress;
L_BOOL fInTwain;
HINSTANCE hInst;
HWND hWndFrame;

/* ISISCALLBACK function declaration */
L_INT L_EXPORT ISISCallBack( pBITMAPHANDLE pBitmap, L_INT32 nPage, L_CHAR L_FAR* pszFilename, L_VOID L_FAR * pUserData );

static L_VOID ISISAcquireMulti(L_VOID)
{
L_CHAR buf[2*_MAX_PATH];
HCURSOR hCursor;
HMENU hMenu;
L_INT nRet;
L_INT nSaveFormat;
static OPENFILENAME OpenFileName;
static L_CHAR szFileName[_MAX_PATH] = "";
static L_BOOL bSaveMulti = TRUE;
FILESAVEPARM ISISFSParm;
L_INT nMaxPages=1;
L_INT nPagesDiscarded;
FILESAVEFORMAT Formats[1];

OpenFileName.lStructSize       = sizeof(OPENFILENAME);
OpenFileName.lpstrInitialDir   = NULL;
OpenFileName.lpstrTitle        = "Select Base Filename";
OpenFileName.nFilterIndex      = 0;

OpenFileName.lpstrFile         = szFileName;
OpenFileName.nMaxFile          = sizeof(szFileName);
OpenFileName.lpstrFileTitle    = ISISFSParm.szFileName;
OpenFileName.nMaxFileTitle     = sizeof(ISISFSParm.szFileName);

OpenFileName.Flags             = 0;

ISISFSParm.uSaveMulti = bSaveMulti;

/* add some formats */
Formats[0].nFormat     = FS_LEAD24;
Formats[0].uSubFormats = 0;   /* get the name of the file(s) to save */

nRet = L_DlgSave
 ( hWndFrame,
&OpenFileName,
&ISISFSParm,
DLG_FS_MULTIPAGE,
(FILESAVEFORMAT L_FAR*)&Formats,
nSaveFormat,
NULL, NULL );

if(nRet != SUCCESS)
return;

bSaveMulti = ISISFSParm.uSaveMulti;
nSaveFormat = ISISFSParm.nFormat;

hCursor = SetCursor (LoadCursor (NULL, IDC_WAIT));
hMenu = GetSystemMenu (hWndFrame, FALSE);
EnableMenuItem (hMenu, SC_CLOSE, FALSE);
fInTwain = TRUE;

nRet = L_ISISLoadDriver(NULL);

if(nRet == SUCCESS)
{
/* let's set the ScanAhead to 1/2 the max. # of pages the ADF can hold for SPEED */
nRet = L_ISISSetTagShort(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
if(nRet == SUCCESS)
{
nRet=L_ISISGetTagShort(TAG_MAXPAGES, &nMaxPages);
nRet=L_ISISSetTagShort(TAG_SCANAHEAD_MAXPAGES, (L_INT)(nMaxPages/2));
}

/* try setting scanner compression to match file output type */
switch(nSaveFormat)
{
case FILE_CCITT:
nRet=L_ISISSetTagShort (TAG_COMPRESSION, TAG_COMPRESSION_MG3);
break;
case FILE_CCITT_GROUP3_1DIM:
nRet=L_ISISSetTagShort(TAG_COMPRESSION, TAG_COMPRESSION_G3);
break;
case FILE_CCITT_GROUP4:
nRet=L_ISISSetTagShort(TAG_COMPRESSION, TAG_COMPRESSION_G4);
break;
case FILE_TIFLZW:
nRet=L_ISISSetTagShort(TAG_COMPRESSION, TAG_COMPRESSION_LZW);
break;
case FILE_TIF_PACKBITS:
nRet=L_ISISSetTagShort(TAG_COMPRESSION, TAG_COMPRESSION_32771);
break;
default:
nRet=L_ISISSetTagShort(TAG_COMPRESSION, TAG_COMPRESSION_NONE);
break;
}

nRet = L_ISISAcquireMulti (hWndFrame,
szFileName,
ISIS_SHOWUI,
nSaveFormat,
bSaveMulti,
&nPagesDiscarded,
ISISCallBack,
NULL);
L_ISISUnloadDriver();
}
EnableMenuItem (hMenu, SC_CLOSE, TRUE);
fInTwain = FALSE;
SetCursor (hCursor);
if (nRet == ERROR_USER_ABORT)
{
wsprintf(buf, "Scanning canceled; %d pages ScannedAhead but aborted!", nPagesDiscarded );
MessageBox(hWndFrame, buf, "ISIS Acquire Multi", MB_OK);
wsprintf(buf, "Image(s) acquired to file(s): %s", szFileName);
MessageBox(hWndFrame, buf, "ISIS Acquire Multi", MB_OK);
}
else if (nRet != SUCCESS)
L_FileError (hWndFrame, nRet, "ISIS Acquire Multi", "");
else
{
wsprintf(buf, "Image(s) acquired to file(s): %s", szFileName);
MessageBox(hWndFrame, buf, "ISIS Acquire Multi", MB_OK);
}
return;
}

L_INT L_EXPORT ISISCallBack( pBITMAPHANDLE pBitmap, L_INT32 nPage, L_CHAR L_FAR* pszFilename, L_VOID L_FAR * pUserData )
{
UNREFERENCED_PARAMETER(pBitmap);
MSG msg;

while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_KEYDOWN)
{
if(msg.wParam == VK_ESCAPE)
{
fKillProgress = TRUE;
MessageBox(NULL, "ISIS Scanning Canceled!", "Stop", MB_OK);
}
}
TranslateMessage (&msg);
DispatchMessage (&msg);
}

if (fKillProgress)
return (ERROR_USER_ABORT);
else
return (SUCCESS);
}


L_ISISGetTagASCII

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagASCII(uTag, pszValue, puSize, bDefault)

L_UINT uTag; | /* ASCII tag */
L_CHAR L_FAR *pszValue; | /* character string */
L_UINT32 L_FAR *puSize; | /* size of the string */
L_BOOL bDefault; | /* flag */

Gets the current or default value for an ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag for which to get the current or default value. For a list of possible tags, refer to ISIS ASCII tags
pszValue | Character string to be updated with the current or default tag value.
puSize | Pointer to a variable that contains the size of the string. If pszValue is NULL, then puSize will be updated with the required size of the string for the specified tag value.
bDefault | Flag that indicates whether to get the default or current value. Possible values are:
 | Value | Meaning
 | TRUE | Get the scanner's default value for the specified tag.
 | FALSE | Get the scanner's current value for the specified tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Set bDefault to TRUE to query the driver for its default value. Set it to FALSE to get the driver's current setting.

The user is responsible for allocating storage for pszValue and for freeing that memory when pszValue is no longer needed.

To determine the size of the value string, call this function with uTag set to the desired tag and pszValue set to NULL. The puSize parameter will be updated with the necessary size. Using the value in puSize, allocate a string of that size. Then, call this function again, with the desired tag in uTag, the correct size in the puSize parameter, a valid pointer to the allocated string, and the proper flag setting and pszValue will be updated with the value string.

If a valid pointer is passed for the pszValue parameter, then puSize must contain the correct size for the string pointed to by pszValue.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISSetTagASCII, L_ISISGetTagASCIIChoice, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to L_ISISSetTagASCII.


L_ISISGetTagASCIIChoice

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagASCIIChoice(uTag, nIndex, pszValue, puSize)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_CHAR L_FAR *pszValue; | /* character string */
L_UINT32 L_FAR *puSize; | /* size of the string */

Gets the number of possible values (or choices), or gets the value at the specified index, for the specified ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag for which to get the specified value, or the number of possible values. For a list of possible tags, refer to ISIS ASCII tags.
nIndex | Index into an array of possible values (or choices) for the specified ASCII tag. This value must be between 0 and the maximum number of values/choices - 1. Pass ISIS_DEFAULT to update puSize with the maximum number of available values/choices for the specified tag.
pszValue | Character string to be updated with the value at the specified index.
puSize | Pointer to a variable that contains the size of the string. If pszValue is NULL, then puSize will be updated with the required size of the string for the specified tag value.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

ISIS tags can have multiple values, also called choices. This function can be used to get the maximum number of available values/choices, or to get individual values.

To get the maximum number of available values/choices, pass ISIS_DEFAULT for nIndex. The puSize parameter will be updated with the number of available values/choices.

The user is responsible for allocating storage for pszValue and for freeing that memory when pszValue is no longer needed.

To determine the size of the value string, call this function with pszValue set to NULL and nIndex set to the desired value. The puSize parameter will be updated with the necessary size. Then, call this function again, with the correct size in the puSize parameter and pszValue will be updated with the value string.

If a valid pointer is passed for the pszValue parameter, then puSize must contain the correct size for the string pointed to by pszValue.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagASCII, L_ISISSetTagASCII, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_UINT32 uSize;
L_UINT32 uCount;
L_UINT32 x;
L_CHAR L_FAR* pszValue=NULL;
L_CHAR szBuf[400];
L_INT nRet;

//First, get the number of choices
nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, ISIS_DEFAULT, NULL, &uCount);
if(nRet == SUCCESS)
{
//get and display each choice
wsprintf(szBuf, "There are %u choices\n", uCount);
MessageBox(NULL, szBuf, "Count", MB_OK);
for(x=0; x<uCount; x++)
{
//get size of the choice string
nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, x, NULL, &uSize);
if(nRet == SUCCESS && uSize>0)
{
//allocate memory for the string
pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
//get the value
nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, x, pszValue, &uSize);
wsprintf(szBuf, "Choice: %u has Value: %s\n", x, pszValue);
MessageBox(NULL, szBuf, "Value", MB_OK);
//free the string
GlobalFreePtr(pszValue);
}
}
}


L_ISISGetTagLong

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagLong(uTag, plValue)

L_UINT uTag; | /* long tag */
L_INT32 L_FAR *plValue; | /* pointer to an integer */

Gets the current value for an ISIS Scanner Driver Long Tag.

This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag whose value you want to retrieve. For a list of possible tags, refer to ISIS long tags
plValue | Pointer to an L_INT32 value that receives the current tag value.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Set the value pointed to by plValue to ISIS_DEFAULT to query the driver for its default value. Set it to any other value to get the driver's current setting.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISSetTagLong, L_ISISGetTagShort, L_ISISGetTagLongChoice, L_ISISGetTagShortChoice, L_ISISSetTagShort
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the DEMO example.

/* get the current setting for ISIS scan width */
L_INT32 lWidth;

L_ISISGetTagLong(TAG_IMAGEWIDTH, &lWidth);


L_ISISGetTagLongChoice

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagLongChoice(uTag, nIndex, plValue)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_INT32 L_FAR *plValue; | /* pointer to a variable */

Gets the number of possible values (or choices), or gets the value at the specified index, for the specified ISIS Scanner Driver Long Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag for which to get the specified value, or the number of possible values. For a list of possible tags, refer to ISIS Long tags.
nIndex | Index into an array of possible values (or choices) for the specified long tag. This value must be between 0 and the maximum number of values/choices - 1. Pass ISIS_DEFAULT to update plValue with the maximum number of available values/choices for the specified tag.
plValue | Pointer to a variable to be updated with the value at the specified index. If nIndex is ISIS_DEFAULT, this parameter will be updated with the maximum number of available values/choices for the specified tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

ISIS tags can have multiple values, also called choices. This function can be used to get the maximum number of available values/choices, or to get individual values.

To get the maximum number of available values/choices, pass ISIS_DEFAULT for nIndex. The plValue parameter will be updated with the number of available values/choices.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice, L_ISISGetTagASCII, L_ISISGetTagASCIIChoice, L_ISISSetTagASCII
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_INT32 lValue;
L_INT32 lCount;
L_INT32 x;
L_CHAR szBuf[400];
L_INT nRet;

//First, get the number of choices
nRet = L_ISISGetTagLongChoice(TAG_IMAGEWIDTH, ISIS_DEFAULT, &lCount);
if(nRet == SUCCESS)
{
//get and display each choice
wsprintf(szBuf, "There are %d choices\n", lCount);
// ::MessageBox(NULL, szBuf, "Count", MB_OK);
OutputDebugString(szBuf);
for(x=0; x<lCount; x++)
{
//get the value
nRet = L_ISISGetTagLongChoice(TAG_IMAGEWIDTH, x, &lValue);
wsprintf(szBuf, "Choice: %d has Value: %d\n", x, lValue);
// ::MessageBox(NULL, szBuf, "Value", MB_OK);
OutputDebugString(szBuf);
}
}


L_ISISGetTagShort

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagShort(uTag, pnValue)

L_UINT uTag; | /* short tag */
L_INT L_FAR*pnValue; | /* pointer to an integer */

Gets the current value for an ISIS Scanner Driver Short Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag whose value you want to retrieve. For a list of possible tags, refer to ISIS short tags
pnValue | Pointer to an L_INT that receives the current value of the tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Set the value pointed to by pnValue to ISIS_DEFAULT to query the driver for its default value. Set it to any other value to get the driver's current setting.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISSetTagShort, L_ISISGetTagLong, L_ISISGetTagShortChoice, L_ISISGetTagLongChoice, L_ISISSetTagLong
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the DEMO example.

For an example, refer to L_ISISAcquireMulti.


L_ISISGetTagShortChoice

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagShortChoice(uTag, nIndex, pnValue)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_INT L_FAR *pnValue; | /* pointer to a variable */

Gets the number of possible values (or choices), or gets the value at the specified index, for the specified ISIS Scanner Driver Short Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag for which to get the specified value, or the number of possible values. For a list of possible tags, refer to ISIS Short tags.
nIndex | Index into an array of possible values (or choices) for the specified short tag. This value must be between 0 and the maximum number of values/choices - 1. Pass ISIS_DEFAULT to update pnValue with the maximum number of available values/choices for the specified tag.
pnValue | Pointer to a variable to be updated with the value at the specified index. If nIndex is ISIS_DEFAULT, this parameter will be updated with the maximum number of available values/choices for the specified tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

ISIS tags can have multiple values, also called choices. This function can be used to get the maximum number of available values/choices, or to get individual values.

To get the maximum number of available values/choices, pass ISIS_DEFAULT for nIndex. The pnValue parameter will be updated with the number of available values/choices.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagASCII, L_ISISGetTagASCIIChoice, L_ISISSetTagASCII
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_INT nValue;
L_INT nCount;
L_INT x;
L_CHAR szBuf[400];
L_INT nRet;

//First, get the number of choices
nRet = L_ISISGetTagShortChoice(TAG_BRIGHTNESS, ISIS_DEFAULT, &nCount);
if(nRet == SUCCESS)
{
//get and display each choice
wsprintf(szBuf, "There are %d choices\n", nCount);
MessageBox(NULL, szBuf, "Count", MB_OK);
for(x=0; x<nCount; x++)
{
//get the value
nRet = L_ISISGetTagShortChoice(TAG_BRIGHTNESS, x, &nValue);
wsprintf(szBuf, "Choice: %d has Value: %d\n", x, nValue);
MessageBox(NULL, szBuf, "Value", MB_OK);
}
}


L_IsISISAvailable

#include "l_bitmap.h"
#include "ltisi.h"

L_BOOL EXT_FUNCTION L_IsISISAvailable(void)

Determines if the ISIS support dlls are installed. This function is available in the Document/Medical Toolkits.

Returns

TRUE | ISIS support dll's are installed.
FALSE | ISIS support dll's are not installed

Comments

Note: This function 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.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISSelect
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

L_BOOL bISIS;

/* is ISIS installed? */
bISIS = L_IsISISAvailable();


L_ISISLoadDriver

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISLoadDriver(pszDriverName)

L_CHAR L_FAR pszDriverName;

/* driver name */

Loads the ISIS Scanner Driver. This function is available in the Document/Medical Toolkits.

Parameter | Description
pszDriverName | Character string containing the name of the ISIS Scanner Driver to load. If you pass NULL for this parameter, the currently selected driver will be loaded.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call this function before calling L_ISISAcquire, L_ISISAcquireMulti, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagShort or L_ISISSetTagShort.

When you are finished with ISIS support, you must call L_ISISUnloadDriver.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISUnloadDriver, L_ISISAcquire, L_ISISAcquireMulti, L_ISISGetTagLong, L_ISISGetTagShort, L_ISISSetTagLong, L_ISISSetTagShort
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to L_ISISAcquire.

For complete sample code, refer to DEMO example.


L_ISISSelect

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSelect(hWnd, pszCurScanDriver)

HWND hWnd; | /* window handle */
L_CHAR L_FAR pszCurScanDriver; | /* driver name */

Brings up the ISIS Scanner Select dialog box to allow the user to select and/or add ISIS Scanner Drivers. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle of the parent window.
pszCurScanDriver | Character string containing the current selected scanner driver name. The string must be at least 255 characters in size.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Pass hWnd = NULL to determine the current selected driver without showing the Select dialog box.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_IsISISAvailable
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to DEMO example.

L_CHAR szDriverName[255]="\0";
HWND hWnd;

L_ISISSelect(hWnd, szDriverName);


L_ISISSetScanOptions

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSetScanOptions(hWnd)

HWND hWnd;

/* window handle */

Brings up the scan options dialog box. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle of the parent window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call L_ISISLoadDriver before you can use this function to set scanner options.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISAcquire, L_ISISAcquireMulti, L_ISISGetTagLong, L_ISISGetTagShort, L_IsISISAvailable, L_ISISLoadDriver, L_ISISSelect, L_ISISSetTagLong, L_ISISSetTagShort, L_ISISUnloadDriver
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to DEMO example.

HWND hWnd;
L_ISISLoadDriver(NULL);
L_ISISSetScanOptions(hWnd); /* set scan options */
/* do a scan here */
L_ISISUnloadDriver();


L_ISISSetTagASCII

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSetTagASCII(uTag, pszValue)

L_UINT uTag; | /* ASCII tag */
L_CHAR L_FAR * pszValue; | /* new value */

Sets the new value for an ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag for which to set the value. For a list of possible tags, refer to ISIS ASCII tags
pszValue | Value used to set the tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If L_ISISSetTagASCII is not called, the scanner's defaults will be used.

When setting tags, the tags must be set in the following order:

TAG_PAGESIZE

TAG_XRESOLUTION

TAG_YRESOLUTION

TAG_XPOSITION

TAG_YPOSITION

TAG_IMAGELENGTH

TAG_IMAGEWIDTH

Please note that TAG_XRESOLUTION, TAG_YRESOLUTION, TAG_XPOSITION, TAG_YPOSITION, TAG_IMAGELENGTH and TAG_IMAGEWIDTH are long tags and must be set using L_ISISSetTagLong.

Set pszValue to NULL to use the scanner's default setting for uTag.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagASCII, L_ISISGetTagASCIIChoice, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_INT nRet;
L_UINT32 uSize;
L_CHAR L_FAR* pszValue=NULL;
L_CHAR szBuf[400];

//get size of the string for the default value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, TRUE);
if(nRet==SUCCESS && uSize>0)
{
//allocate memory for the string
pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
//get the value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, TRUE);
wsprintf(szBuf, "Default Value: %s\n", pszValue);
MessageBox(NULL, szBuf, "Default Value", MB_OK);
//free the string
GlobalFreePtr(pszValue);
pszValue=NULL;
}

//get size of the string for the current value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, FALSE);
if(nRet==SUCCESS && uSize>0)
{
//allocate memory for the string
pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
//get the value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, FALSE);
wsprintf(szBuf, "Current Value: %s\n", pszValue);
MessageBox(NULL, szBuf, "Current Value", MB_OK);
//free the string
GlobalFreePtr(pszValue);
pszValue=NULL;
}

//set a new value
//NOTE, you would have to use L_ISISGetTagASCIIChoice to
// get a valid value before calling this function!!
nRet = L_ISISSetTagASCII(TAG_PAGESIZE, "Scanner's Maximum");

//now, re-get the current value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, NULL, &uSize, FALSE);
if(nRet==SUCCESS && uSize>0)
{
//allocate memory for the string
pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
//get the value
nRet = L_ISISGetTagASCII(TAG_PAGESIZE, pszValue, &uSize, FALSE);
wsprintf(szBuf, "Current Value: %s\n", pszValue);
MessageBox(NULL, szBuf, "Current Value", MB_OK);
//free the string
GlobalFreePtr(pszValue);
pszValue=NULL;
}


L_ISISSetTagLong

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSetTagLong(uTag, lValue)

L_UINT uTag; | /* long tag */
L_INT32 lValue; | /* new value */

Sets the new value for an ISIS Scanner Driver Long Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag whose value you want to set. For a list of possible tags, refer to ISIS long tags
lValue | Value used to set the tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If L_ISISSetTagLong is not called, the scanner's defaults will be used.

When setting long tags, the tags must be set in the following order:

TAG_XRESOLUTION

TAG_YRESOLUTION

TAG_XPOSITION

TAG_YPOSITION

TAG_IMAGELENGTH

TAG_IMAGEWIDTH

Set lValue to ISIS_DEFAULT to use the scanner's default setting for uTag.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagLong, L_ISISGetTagShort, L_ISISGetTagLongChoice, L_ISISGetTagShortChoice, L_ISISSetTagShort
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the DEMO example.

/* set the ISIS scan width to 1000 pixels */
L_ISISSetTagLong(TAG_IMAGEWIDTH, 1000);


L_ISISSetTagShort

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISSetTagShort(uTag, nValue)

L_UINT uTag; | /* short tag */
L_INT nValue; | /* new value */

Sets the new value for an ISIS Scanner Driver Short Tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
uTag | Value indicating the tag whose value you want to set. For a list of possible tags, refer to ISIS short tags
nValue | Value used to set the tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When determining the color format, tags must be set in the following order:

TAG_SAMPLESPERPIXEL

TAG_BITSPERSAMPLE

TAG_COMPRESSION

Set nValue to ISIS_DEFAULT to use the scanner's default setting for uTag.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISGetTagShort, L_ISISGetTagLong, L_ISISGetTagShortChoice, L_ISISGetTagLongChoice, L_ISISSetTagLong
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For complete sample code, refer to the DEMO example.

For an example, refer to L_ISISAcquireMulti.


L_ISISUnloadDriver

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISUnloadDriver(void)

Unloads the ISIS Scanner Driver. This function is available in the Document/Medical Toolkits.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call this function if you successfully loaded a ISIS scanner driver using L_ISISLoadDriver.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ISISLoadDriver,
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to L_ISISAcquire.

For complete sample code, refer to DEMO example.


L_IsPtInBitmapRgn

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_IsPtInBitmapRgn(pBitmap, nRow, nCol)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */

Determines whether the specified pixel is in the bitmap region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
nRow | The row number of the pixel.
nCol | The column number of the pixel.

Returns

TRUE | The specified pixel is in the region.
FALSE | The specified pixel is outside the region.

Comments

This function uses bitmap coordinates to specify the pixel. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_BitmapHasRgn, L_FreeBitmapRgn, L_GetBitmapRgnArea
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For complete sample code, refer to the DRAW example.

/****************************************************************************************
This example tests whether the current mouse position is in the bitmap region.
The example includes sections from a program’s message-processing function.
The sample code uses the following global variables: */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_INT DisplayWidth, DisplayHeight; /* Dimensions of the displayed image */
L_INT DisplayLeft, DisplayTop; /* Origin of the displayed image */
/* TestFunction(), which is used in this example, can be copied from the example for L_SetBitmapRgnEllipse.
*****************************************************************************************/
L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,
LPARAM lParam)
{

L_INT BitmapX, BitmapY; /* Mouse position in bitmap coordinates */
switch (Message)
{
case WM_CREATE:
/* Load the bitmap and create the region */
TestFunction(hWnd);

case WM_RBUTTONDOWN:
/* Translate mouse positions to bitmap coordinates */
BitmapX = LOWORD(lParam) * BITMAPWIDTH(&LeadBitmap) / (DisplayWidth - DisplayLeft);
BitmapY = HIWORD(lParam) * BITMAPHEIGHT(&LeadBitmap) / (DisplayHeight - DisplayTop);
/* Adjust for view perspective */
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &BitmapX, &BitmapY );
/* Display a message if the point is in the region */
if (L_IsPtInBitmapRgn(&LeadBitmap, BitmapY, BitmapX))
MessageBox (NULL, TEXT("Point is in region"), TEXT("Notice"), MB_OK);

}
return (0);

}


L_IsRegMarkBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_IsRegMarkBitmap (pBitmap, uType, uMinScale, uMaxScale, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle to be searched */
L_UINT uType; | /* registration mark’s type */
L_UINT uMinScale; | /* minimum scaling factor of marks to be detected */
L_UINT uMaxScale; | /* maximum scaling factor of marks to be detected */
L_UINT uWidth; | /* registration mark’s width */
L_UINT uHeight; | /* registration mark’s height */

Determines if the object inside the bitmap is a registration mark or not. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be searched for registration mark.
uType | 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). See the Comments for more information. More shapes will be added in the future.
uMinScale | Minimum scaling factor of mark to be detected. This is a percentage. It must not exceed uMaxScale, or an error will be returned.
uMaxScale | Maximum scaling factor of mark to be detected. This is a percentage. It must not be lower than uMinScale, or an error will be returned.
uWidth | The width of the registration mark (in pixels).
uHeight | The height of the registration mark (in pixels).

Returns

SUCCESS | The object is a registration mark.
0 | The object is not registrations mark.
< 0 | An error occurred. Refer to Return Codes.

Comments

This function 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 uType 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 uWidth, uHeight, uMaxScale, and uMinScale.

Do not use this function to search for registration marks inside a bitmap. Use L_SearchRegMarksBitmap instead.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_RotateBitmap, L_SizeBitmap, L_ResizeBitmap, L_GetTransformationParameters, L_SearchRegMarksBitmap, L_GetMarksCenterMassBitmap.
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

/* This example loads a bitmap and determines if the object is a registration mark */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_INT nRet;
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* check */
nRet = L_IsRegMarkBitmap (&LeadBitmap, RGS_T, 90, 110, 31, 29);
if(nRet == SUCCESS)
{
//it is a registration mark
}


L_IsSupportLocked

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_IsSupportLocked(uType)

L_UINT uType;

/* optional feature to check */

Indicates whether support is locked for an optional feature, such as GIF file support or LEADTOOLS Document/Medical capabilities.

Parameter | Description
uType | The optional feature to check. For a list of possible values, refer to the uType parameter of the L_UnlockSupport function.

Returns

TRUE | The optional feature is locked.
FALSE | The optional feature is available in your toolkit.

Comments

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

To unlock a feature, use the L_UnlockSupport function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_UnlockSupport, L_VersionInfo

Example

For an example, refer to L_SetDisplayMode.


L_LensFlareBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LensFlareBitmap(pBitmap, ptCenter, uBright, uFlag, crColor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT ptCenter; | /* effect center point */
L_UINT uBright; | /* brightness factor */
L_UINT uFlag; | /* flag */
COLORREF crColor; | /* color value */

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. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
ptCenter | POINT structure that contains the point around which the effect is centered.
uBright | 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.
uFlag | 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.
crColor | The COLORREF value that represents the color of the main flare.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Secondary reflections are caused when bright lights are facing the camera lens. These reflections can show up as spots or banding. The function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

ptCenter = (150, 162);
uBright = 100;
uFlag = LNS_TYPE_1;
crColor = RGB(255,128,0);

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_GlowFilterBitmap, L_GlassEffectBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Raster Image Functions: Modifying Intensity Values

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT ptCenter; /*Effect center point*/

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Set the center point in the middle of the first square */
ptCenter.x = LeadBitmap.Width/4;
ptCenter.y = LeadBitmap.Height/4;

/* Apply the lens flare effect to the bitmap*/
L_LensFlareBitmap(&LeadBitmap, ptCenter, 100, LNS_TYPE_1, RGB(100, 150, 10));


L_LightBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LightBitmap(pBitmap, pLightInfo, uLightNo, uBright, uAmbient, crAmbientClr)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPLIGHTINFO pLightInfo; | /* array of light sources information */
L_UINT uLightNo; | /* number of light sources */
L_UINT uBright; | /* image intensity */
L_UINT uAmbient; | /* ambient intensity */
COLORREF crAmbientClr; | /* ambient color */

Adds many spots of directed light sources to the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pLightInfo | Pointer to an array of LIGHTINFO structures that contains information on each light source.
uLightNo | The number of light sources.
uBright | 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.
uAmbient | Factor used when mixing the ambient color with the image.
crAmbientClr | The COLORREF value that specifies the ambient color of the light sources in the pLightInfo array.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The pLIGHTINFO->uStructSize must be set to sizeof(LIGHTINFO) before calling this function. For an array of structures, only the first structure in the array needs to have uStructSize member set.

Support for 12- and 16-bit grayscale images are available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

pLightInfo:
{
ptCenter = (pBitmap->Width/2, pBitmap->Height/2);
uWidth = pBitmap->Width;
uHeight = pBitmap->Width * 4/3;
nAngle = 13500;
uBright = 100;
uEdge = 75;
crFill = RGB(0,0,255);
uOpacity = 100;
uFlag = LGT_SPOTLIGHT;
}

uLightNo = 1;
uBright = 100;
uAmbient = 100;
crAmbientClr = RGB(255,255,0);

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_GlowFilterBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Raster Image Functions: Modifying Intensity Values

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
LIGHTINFO LightInfo;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

LightInfo.uStructSize = sizeof(LIGHTINFO);
LightInfo.crFill = RGB(255, 255, 255);
LightInfo.nAngle = 0;
LightInfo.ptCenter.x = LeadBitmap.Width/2;
LightInfo.ptCenter.y = LeadBitmap.Height/2;
LightInfo.uEdge = 0;
LightInfo.uBright = 100;
LightInfo.uFlag = LGT_SPOTLIGHT;
LightInfo.uHeight = min(LeadBitmap.Height, LeadBitmap.Width)/2;
LightInfo.uWidth = max(LeadBitmap.Height, LeadBitmap.Width)/2;
LightInfo.uOpacity = 100;

L_LightBitmap(&LeadBitmap, &LightInfo, 1, 100, 100, RGB(255,255,255));


L_LightControlBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LightControlBitmap(pBitmap, puLowerAvr, puAverage, puUpperAvr,uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR * puLowerAvr; | /* pointer to the new low average(s) array */
L_UINT L_FAR * puAverage; | /* pointer to the new average(s) array */
L_UINT L_FAR * puUpperAvr; | /* pointer to the new high average(s) array */
L_UINT uFlag; | /* flag */

Lightens or darkens all or part of a bitmap by remapping the pixel values.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
puLowerAvr | Pointer to an array containing the new average pixel value for those pixels with values between 0 and the average pixel value for the entire bitmap. The size of the array equals one, if uFlag is YUV_SPACE or GRAY_SPACE, or three, if uFlag is RGB_SPACE. If uFlag 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.
puAverage | Pointer to an array containing the new average pixel value for the entire bitmap. The size of the array equals one, if uFlag is YUV_SPACE or GRAY_SPACE, or three, if uFlag is RGB_SPACE. If uFlag is RGB_SPACE the first element corresponds to the new blue average value, the second element to the green, and the last element to the red.
puUpperAvr | Pointer to an array containing the new average pixel value for those pixels with values between the average pixel value for the entire bitmap and the highest pixel value in the bitmap. The size of the array equals either one if uFlag is YUV_SPACE or GRAY_SPACE or three if uFlag 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.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function remaps the pixel values of the bitmap across the full range of available pixel values, in order to achieve the values passed in puLowerAvr, puAverage and puUpperAvr.

For example, call this function for a grayscale bitmap, with puAverage containing 150, puLowerAvr containing 100 and puUpperAvr 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

uLowerAvr = 100
uAverage = 255
uUpperAvr = 255
uFlag = YUV_SPACE

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_MosaicBitmap, L_PixelateBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

/* The following example loads a bitmap and applies light control function. */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_UINT puLowerAvr[3];
L_UINT puAverage[3];
L_UINT puUpperAvr[3];

puLowerAvr[0] = 100; /*for blue, gray or yuv*/
puLowerAvr[1] = 120; /*for green*/
puLowerAvr[3] = 80; /*for red*/
puAverage[0] = 150; /*for blue, gray or yuy*/
puAverage[1] = 140; /*for green*/
puAverage[2] = 128; /*for red*/
puUpperAvr[0] = 190; /*for blue, gray or yuv*/
puUpperAvr[1] = 200; /*for green*/
puUpperAvr[2] = 220; /*for red*/

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* change the lightness of the bitmap */
L_LightControlBitmap(&LeadBitmap, puLowerAvr, puAverage, puUpperAvr, YUV_SPACE);


L_LineProfile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LineProfile(pBitmapHndl, FirstPoint, SecondPoint, pRed, pGreen, pBlue)

pBITMAPHANDLE pBitmapHndl; | /* pointer to the bitmap handle */
POINT FirstPoint; | /* starting point of the line */
POINT SecondPoint; | /* end point of the line */
L_INT L_FAR * L_FAR * pRed; | /* pointer to a pointer */
L_INT L_FAR * L_FAR * pGreen; | /* pointer to a pointer */
L_INT L_FAR * L_FAR * pBlue; | /* pointer to a pointer */

Allocates three arrays and updates them with the R, G and B profile for each pixel in the specified line.

Parameter | Description
pBitmapHndl | Pointer to the bitmap handle that references the bitmap for which to get the line profile.
FirstPoint | POINT structure that contains the starting point for the line.
SecondPoint | POINT structure that contains the end point for the line. Information for this point is included in the arrays.
pRed | Pointer to a pointer to be updated with an array that contains the red values for the line specified by FirstPoint and SecondPoint. A memory buffer for this array is allocated by the function. When the array is no longer needed, it should be freed by the user by calling the GlobalFreePtr macro.
pGreen | Pointer to a pointer to be updated with an array that contains the green values for the line specified by FirstPoint and SecondPoint. A memory buffer for this array is allocated by the function. When the array is no longer needed, it should be freed by the user by calling the GlobalFreePtr macro.
pBlue | Pointer to a pointer to be updated with an array that contains the blue values for the line specified by FirstPoint and SecondPoint. A memory buffer for this array is allocated by the function. When the array is no longer needed, it should be freed by the user by calling the GlobalFreePtr macro.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The range of the returned values will be from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

This function allocates memory buffers for the three arrays using the GlobalAllocPtr macro. When the buffers are no longer needed, they should be freed by calling the GlobalFreePtr macro. If the GlobalFreePtr macro is not supported by the compiler, the buffers can be freed using the following code:

void MyGlobalFreePtr(void *ptr)
{
HGLOBAL hGlobal = (HGLOBAL) GlobalHandle(ptr);
GlobalUnlock(hGlobal);
GlobalFree(hGlobal);
}

This function supports 12 and 16-bit grayscale. Support for 12 and 16-bit grayscale is available only in the Document/Medical toolkits.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_PutPixelColor, L_GetPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Removing Noise

Example

/* This example assumes there is a bitmap loaded into Bitmap, which is of type BITMAPHANDLE. */
L_INT L_FAR * nactRed;
L_INT L_FAR * nactGreen;
L_INT L_FAR * nactBlue;
POINT StartPoint, EndPoint;
BITMAPHANDLE Bitmap;

nactRed=NULL;
nactGreen=NULL;
nactBlue=NULL;

L_LineProfile(&Bitmap,StartPoint,EndPoint,&nactRed,&nactGreen,&nactBlue);

// … use the colors in the arrays here

// free the three buffers
GlobalFreePtr(nactRed);
GlobalFreePtr(nactGreen);
GlobalFreePtr(nactBlue);


L_LineRemoveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LineRemoveBitmap(pBitmap, pLineRemove, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPLINEREMOVE pLineRemove; | /* pointer to a structure */
LINEREMOVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Removes horizontal and vertical lines in a 1-bit black and white image. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap on which to perform line removal.
pLineRemove | Pointer to the LINEREMOVE structure that LEADTOOLS uses to perform the line removal operation.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in LINEREMOVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function removes horizontal and vertical lines from scanned text documents. If the lines pass through text, the pLineRemove parameter can be configured to remove or preserve the text. The behavior of this function can be further modified by using its callback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | LINEREMOVECALLBACK, L_SmoothBitmap, L_BorderRemoveBitmap, L_InvertedTextBitmap, L_DotRemoveBitmap, L_HolePunchRemoveBitmap
Topics: | Cleaning Up 1-Bit Images

Example

//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
//A callback is used to display information about each line removed
//The callback does NOT return a region

L_INT L_EXPORT EXT_CALLBACK ExampleLineRemoveCB
(
HRGN hRgn,
L_INT32 iStartRow,
L_INT32 iStartCol,
L_INT32 iLength,
L_VOID L_FAR *pUserData
)

{
L_TCHAR szMsg[200];

wsprintf(
szMsg,
TEXT("RowCol[%d,%d] Length[%d]\n"),
iStartRow,
iStartCol,
iLength
);
OutputDebugString(szMsg);
return SUCCESS_REMOVE;
}

L_VOID ExampleLineRemove(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
LINEREMOVE lr;

lr.uStructSize = sizeof(LINEREMOVE);
lr.iGapLength = 2;
lr.iMaxLineWidth = 5;
lr.iMinLineLength = 200;
lr.iWall = 7;
lr.iMaxWallPercent = 10;
lr.uRemoveFlags = LINEREMOVE_HORIZONTAL;
lr.uFlags = LINE_USE_GAP;

nRet = L_LineRemoveBitmap(
pBitmap,
&lr,
(LINEREMOVECALLBACK)(ExampleLineRemoveCB),
NULL
);
}


L_LoadBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadBitmap(pszFile, pBitmap, uStructSize, nBitsPerPixel, nOrder, pLoadOptions, pFileInfo)

L_TCHAR, L_FAR * pszFile; | /* name of the file to load */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48, and 64-bit bitmaps */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file into a bitmap. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Note:

More options are available in the LOADFILEOPTION structure.

Parameter | Description
pszFile | Character string containing the name of the file to load.
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | Color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Support for writing AVI files is only available in the Multimedia toolkits.

For supported formats, refer to Summary of All Supported Image File Formats.

Before calling this function, you may need to get or set file information, such as the page number of a multi-page file or the resolution of a PCD file. Refer to Getting and Setting File Information.

The function will initialize the bitmap handle and allocate the storage necessary to hold the image. If the bits per pixel of the file is larger than 8 bits, the image data will be loaded in the same color order as the one passed to the function in nOrder.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_FreeBitmap.

Warning: The function will return ERROR_INV_PARAMETER if nOrder was set to ORDER_GRAY and the image file was not 12 or 16 bits per pixel.

Note:

If Document/Medical support is unlocked, and the format being loaded is FILE_LEAD1BIT, FILE_CCITT_GROUP3_1DIM, FILE_CCITT_GROUP3_2DIM, FILE_CCITT_GROUP4, FILE_ICA_G3_1D, FILE_ICA_G3_2D, FILE_ICA_G4, FILE_RAWICA_G3_1D, FILE_RAWICA_G3_2D, FILE_RAWICA_G4, FILE_FAX_G3_1D, FILE_FAX_G3_2D, FILE_FAX_G4, FILE_WFX_G3_1D, or FILE_WFX_G4, the image data will be loaded compressed. For more information, refer to Speeding Up 1-Bit Documents.

Please note that if you are loading a PDF file, LEADTOOLS loads all PDF files as Raster PDF uncompressed (FILE_RAS_PDF), regardless of the compression and color space used when saving the file.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadFile, L_LoadFileOffset, L_GetCompressFileStamp, L_SetExtFileOption, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_DlgOpen , L_CreatePanWindow, For Vector files: L_2DGetViewMode, L2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);


L_LoadBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadBitmapList(lpszFile, phList, nBitsTo, nColorOrder, pLoadOptions, pFileInfo)

L_TCHAR L_FAR* lpszFile; | /* name of the file to load */
pHBITMAPLIST phList; | /* address of the variable to be updated */
L_INT nBitsTo; | /* resulting bitmap pixel depth */
L_INT nColorOrder; | /* color order for 16-, 24-, and 32-bit bitmaps */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Creates a bitmap list and loads bitmaps from a multi-page file into the list.

Parameter | Description
lpszFile | Character string containing the name of the file to load.
phList | Address of the HBITMAPLIST variable for the new list.
nBitsTo | Resulting pixel depth of bitmaps in the list. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 1 to 8 | The specified bits per pixel in the resultant bitmaps
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmaps
 | 24 | 24 bits per pixel in the resultant bitmaps
 | 32 | 32 bits per pixel in the resultant bitmaps
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 64 bits per pixel in the resultant bitmap
nColorOrder | Color order for 16-, 24-, 32-, 48- and 64-bit bitmaps. If the resultant bitmaps are less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order
 | ORDER_BGR | [1] Blue, green, and red color order
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS_ABORT | The function was successful, but one or more pages could not be loaded. *phList contains the pages which were loaded properly.
SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Medical Imaging editions .

Support for writing AVI files is only available in the Multimedia toolkits.

Before calling this function, you must declare a variable of data type HBITMAPLIST. You can then pass the address of the variable in the phList parameter, which this function will update with the handle to the bitmap list.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor, L_SetExtFileOption, L_DlgOpen , L_SetLoadInfoCallback, L_GetLoadStatus
 | L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For a short example, refer to L_ProcessPlayback. For complete sample code, refer to the FRAME.C module of the DEMO example.


L_LoadBitmapMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadBitmapMemory(pBuffer, pBitmap, uStructSize, nBitsPerPixel, nOrder, nBufferSize, pLoadOptions, pFileInfo)

L_CHAR L_FAR* pBuffer; | /* pointer to the file in memory to be loaded */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48- and 64-bit bitmaps */
L_INT32 nBufferSize; | /* size of the file in memory (in bytes) */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file from memory into a bitmap. The file in memory can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
pBuffer | Pointer to the file in memory to be loaded.
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | Color order for 16-, 24-, 32-, 48-, 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
nBufferSize | Size of the file in memory (in bytes).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

All toolkits can load AVI files.

For supported formats, refer to Summary of All Supported Image File Formats.

Before calling this function, you may need to get or set file information, such as the page number of a multi-page file. Refer to Getting and Setting File Information.

The function will initialize the bitmap handle and allocate the storage necessary to hold the image. If the bits per pixel of the file is larger than 8 bits, the image data will be loaded in the same color order as the one passed to the function in nOrder.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_FreeBitmap.

This function cannot be used in combination with L_RedirectIO.

Note: | More options are available in the LOADFILEOPTION structure.
Note: | This function does not support Kodak PhotoCD (PCD), Kodak FlashPix, or Microsoft FAX (AWD) files.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadMemory, L_DecompressBitmapMemory, L_DecompressMemory, L_SetExtFileOption, L_SetWMFResolution, L_SetLoadInfoCallback L_SetLoadResolution, L_SetPCDResolution, For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For a short example, refer to L_SaveBitmapMemory. For complete sample code, refer to the MEMORY example.


L_LoadBitmapResize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadBitmapResize(pszFile, pBitmap, uStructSize, nDestWidth, nDestHeight, nDestBits, uFlags, nOrder, pLoadOptions, pFileInfo)

L_TCHAR L_FAR * pszFile; | /* name of the file to load */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nDestWidth; | /* new width of the image */
L_INT nDestHeight; | /* new height of the image */
L_INT nDestBits; | /* resulting bitmap pixel depth */
L_UINT32 uFlags; | /* flags */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48, and 64-bit bitmaps */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file into a bitmap, 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.

Note: More options are available in the LOADFILEOPTION structure.

Parameter | Description
pszFile | Character string containing the name of the file to load.
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nDestWidth | New width of the image.
nDestHeight | New height of the image.
nDestBits | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

uFlags | Flag that indicates the type of resizing to use. Possible values are:
 | Value | Meaning
 | SIZE_NORMAL | [0x0] Normal resizing.
 | SIZE_RESAMPLE | [0x2] Linear interpolation resizing.
 | SIZE_BICUBIC | [0x4] Bicubic interpolation resizing.
nOrder | Color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
pLoadOptions | Pointer to a LOADFILEOPTION structure optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function is ideal for sampling large images (i.e. generating a thumbnail) without the memory overhead of loading the large file itself.

For supported formats, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadFile, L_LoadFileOffset, L_GetCompressFileStamp, L_SetExtFileOption, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_DlgOpen , L_CreatePanWindow,
 | For Vector files: L_2DGetViewMode, L2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

Example

//This sample loads and resizes an image to 400 pixels high.
//The width of the bitmap is determined by the aspect ratio
//Bicubic interpolation is used on the resize
//The bitmap is loaded at the original bits per pixel
L_INT SampleLoadFileResize3(pBITMAPHANDLE pSmallBitmap, L_TCHAR *pszFile)
{
L_INT nRet;

nRet = L_LoadBitmapResize(
pszFile, // name of the file to load
pSmallBitmap, // pointer to the target bitmap handle
sizeof(BITMAPHANDLE),
0, // new width of the image
400, // new height of the image
0, // new bits per pixel for the image
SIZE_BICUBIC, //
ORDER_BGR, // color order
NULL, // pointer to optional extended load options
NULL // pointer to a structure
);
return nRet;
}


L_LoadExtensionStamp

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadExtensionStamp(pExtensionList, pBitmap, uStructSize)

pEXTENSIONLIST pExtensionList; | /* pointer to a structure */
pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */

Loads a stamp from the specified extension list.

Parameter | Description
pExtensionList | Pointer to the EXTENSIONLIST structure that contains the stamp to load.
pBitmap | Pointer to the bitmap handle that references the bitmap to be updated with the stamp loaded from the specified extension list.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The extensions referenced by the pExtensionList parameter must be loaded by calling the L_ReadFileExtensions function.

Required DLLs and Libraries

LTFIL
Exif file format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadFileExtensions, L_GetExtensionAudio, L_FreeExtensions, L_ReadFileStamp
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

static L_INT LoadExtensionStamp(HWND hWnd, L_TCHAR L_FAR* pszName, pBITMAPHANDLE pBitmap)
{
pEXTENSIONLIST pExtensionList;
L_INT nRet;
L_TCHAR s[300];

nRet = L_ReadFileExtensions(pszName, &pExtensionList, NULL);
if(nRet != SUCCESS)
{
wsprintf(s, TEXT("Error %d getting extensions!"), nRet);
MessageBox(hWnd, s, TEXT("ERROR"), MB_OK);
return nRet;
}

if(pExtensionList->uFlags & EXTENSION_STAMP)
{
nRet = L_LoadExtensionStamp(pExtensionList, pBitmap, sizeof(BITMAPHANDLE));
if (nRet != SUCCESS)
{
wsprintf(s, TEXT("Error %d loading the stamp"), nRet);
MessageBox(hWnd, s, TEXT("ERROR"), MB_OK);
}
}
else
MessageBox(hWnd, TEXT("The extensions do not contain a stamp"), TEXT("ERROR"), MB_OK);

L_FreeExtensions(pExtensionList);
return SUCCESS;
}


L_LoadFile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadFile(pszFile, pBitmap, uStructSize, nBitsPerPixel, nOrder, uFlags, pfnCallback, pUserData, pLoadOptions, pFileInfo)

L_TCHAR L_FAR * pszFile; | /* name of the image file to load */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine function behavior */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads any supported file, using a callback function.

Parameter | Description
pszFile | Character string containing the name of the image file to load.
pBitmap | Pointer to the bitmap handle for the loaded data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | The desired color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] Red-green-blue order.
 | ORDER_BGR | [1] Blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
uFlags | Binary flags that determine the behavior of L_LoadFile. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_FIXEDPALETTE | [0x0004] This flag will force a palletized image to be dithered to a fixed palette.
 | LOADFILE_NOINTERLACE | [0x0008] The function passes image data in the order that is displayed, regardless of how it is stored in the file. (Set this flag if your program does not handle interlaced file formats.)
 | LOADFILE_ALLPAGES | [0x0010] The function loads all pages of a multi-page file. Use this flag only if you are creating a bitmap list using the L_AppendPlayback function.
 | LOADFILE_NOINITBITMAP | [0x0020] The function does not initialize the bitmap handle when it loads the file. Use this flag only if you are supplying all of the required information in the BITMAPHANDLE structure.
 | LOADFILE_COMPRESSED | [0x0040] (Document/Medical only) If possible, load the file as a 1-bit RLE-compressed image. For more information, refer to Speeding Up 1-Bit Documents.
 | LOADFILE_SUPERCOMPRESSED | [0x0080] (Document/Medical only) Load 1-bit, 8-bit, or 24-bit images as super compressed. This flag is ignored if the bitmaps are not loaded as 1-bit, 8-bit, or 24-bit. Please note that 8-bit images will be loaded as grayscale, even if the source image is color.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Before calling this function, you may need to get or set file information, such as the page number of a multi-page file or the resolution of a PCD file. Refer to Getting and Setting File Information.

The callback function can display the image to the screen, write to a file, or do other useful things. L_LoadFile will create a buffer and fill it with the actual image data. Once the buffer is full, the callback function is called.

Note: | More options are available in the LOADFILEOPTION structure.
Note: | For information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmap, L_LoadFileOffset, L_GetCompressFileStamp, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_DlgOpen , L_CreatePanWindow, For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

Example

For complete sample code, refer to the RESIZE example.

/****************************************************************************************
This example uses L_LoadFile with a callback function to implement a
paint-while-load feature. Refer to the FILEREADCALLBACK
function to see how the callback function paints the image data.

The sample code uses the following global declarations: */
HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
RECT rClientSize; /* RECT for the client area */
RECT rLeadDest; /* Destination rectangle for painting */
RECT rLeadSource; /* Source rectangle for painting */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
FILEINFO FileInfo; /* LEAD File Information structure. */
FILEREADCALLBACK lpfnCallBack;

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
} IMAGECBPARM;

/* Prototype for the FILEREADCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK LoadImageCB(pFILEINFO pFileInfo, pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData );
/****************************************************************************************/
void TestFunction(HWND hWnd)
{
static IMAGECBPARM UserData; /* Structure used for the callback function's user data */
/* Get the client area of the window. We assume that elsewhere in the program, the
L_FileInfo function has been used to update the FileInfo structure and that the
window dimensions have been adjusted to the bitmap's aspect ratio. */
GetClientRect(hWnd,&rClientSize);
/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;
/* Initialize the bitmap handle */
L_InitBitmap( &LeadBitmap, sizeof(BITMAPHANDLE), FileInfo.Width, FileInfo.Height, FileInfo.BitsPerPixel );
LeadBitmap.ViewPerspective = FileInfo.ViewPerspective;
/* Set the user data used for the callback in the L_LoadFile function */
UserData.hwnd = hWnd; /* Current window */
UserData.hdc = GetDC( hWnd ); /* Device context for the current window */
/* Set the callback function for the L_LoadFile function.*/
lpfnCallBack = (FILEREADCALLBACK) MakeProcInstance(
(FARPROC) LoadImageCB, hInst );
/* Load the file, calling lpfnCallBack to paint the bitmap. */
L_LoadFile( TEXT("GIRL.TGA"),
&LeadBitmap, sizeof(BITMAPHANDLE),
0,
ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
lpfnCallBack,
&UserData,
NULL, NULL);
FreeProcInstance ((FARPROC) lpfnCallBack);
/* Avoid an unnecessary repaint */
ValidateRect(hWnd, &rLeadDest);
}
/**************************************************************************************/

BITMAPHANDLE Bitmap;
LOADFILEOPTION LoadFileOption;

// Load an image with the viewing transformations and color transformations
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags &= ~(ELO_IGNOREVIEWTRANSFORMS | ELO_IGNORECOLORTRANSFORMS);
L_LoadFile(TEXT("TEST.FPX"), &Bitmap, sizeof(BITMAPHANDLE), 0,ORDER_RGB, LOADFILE_ALLOCATE|LOADFILE_STORE, NULL,NULL, &LoadFileOption, NULL);

// Load an image without the viewing transformations
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_IGNOREVIEWTRANSFORMS;
L_LoadFile(TEXT("TEST.FPX"), &Bitmap, sizeof(BITMAPHANDLE), 0,ORDER_RGB, LOADFILE_ALLOCATE|LOADFILE_STORE, NULL,NULL, &LoadFileOption, NULL);

// Load an image without the color transformations
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_IGNORECOLORTRANSFORMS;
L_LoadFile(TEXT("TEST.FPX"), &Bitmap, sizeof(BITMAPHANDLE), 0,ORDER_RGB, LOADFILE_ALLOCATE|LOADFILE_STORE, NULL,NULL, &LoadFileOption, NULL);

// Load an image without the viewing and color transformations
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_IGNOREVIEWTRANSFORMS | ELO_IGNORECOLORTRANSFORMS;
L_LoadFile(TEXT("TEST.FPX"), &Bitmap, sizeof(BITMAPHANDLE), 0,ORDER_RGB, LOADFILE_ALLOCATE|LOADFILE_STORE, NULL,NULL, &LoadFileOption, NULL);


L_LoadFileCMYKArray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadFileCMYKArray(pszFile, ppBitmapArray, uBitmapArrayCount, uStructSize, nBitsPerPixel, uFlags, pfnCallback, pUserData, pLoadFileOption, pFileInfo);

L_TCHAR L_FAR * pszFile; | /* name of the file to load */
pBITMAPHANDLE L_FAR *ppBitmapArray; | /* array of pointers to BITMAPHANDLE handles */
L_UINT uBitmapArrayCount; | /* number of items in the bitmap array */
L_UINT uStructSize; | /* size in bytes, of each BITMAPHANDLE structure */
L_INT nBitsPerPixel; | /* desired number of bits per pixel for each plane */
L_UINT uFlags; | /* flags that determine the function behavior */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure */

Loads CMYK TIFF files as CMYK and avoids the colorspace conversion to RGB.

Parameter | Description
pszFile | Character string that contains the name of the file to load. The file must be CMYK, otherwise the function will fail and return the ERROR_INV_COLORSPACE error code.
ppBitmapArray | An array of pointers to the bitmaps to be filled with each color plane. There should be 4 or 5 members in the array, depending on whether the alpha channel information needs to be loaded. uBitmapArrayCount indicates how many pointers are stored in the array. The bitmaps are in this order: C, M, Y, K, Alpha (optional).
uBitmapArrayCount | The number of bitmaps present in ppBitmapArray. Pass 4 if the alpha bitmap is not needed, or 5 if the alpha bitmap is needed.
uStructSize | The size of each BITMAPHANDLE structure. Pass sizeof(BITMAPHANDLE).
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

uFlags | Binary flags that determine the behavior of L_LoadFileCMYKArray. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap. (This takes place in addition to the actions of the callback function.)
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of the callback function.)
 | LOADFILE_NOINITBITMAP | [0x0020] The function does not initialize the bitmap handle when it loads the file. Use this flag only if you are supplying all of the required information in the BITMAPHANDLE structure.
 | LOADFILE_SUPERCOMPRESSED | [0x0080] (Document/Medical only) Load 8-bit images as super compressed. This flag is ignored if the bitmaps are loaded as 16-bit.
pfnCallback | Optional callback function for additional processing. This function will be called while the bitmap planes are loaded. It will be called for each plane and each row.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadFileOption | Pointer to optional extended load options. It can be used to specify the start page, IFD, etc. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized, since they are placed on the stack. Therefore, if the FILEINFO structure is a local variable, the value of its Flags parameter is undefined, and may actually have FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
ERROR_INV_COLORSPACE | Invalid color space.
< 1 | An error occurred. Refer to Return CodesReturns.

Comments

If the data does not have to be loaded as CMYK, use the regular load functions L_LoadBitmap, L_LoadBitmapMemory, L_LoadBitmapResize, L_LoadFile, L_LoadFileOffset, or L_LoadMemory.

Support for 16-bit grayscale images is only available in the Document/Medical Imaging editions.

The following members of LOADFILEOPTION are important for this function:

PageNumber: 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.

Flags: specifies whether to use the IFD.

IFD: used only if Flags contains the ELO_USEIFD flag set.

This function will fail if the input file is not TIFF CMYK. However, not all pages in the file have to be CMYK, as long as the page to be loaded is CMYK.

Use L_PaintDCCMYKArray to display the array and L_SaveFileCMYKArray to save this array as a CMYK TIFF file.

Note that if you pass 5 bitmaps to L_LoadFileCMYKArray and the file does not have alpha information, the 5th bitmap in the array will not be allocated.

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 L_ColorMergeBitmap and pass COLORSEP_CMYK for uFlags parameter. If alpha information is included, use L_SetBitmapAlpha to set the alpha bitmap.

Image processing can be performed on each individual bitmap in the array, thereby processing each color plane separately.

To load a non-CMYK file as an array of color planes, use L_LoadBitmap, L_LoadBitmapMemory, L_LoadBitmapResize, L_LoadFile, L_LoadFileOffset, or L_LoadMemory and then call L_ColorSeparateBitmap and L_GetBitmapAlpha.

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PaintDCCMYKArray, L_SaveFileCMYKArray, L_LoadFile, L_GetDefaultLoadFileOption, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_GetBitmapAlpha, L_SetBitmapAlpha.
Topics: | Handling CMYK Files as Separate Bitmaps
 | Loading and Saving Images
 | Raster Image Functions: Loading Files

Example

/* This example will load all CMYK TIFF file, increase the brightness of the K plane only (which will darken the image) and save the file as CMYK TIFF */
#define CMYK_FILE "e:\\i\\cmyk.tif"

L_INT LoadCMYKArray(HWND hWnd)
{
L_INT nRet;
FILEINFO FileInfo;
BITMAPHANDLE BitmapC, BitmapM, BitmapY, BitmapK;
pBITMAPHANDLE CMYKArray[4] = {&BitmapC, &BitmapM, &BitmapY, &BitmapK};
L_UINT u;

nRet = L_FileInfo(CMYK_FILE, &FileInfo, sizeof(FILEINFO), 0, NULL);
if(nRet != SUCCESS)
{
MessageBox(hWnd, "Invalid source file", "Error", MB_OK);
return nRet;
}

nRet = L_LoadFileCMYKArray(CMYK_FILE, CMYKArray, 4, sizeof(BITMAPHANDLE), 8,
LOADFILE_ALLOCATE|LOADFILE_STORE, NULL, NULL, NULL, &FileInfo);
if(nRet != SUCCESS)
{
MessageBox(hWnd, "L_LoadFileCMYKArray failed!", "Error", MB_OK);
return nRet;
}

/* 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 = L_ChangeBitmapIntensity(CMYKArray[3], 500);
if(nRet != SUCCESS)
MessageBox(hWnd, "L_ChangeBitmapIntensity failed!", "Error", MB_OK);
else
{
nRet = L_SaveFileCMYKArray ("c:\\myCMYK.tif", CMYKArray, 4, FILE_TIFLZW_CMYK, 8, 2, 0, NULL, NULL, NULL);
if(nRet != SUCCESS)
MessageBox(hWnd, "L_LoadFileCMYKArray failed!", "Error", MB_OK);
}

// free the CMYK array allocated by L_LoadFileCMYKArray
for(u = 0; u < 4; u++)
{
L_TCHAR s[_MAX_PATH];
wsprintf(s, "c:\\plane%d.tif", u);
L_SaveBitmap(s, CMYKArray[u], FILE_TIF, 0, 0, NULL);
L_FreeBitmap(CMYKArray[u]);
}

SetWindowText(hWnd, "Done");

return nRet;
}


L_LoadFileOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadFileOffset(fd, nOffsetBegin, nBytesToLoad, pBitmap, uStructSize, nBitsPerPixel, nOrder, uFlags, pfnCallback, pUserData, pLoadOptions, pFileInfo)

L_INT fd; | /* windows file handle of the file to load */
L_INT32 nOffsetBegin; | /* position of the first byte to load */
L_INT32 nBytesToLoad; | /* size of the embedded image file */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle for the loaded data */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine function behavior */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR* pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image from a file, using a callback function, and letting you specify the location of the image data within the file. This enables you to load an image file that is embedded in another file.

Parameter | Description
fd | The Windows file handle of the file to load.
nOffsetBegin | The position, from the beginning of the file, of the first byte to load.
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.)
pBitmap | Pointer to the bitmap handle for the loaded data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth. (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | The desired color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] Red-green-blue order.
 | ORDER_BGR | [1] Blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
uFlags | Binary flags that determine the behavior of L_LoadFileOffset. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap.
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_FIXEDPALETTE | [0x0004] This flag will force a palletized image to be dithered to a fixed palette.
 | LOADFILE_NOINTERLACE | [0x0008] The function passes image data in the order that is displayed, regardless of how it is stored in the file. (Set this flag if your program does not handle interlaced file formats.)
 | LOADFILE_ALLPAGES | [0x0010] The function loads all pages of a multi-page file. Use this flag only if you are creating a bitmap list using the L_AppendPlayback function.
 | LOADFILE_COMPRESSED | [0x0040] (Document/Medical only) If possible, load the file as a 1-bit RLE-compressed image. For more information, refer to Speeding Up 1-Bit Documents.
 | LOADFILE_SUPERCOMPRESSED | [0x0080] (Document/Medical only) Load 1-bit or 24-bit images as super compressed. This flag is ignored if the bitmaps are not loaded as 1-bit or 24-bit.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

The location of the image is specified as shown in the following simple illustration:

You must open the file and get a Windows file handle before calling this function. Redirected input (specified with L_RedirectIO) is disabled when this function is executing.

Before calling this function, you may need to get or set file information, such as the page number of a multi-page file or the resolution of a PCD file. Refer to Getting and Setting File Information.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmap, L_LoadFile, L_GetCompressFileStamp, L_SetExtFileOption, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_DlgOpen , L_CreatePanWindow, For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For a short example, refer to L_SaveFileOffset. For complete sample code, refer to the OFFSET example.


L_LoadFileTile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadFileTile(pszFile, pBitmap, uStructSize, nCol, nRow, uWidth, uHeight, nBitsPerPixel, nOrder, uFlags, pfnCallback, pUserData, pLoadOptions, pFileInfo)

L_TCHAR, L_FAR * pszFile; | /* file name */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nCol; | /* left column of tile */
L_INT nRow; | /* top row of tile */
L_UINT uWidth; | /* width of the tile in pixels */
L_UINT uHeight; | /* height of the tile in pixels */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine function behavior */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads a section of an image file (any format), using a callback function. The section begins at (nCol, nRow) and extends uWidth pixels across and uHeight pixels down.

Parameter | Description
pszFile | Character string containing the name of the image file to load.
pBitmap | Pointer to the bitmap handle for the loaded data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nCol | Left column number of tile.
nRow | Top row number of tile.
uWidth | Tile width in pixels.
uHeight | Tile height in pixels.
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | The desired color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] Red-green-blue order.
 | ORDER_BGR | [1] Blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
uFlags | Binary flags that determine the behavior of L_LoadFileTile. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap. (Setting the LOADFILE_STORE flag will override this flag.)
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_FIXEDPALETTE | [0x0004] This flag will force a palletized image to be dithered to a fixed palette.
 | LOADFILE_NOINTERLACE | [0x0008] The function passes image data in the order that is displayed, regardless of how it is stored in the file. (Set this flag if your program does not handle interlaced file formats.)
 | LOADFILE_ALLPAGES | [0x0010] The function loads all pages of a multi-page file. Use this flag only if you are creating a bitmap list using the L_AppendPlayback function.
 | LOADFILE_NOINITBITMAP | [0x0020] The function does not initialize the bitmap handle when it loads the file. Use this flag only if you are supplying all of the required information in the BITMAPHANDLE structure.
 | LOADFILE_COMPRESSED | [0x0040] (Document/Medical only) If possible, load the file as a 1-bit RLE-compressed image. For more information, refer to Speeding Up 1-Bit Documents.
 | LOADFILE_SUPERCOMPRESSED | [0x0080] (Document/Medical only) Load 1-bit or 24-bit images as super compressed. This flag is ignored if the bitmaps are not loaded as 1-bit or 24-bit.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

More options are available in the LOADFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetExtFileOption,
 | L_GetExtFileOption
 | L_SaveFileTile, L_DlgOpen , L_SetLoadInfoCallback, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort, L_GetLoadStatus
Topics: | Raster Image Functions: Loading Files,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

Load a portion of an image without loading the entire image.

BITMAPHANDLE Bitmap;
FILEINFO FileInfo;
FileInfo.uStructSize = sizeof(FileInfo);
L_FileInfo(TEXT("TEST.FPX"), &FileInfo, sizeof(FILEINFO), 0, NULL);
// Load 1/2 from an image (center)
L_LoadFileTile(TEXT("TEST.FPX"),&Bitmap, sizeof(BITMAPHANDLE), FileInfo.Width/4, FileInfo.Height/4, (FileInfo.Width)/2, (FileInfo.Height)/2, 0, ORDER_BGR, LOADFILE_ALLOCATE | LOADFILE_STORE, NULL, NULL, NULL, &FileInfo);


L_LoadICCProfile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadICCProfile(pszFilename, pICCProfile, pLoadOptions)

L_TCHAR L_FAR * pszFilename; | /* name of the file to load */
pMEMICCPROFILE pICCProfile; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads an embedded ICC profile.

Parameter | Description
pszFile | Character string containing the name of the file containing the embedded ICC profile.
pICCProfile | Pointer to a structure to be updated with the loaded ICC Profile.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options, and the profile will be loaded from page 1.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multi-page and you can load the profile from a particular page using the pLoadOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfile. If L_LoadICCProfile succeeds, free the ICC profile by calling L_FreeICCProfile.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to L_FreeICCProfile.


L_LoadICCProfileExt

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_LoadICCProfileExt(pszFilename, pICCProfile, pLoadOptions)

L_TCHAR L_FAR * pszFilename; | /* name of the file to load */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads an ICC profile saved/embedded in an image file.

Parameter | Description
pszFilename | Character string containing the name of the file from which to load the ICC profile.
pICCProfile | Pointer to an ICCPROFILEEXT structure to be updated with the loaded ICC Profile.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options, and the profile will be loaded from page 1.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multipage, so a profile can be loaded from a particular page using the pLoadOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfileExt. If L_LoadICCProfileExt succeeds, free the ICC profile by calling L_FreeICCProfileExt. In fact, when any ICCPROFILEEXT structure initialized by L_InitICCProfileExt is no longer needed, the memory must be freed by calling L_FreeICCProfileExt.

To save an ICC Profile to an image file, call L_SaveICCProfile.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

For an example, refer to L_InitICCProfileExt.


L_LoadLayer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadLayer(pszFile, pBitmap, uStructSize, nBitsPerPixel, nOrder, nLayer, pLayerInfo, pLoadOptions)

L_TCHAR L_FAR * pszFile; | /* name of a file */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48, and 64-bit bitmaps */
L_INT nLayer; | /* index of the layer to load */
pLAYERINFO pLayerInfo; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads the specified layer from the specified file. Currently only PSD files support layers.

Parameter | Description
PszFile | Character string containing the name of the file from which to load the layer.
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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.

nOrder | Color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
nLayer | 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.
pLayerInfo | Pointer to a LAYERINFO structure to be updated with information about the loaded layer. Pass NULL for this parameter if layer information is not needed. If this parameter contains a valid pointer to a LAYERINFO structure, the lSize member should be set to the sizeof (LAYERINFO) before calling this function.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Currently, only the PSD file format supports layers.

This function works similarly to the L_LoadBitmap function, except that it loads only a layer from a file. It loads the layer specified in nLayer.

Before calling this function, you may need to get or set file information, such as the number of layers on the file. Refer to Getting and Setting File Information.

The number of layers in a file is indicated in FILEINFO.Layers. If FILEINFO.Layers is 0, the file does not contains any layers and this function should not be called.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_FreeBitmap.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadBitmap, L_FileInfo, L_SaveBitmapWithLayers
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

/* This example loads the first layer from a file */
FILEINFO FileInfo;
BITMAPHANDLE Bitmap;
LAYERINFO LayerInfo;

FileInfo.uStructSize = sizeof(FileInfo);
if(L_FileInfo(TEXT("layers.psd"), &FileInfo, sizeof(FILEINFO), 0, NULL) == SUCCESS)
if(FileInfo.Layers)
{
/* I have to set the lSize member of LayerInfo, otherwise L_LoadLayer will fail */
LayerInfo.uStructSize = sizeof(LAYERINFO);
L_LoadLayer(TEXT("layers.psd"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, 0, &LayerInfo, NULL);
}


L_LoadMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadMarkers(pszFilename, phMarkers, uFlags)

L_TCHAR L_FAR * pszFilename; | /* file name */
HANDLE L_FAR * phMarkers; | /* pointer to the marker handle */
L_UINT uFlags; | /* flags that determine function behavior */

Loads metadata markers (COM and APPn) into a handle.

Parameter | Description
pszFilename | Character string that contains the name of the file from which to load the collection of metadata markers.
phMarkers | Pointer to a variable to be updated with a handle to the collection of metadata markers. This handle is allocated by this function.
uFlags | Reserved for future use. Pass 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The handle referenced by the phMarkers parameter is allocated by this function. This handle can then be used to save the metadata information. For Exif files, this metadata handle 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 L_TransformFile. Each retrieved marker is passed to the TRANSFORMFILECALLBACK function. There is one important difference between the markers passed to TRANSFORMFILECALLBACK and those loaded with L_LoadMarkers:

TRANSFORMFILECALLBACK receives ALL the markers (metadata and image-related markers).

L_LoadMarkers loads only the metadata markers.

When the marker collection handle is no longer needed, use the L_FreeMarkers function to free it.

To save the collection of metadata markers referenced by the handle in phMarkers to a file, pass this handle to the L_SetMarkers function.

IMPORTANT NOTE:

The comments set with L_SetComment will OVERRIDE any comments contained in the metadata markers. For example, if the original file had an author of "Steve" and you call

L_SetComment (CMNT_SZAUTHOR, TEXT("John"), 5);

the next time you save a file, the author will be John (not Steve). However, all the comments that have not been set will be taken from the metadata handle.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeMarkers, L_SetMarkers, L_WriteFileMetadata, L_TransformFile, TRANSFORMFILECALLBACK, L_EnumMarkers, L_InsertMarker, L_GetMarkerCount, L_GetMarker
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

L_INT CopyMetaData(HWND hWnd, L_TCHAR L_FAR*pszSrc, L_TCHAR L_FAR*pszDest)
{
HANDLE hMarkers;
L_INT nRet;

nRet = L_LoadMarkers(pszSrc, &hMarkers, 0);
if(nRet != SUCCESS)
{
MessageBox(hWnd, TEXT("Error loading markers"), TEXT("FAILURE"), MB_OK);
return nRet;
}

L_SetMarkers(hMarkers, 0);
L_FreeMarkers(hMarkers);

return L_WriteFileMetaData(pszDest, METADATA_ALL, NULL);
}


L_LoadMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LoadMemory(pBuffer, pBitmap, uStructSize, nBitsPerPixel, nOrder, uFlags, pfnCallback, pUserData, nBufferSize, pLoadOptions, pFileInfo)

L_UCHAR, L_FAR * pBuffer; | /* pointer to the file in memory to be loaded */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine function behavior */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_INT32 nBufferSize; | /* size of the file in memory (in bytes) */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads any supported file from memory using a callback function.

Parameter | Description
pBuffer | Pointer to the file in memory to be loaded.
pBitmap | Pointer to the bitmap handle referencing the bitmap to be filled with image data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | The desired color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] Red-green-blue order.
 | ORDER_BGR | [1] Blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_ROMM | [5] ROMM order. ROMM only supports 24 and 48-bit images.
 | ORDER_BGRORGRAYORROMM | [6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only. ROMM only supports 24 and 48-bit color images.
uFlags | Binary flags that determine the behavior of L_LoadMemory. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap.
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_FIXEDPALETTE | [0x0004] This flag will force a palletized image to be dithered to a fixed palette.
 | LOADFILE_NOINTERLACE | [0x0008] The function passes image data in the order that is displayed, regardless of how it is stored in the file. (Set this flag if your program does not handle interlaced file formats.)
 | LOADFILE_ALLPAGES | [0x0010] The function loads all pages of a multi-page file. Use this flag only if you are creating a bitmap list using the L_AppendPlayback function.
 | LOADFILE_COMPRESSED | [0x0040] (Document/Medical only) If possible, load the file as a 1-bit RLE-compressed image. For more information, refer to Speeding Up 1-Bit Documents.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
nBufferSize | Size of the file in memory (in bytes).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

The callback function can display the image to the screen, write to a file, or do other useful things.

This function will create a buffer and fill it with the actual image data. Once the buffer is full, the callback function is called.

Before calling this function, you may need to get or set file information, such as the page number of a multi-page file. Refer to Getting and Setting File Information.

This function cannot be used in combination with L_RedirectIO.

Note: | This function does not support Kodak PhotoCD (PCD), Kodak FlashPix, or Microsoft FAX (AWD) files.
Note: | More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetExtFileOption, L_LoadBitmapMemory, L_DecompressBitmapMemory, L_DecompressMemory, L_SetWMFResolution, L_SetLoadInfoCallback, L_DlgOpen , L_CreatePanWindow, L_SetLoadResolution, L_SetPCDResolution, For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the MEMORYCB example.

/****************************************************************************************
This example loads a temporary bitmap, saves it as a file in memory,
then loads the memory-resident file into the global bitmap handle
It uses L_LoadMemory with a callback function to implement a
paint-while-load feature. Refer to the FILEREADCALLBACK
function to see how the callback function paints the image data.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
RECT rClientSize; /* RECT for the client area */
RECT rLeadDest; /* Destination rectangle for painting */
RECT rLeadSource; /* Source rectangle for painting */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
FILEINFO FileInfo; /* LEAD File Information structure.*/

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
} IMAGECBPARM;
/****************************************************************************************/

void TestFunction(HWND hWnd)
{
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
HGLOBAL hFileInMemory; /* Memory handle */
L_UINT32 uMemSize; /* Size of the data in memory */
L_CHAR L_FAR *pData; /* Pointer to the data in memory */
static IMAGECBPARM UserData; /* Structure used for the callback function's user data */
FILEREADCALLBACK lpfnCallBack;
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Save the image as a CMP file in memory */
L_SaveBitmapMemory(&hFileInMemory, &TmpBitmap, FILE_CMP, 24, QS, &uMemSize, NULL);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
/* Get the pointer to the memory-resident file */
pData = (L_CHAR L_FAR *) GlobalLock (hFileInMemory);
/* Get the client area of the window. We assume that elsewhere in the program, the
L_FileInfo function has been used to update the FileInfo structure and that the
window dimensions have been adjusted to the bitmap's aspect ratio. */
GetClientRect(hWnd,&rClientSize);
/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;
/* Initialize the bitmap handle */
L_InitBitmap( &LeadBitmap, sizeof(BITMAPHANDLE), FileInfo.Width, FileInfo.Height, FileInfo.BitsPerPixel );
LeadBitmap.ViewPerspective = FileInfo.ViewPerspective;
/* Set the user data used for the callback in the L_LoadFile function */
UserData.hwnd = hWnd; /* Current window */
UserData.hdc = GetDC( hWnd ); /* Device context for the current window */
/* Set the callback function for the L_LoadFile function.*/
lpfnCallBack = (FILEREADCALLBACK) MakeProcInstance(
(FARPROC) LoadImageCB, hInst );
/* Load the file, calling lpfnCallBack to paint the bitmap. */
L_LoadMemory(pData,
&LeadBitmap, sizeof(BITMAPHANDLE),
0,
ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
lpfnCallBack,
&UserData,
uMemSize,
NULL, NULL);
FreeProcInstance ((FARPROC) lpfnCallBack);
/* Avoid an unnecessary repaint */
ValidateRect(hWnd, &rLeadDest);
/* Clean up */
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);
return;
}


L_LocalHistoEqualizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_LocalHistoEqualizeBitmap(pBitmap, nWidth, nHeight, nxExt,nyExt, uType, uSmooth)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nWidth; | /* width of the local histogram equalizer
 | rectangle */
L_INT nHeight; | /* height of the local histogram equalizer
 | rectangle */
L_INT nxExt; | /* width extention */
L_INT nyExt | /* height extention */
L_UINT uType; | /* color space */
L_UINT uSmooth; | /* smoothing size */

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 function is available in the Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
nWidth | The width of the local histogram equalizer rectangle in pixels. The width should be more than zero.
nHeight | The height of the local histogram equalizer rectangle in pixels. The height should be more than zero.
nxExt | The extension of the width of the local histogram equalizer rectangle, in pixels.
nyExt | The extension of the height of the local histogram equalizer rectangle, in pixels.
uType | 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.
uSmooth | Size of the area to be used when smoothing the edges between localized blocks. Possible values range from 0 to 7, but if nHeight is less than or equal to 7 then the maximum value for this item is nHeight - 1. If uSmooth = 0 the function will operate without smoothing edges.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function applies the histogram equalizer locally on the image. The image is divided into local rectangles of dimension (nWidth, nHeight). 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:

((nWidth+2 * nxExt) , ( nHeight + 2 * nyExt)).

For an example, see the following drawing:

A rectangle and its associated extension, where the histogram is calculated.

Use this function 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 uSmooth to reduce the blockiness of the result.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_DlgLocalHistoEqualize
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
Example

For complete sample code, refer to the CHILD.C module of the DEMO example.
/* This example loads a bitmap and applies local histogram equalization. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, 0, sizeof(BITMAPHANDLE), ORDER_BGR, NULL, NULL);
/* Local Histogram equalize the bitmap */
L_LocalHistoEqualizeBitmap(&LeadBitmap, 15,15,100,100, YUV_SPACE,2 );


L_MaskConvolutionBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MaskConvolutionBitmap(pBitmap, nAngle, uDepth, uHeight, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* angle of the apparent light source */
L_UINT uDepth; | /* depth of the 3D effect */
L_UINT uHeight; | /* height of the 3D effect */
L_UINT uFlag; | /* flags */

Applies various 3d effects to a bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
nAngle | Angle of apparent light source, in hundredths of degrees. Possible values range from –36000 to 36000.
uDepth | 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.
uHeight | 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.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For 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 function 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
nAngle | 0 | 0 | 180 | 0
uDepth | 3 | 3 | 3 | 3
uHeight | 250 | 250 | 100 | 100

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_PlasmaFilterBitmap, L_EmbossBitmap, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgEmboss , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Detecting and Enhancing Edges and Lines

Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* The following example applies the emboss mask over the bitmap: */BITMAPHANDLE LeadBitmap;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_MaskConvolutionBitmap(&LeadBitmap, 500, 45, 3, MSKC_EMBOSS);


L_MathFunctionBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MathFunctionBitmap (pBitmap, uMType, uFactor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uMType; | /* determines the manipulation function */
L_UINT uFactor; | /* amplitude or frequency Factor */

Re-maps the image colors according to a mathematical function such as: square, log, square root, sine and cosine.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
uMType | 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.
uFactor | 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 uFactor is divided internally by different amounts, according to the type of the function being used. These amounts are as follows:
 | If uMType is set to: | then the uFactor will be divided by:
 | MF_SQR | 10000 internally
 | MF_LOG | 10 internally
 | MF_SQRT | 10 internally
 | MF_SIN | 100 internally
 | MF_COS | 100 internally

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses the RGB color space.

This function 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 uMType parameter. The resulting values are multiplied by the factor uFactor. The uFactor 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.

To update a status bar or detect a user interrupt during execution of this function refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmaps, L_CombineBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

/* This example loads a bitmap and applies a Log Function over the loaded image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply Log Function to this bitmap */
L_MathFunctionBitmap (&LeadBitmap, MF_LOG, 100);


L_MaxFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MaxFilterBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */

Erodes dark objects by the specified amount.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uDim | Dimensions of the neighborhood used for filtering (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can process the whole image or a region of the image.

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.

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 uDim parameter. Each pixel is replaced with the maximum value of its neighborhood.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgMaxFilter , L_WindowLevel, L_HolesRemovalBitmapRgn, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

/* This example loads a bitmap and applies a max filter to it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* apply max filter */
L_MaxFilterBitmap(&LeadBitmap, 3 );


L_MedianFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MedianFilterBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */

Changes the color of each pixel in a bitmap to the median color of pixels in its neighborhood. This is similar to the L_AverageFilterBitmap function, but it is used for noise reduction, rather than a blur effect.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be converted.
uDim | Dimensions of the neighborhood used for filtering (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 uDim parameter.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgMedianFilter , L_WindowLevel, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies an median filter. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply a median filter with a neighborhood of 3x3 pixels */
L_MedianFilterBitmap(&LeadBitmap, 3 );


L_MinFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MinFilterBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */

Dilates dark objects by the specified amount.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uDim | Dimensions of the neighborhood used for filtering (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can process the whole image or a region of the image.

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.

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 uDim parameter. Each pixel is replaced with the minimum value of its neighborhood.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgMinFilter , L_WindowLevel, L_HolesRemovalBitmapRgn, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

/* This example loads a bitmap and applies a min filter to it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply the min filter */
L_MinFilterBitmap(&LeadBitmap, 3 );


L_MosaicBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MosaicBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the tiles (uDim x uDim), in pixels */

Imposes 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.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uDim | Dimensions of the tiles (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SharpenBitmap, L_PosterizeBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgMosaic , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies a mosaic effect. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply a mosaic effect with 3x3 tiles */
L_MosaicBitmap(&LeadBitmap, 3 );


L_MosaicTilesBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MosaicTilesBitmap(pBitmap, pMosaicTilesInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPMOSAICTILESINFO pMosaicTilesInfo; | /* mosaic tiles effect parameters */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
pMosaicTilesInfo | Pointer to the MOSAICTILESINFO structure that contains information about the required effect.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function'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 L_MosaicTilesBitmap function using the following settings:

Parameter | Value
uOpacity | 60
uPenWidth | 4
uTileWidth | 17
uTileHeight | 17
ptCenter | na
uShadowAngle | na
uShadowThresh | na
crBorderColor | Black
crTilesColor | na
uFlags | MSCT_CART | MSCT_FLAT

The following figure results:

Use the L_MosaicBitmap function 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 L_PixelateBitmap function 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 L_RomanMosaicBitmap function 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 L_PointillistBitmap function to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_PixelateBitmap, L_PointillistBitmap, L_MosaicTilesBitmap, L_RomanMosaicBitmap, L_DiceEffectBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_CanvasBitmap, L_BricksTextureBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
MOSAICTILESINFO MosaicInfo; /* Structure which stores the required parameters*/
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("Image1.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
/*Fill the structure with the required parameters. The effect is applied using rectangular tiles with black border color*/
MosaicInfo.uStructSize = sizeof(MOSAICTILESINFO);
MosaicInfo.crBorderColor = RGB(0, 0, 0);
MosaicInfo.crTilesColor = RGB(255, 255, 255);
MosaicInfo.uFlags = MSCT_CART | MSCT_SHADOWGRAY;
MosaicInfo.uTileHeight = LeadBitmap.Height/5;
MosaicInfo.uTileWidth = LeadBitmap.Width/5;
MosaicInfo.uOpacity = 50;
MosaicInfo.uShadowThreshold = 0;
MosaicInfo.uShadowAngle = SHADOW_SE;
MosaicInfo.uPenWidth = 7;

L_MosaicTilesBitmap(&LeadBitmap, &MosaicInfo);


L_MotionBlurBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MotionBlurBitmap(pBitmap, uDim, nAngle, bUnidirectional)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* size of the blur effect */
L_INT nAngle; | /* direction of the motion */
L_BOOL bUnidirectional; | /* flag */

Applies a filter, which creates the illusion of movement in an image.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to blur.
uDim | Size of the blur effect, in pixels.
nAngle | Value that represents the direction of the motion, in hundredths of a degree (+/-) This value can be a number from 0 to 36000. If the value is positive, the motion will be clockwise. If the value is negative, the motion is counter-clockwise.
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 nAngle.
 | FALSE | The motion blur effect is along the line with that angle. For example, if nAngle is 0, the blur effect will occur in the 0 degree direction and the 180 degree direction.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgMotionBlur , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

/* This example loads a bitmap and creates motion blur. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* blur the bitmap */
L_MotionBlurBitmap(&LeadBitmap,20,4500,FALSE);


L_MoveBitmapListItems

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MoveBitmapListItems(phList, hList, uIndex, uCount)

pHBITMAPLIST phList; | /* address of the variable to be updated */
HBITMAPLIST hList; | /* handle to an existing list of bitmaps */
L_UINT uIndex; | /* index of the first bitmap to copy */
L_UINT uCount; | /* number of bitmaps to copy */

Creates a new bitmap list by moving the specified bitmaps from an existing list. Bitmap handles and image data are moved.

Parameter | Description
phList | Address of the variable to be updated with the new list of bitmaps.
hList | Handle to the list of bitmaps to copy from.
uIndex | Index of the first bitmap to copy.
uCount | Number of bitmaps to copy. You can specify (L_UINT) -1 to copy to the end of the existing list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The specified items are removed from hList and moved to the variable pointed to by phList.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CopyBitmapListItems, L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_GetBitmapListCount, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/* This example moves all but the first two bitmaps in a list of bitmaps;
then calls another function to save the moved list. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the playback target */
void TestCopyList(HBITMAPLIST hList)
{
HBITMAPLIST hNewList;
/* Move all but the first two bitmaps of the incoming list */
L_MoveBitmapListItems(&hNewList, hList, 2, (L_UINT) -1);
/* Call a local function to save the new list */
TestSaveList(hNewList); /* Refer to the L_SaveBitmapList example */
return;
}


L_MultiplyBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MultiplyBitmap(pBitmap, uFactor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFactor; | /* multiplication factor */

Increases or decreases the brightness in the bitmap by multiplying the colors in the specified bitmap by a value equal to the uFactor value divided by 100.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uFactor | An integer which represents the factor to be used when multiplying image values. The factor used is equal to uFactor/100.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uFactor value divided by 100. For example, if uFactor is 131, the colors in the specified bitmap will be multiplied by 1.31.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_AddWeightedBitmaps, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_DlgMultiply , L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

/* This example loads a bitmap and multiplies it with 1.51 factor */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Multiply the colors of the bitmap with 1.51*/
L_MultiplyBitmap(&LeadBitmap, 151);


L_MultiScaleEnhancementBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_MultiScaleEnhancementBitmap (pBitmap, uContrast, uEdgeLevels, uEdgeCoeff, uLatitudeLevels, uLatitudeCoeff, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uContrast; | /* amount of contrast enhancement */
L_UINT uEdgeLevels; | /* number of levels used in edge enhancement */
L_UINT uEdgeCoeff; | /* degree of edge enhancement */
L_UINT uLatitudeLevels; | /* number of levels used in latitude reduction */
L_UINT uLatitudeCoeff; | /* degree of latitude reduction */
L_UINT uFlags; | /* flags that determine function behavior */

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. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle on which the enhancements will be applied.
uContrast | 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.
uEdgeLevels | 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. MSE_DEFAULT will use the default number of levels (which is 3). This option will take effect only if the MSE_EDGEENH is set in the uFlags. Passing zero will return an error code.
uEdgeCoeff | The edge enhancement coefficient. This value will be internally divided by 100. Pass MSE_DEFAULT to use the default values (which is 170 interpreted as 1.7). This option will be used only if the MSE_EDGEENH is set in the uFlags. 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.
uLatitudeLevels | 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 to use the default level value (which is 5). This option will be used only if the MSE_LATRED is set in uFlags. Passing zero will return an error code.
uLatitudeCoeff | The latitude reduction coefficient. This value will be internally divided by 100. Pass MSE_DEFAULT to use the default values (which is 140 interpreted as 1.4). This option will be used only if the MSE_LATRED is set in uFlags. 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.
uFlags | Flags that determine function behavior. You can specify none, one or both of the following values:
 | Value | Meaning
 | MSE_EDGEENH | [0x0010] Add edge enhancement option to the function. When this flag is set, the uEdgeLevels and uEdgeCoeff parameters will be used.
 | MSE_LATRED | [0x0020] Add latitude reduction option to the function. When this flag is set, uLatitudeLevel and uLatitudeCoeff 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function 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.

To find the number of levels in any image follow this equation:

uMaxLevels = ceil( log( max(pBitmap->Width, pBitmap->Height)) / log(2));

The function will consider values larger than 10000 for uContrast as if they were 10000. If the user passed 0 then image contrast will not be improved.

Best results are obtained if uContrast 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.

User can further enhance the image with:

edge enhancements (use MSE_EDGEENH) and/or

latitude reduction (use MSE_LATRED)

uEdgeLevels, uEdgeCoeff, uLatitudeLevels and uLatitudeCoeff are available for advanced users. Using MSE_DEFAULT would give the maximum enhancements. MSE_DEFAULT is defined as (L_UINT)–1

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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. 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_HistoContrastBitmap, L_AddWeightedBitmaps, L_MultiplyBitmap, L_SelectiveColorBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FTDisplayBitmap, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_MathFunctionBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_SelectBitmapData, L_ShiftBitmapData
Topics: | Raster Image Functions: Modifying Intensity Values
 | Removing Noise

Example

/* This example loads a bitmap and applies multiscale enhancement. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);

// Apply multiscale enhancement
L_MultiScaleEnhancementBitmap(&LeadBitmap, 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);


L_OceanBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OceanBitmap(pBitmap, uAmplitude, uFrequency, bLowerTrnsp)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* wave’s magnitude */
L_UINT uFrequency; | /* number of repeated waves */
L_BOOL bLowerTrnsp; | /* flag */

Reflects the bitmap on an ocean surface. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to reflect.
uAmplitude | Wave magnitude, in pixels.
uFrequency | Number of repeated waves.
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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

uAmplitude=15
uFrequency=20
bLowerTrnsp=TRUE

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_DryBitmap, L_GlowFilterBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */

L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_OceanBitmap(&LeadBitmap, 20,6,TRUE);


L_OffsetBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OffsetBitmap(pBitmap, nHorizontalShift, nVerticalShift, crBackColor, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to bitmap handle */
L_INT nHorizontalShift; | /* horizontal shift */
L_INT nVerticalShift; | /* vertical shift */
COLORREF crBackColor; | /* background color */
L_UINT uFlag; | /* flag */

Shifts the bitmap pixels horizontally and vertically.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nHorizontalShift | Horizontal shift of the bitmap, in pixels.
nVerticalShift | Vertical shift of the bitmap, in pixels.
crBackColor | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color. This is only useful when uFlag parameter is set to FILL_CLR.
uFlag | Flag that indicates how to handle any exposed areas resulting from the bitmap shift. Possible values are:
 | Value | Meaning
 | FILL_CLR | [0x0000] Fill the exposed areas with crBackColor.
 | FILL_NOCHG | [0x0001] Leave the exposed area as is, without changing it.
 | FILL_RPT | [0x0002] Stretch the image edges to fill the exposed area.
 | FILL_WRAP | [0x0003] Fill any exposed areas with the opposite side of the image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function shifts the bitmap pixels horizontally and vertically.

Use the L_OffsetBitmapRgn function to move a bitmap region by the specified number of rows and columns.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EmbossBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_OffsetBitmapRgn.
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT ("IMAGE3.CMP"), &LeadBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply the Offset Bitmap effect to the image*/
L_OffsetBitmap(&LeadBitmap, LeadBitmap.Width / 2, LeadBitmap.Height / 2, 0, FILL_WRAP);


L_OffsetBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OffsetBitmapRgn(pBitmap, nRowOffset, nColOffset)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nRowOffset; | /* number of rows to move the region */
L_INT nColOffset; | /* number of columns to move the region */

Moves the bitmap region by the specified number of rows and columns. The move does not affect the pixels in the region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
nRowOffset | The number of rows to move the region.
nColOffset | The number of columns to move the region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses bitmap coordinates to specify the region. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapRgnBounds
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

For complete sample code, refer to the DRAW example.

/* This example moves the bitmap region down and to the right */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction ( HWND hWnd )
{
L_INT nRowOffset; /* Movement on the Y axis */
L_INT nColOffset; /* Movement on the X axis */
L_INT x1,x2;
L_INT y1,y2;
/* We are going to move the region down and to the right */
/* by 1/4 of the display dimensions. */
/* First, get the display width and height */
nRowOffset = BITMAPHEIGHT(&LeadBitmap) / 4;
nColOffset = BITMAPWIDTH(&LeadBitmap) / 4;
/* Now, account for ViewPerspective */
x1 = 0;
y1 = 0;
x2 = nColOffset;
y2 = nRowOffset;
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &x1, &y1 );
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &x2, &y2 );
nColOffset = x2-x1;
nRowOffset = y2-y1;
/* Move the region */
L_OffsetBitmapRgn(&LeadBitmap, nRowOffset, nColOffset);
}


L_OilifyBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OilifyBitmap(pBitmap, uDim)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* dimensions of the neighborhood (uDim x uDim), in pixels */

Applies an oil-painting effect to the bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uDim | Dimensions of the neighborhood used for filtering (uDim x uDim), in pixels.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 uDim parameter. You increase the size of the neighborhood in order to decrease the amount of detail in the resulting image.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_SolarizeBitmap, L_DlgOilify , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

/* This example loads a bitmap and oilifies it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Oilify with neighborhood of 5 x 5 */
L_OilifyBitmap(&LeadBitmap, 5 );


L_OptGetDefaultOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OptGetDefaultOptions(pOptImgOptions, uStructSize)

pOPTIMIZEIMAGEOPTIONS pOptImgOptions; | /* pointer to the OPTIMIZEIMAGEOPTIONS structure */
L_UINT32 uStructSize; | /* size of the OPTIMIZEIMAGEOPTIONS structure */

Gets the default optimization options used by LEADTOOLS for optimizing an image.

Parameter | Description
pOptImgOptions | Pointer to the OPTIMIZEIMAGEOPTIONS structure to be updated with the default optimization options used for optimizing an image.
uStructSize | Size in bytes, of the structure pointed to by pOptImgOptions, for versioning. Use sizeof(OPTIMIZEIMAGEOPTIONS).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare a variable of data type OPTIMIZEIMAGEOPTIONS. Then, pass the address of the variable in the pOptImgOptions parameter. The uStructSize parameter must be set to the size of the OPTIMIZEIMAGEOPTIONS structure in bytes. This function will update the variable with the default optimization options used for optimizing an image.

For more information, refer to the OPTIMIZEIMAGEOPTIONS structure.

Required DLLs and Libraries

LTIMGOPT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_OptOptimizeBuffer, L_OptOptimizeDir
Topics: | Optimizer: Optimization Functions
 | Image Optimization

Example

For an example, refer to L_OptOptimizeBuffer.


L_OptOptimizeBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OptOptimizeBuffer(pOrgImgBuffer, uOrgImgBufferSize, phOptImgBuffer, puOptImgBufferSize, pOptImgOptions, pfnOptBufferCB, pUserData)

L_UCHAR L_FAR * pOrgImgBuffer; | /* pointer to the image buffer to optimize */
L_UINT32 uOrgImgBufferSize; | /* size of the image in memory */
HGLOBAL L_FAR * phOptImgBuffer; | /* address of a memory handle */
L_UINT32 L_FAR * puOptImgBufferSize; | /* address of image-size variable to be updated */
pOPTIMIZEIMAGEOPTIONS pOptImgOptions; | /* pointer to the OPTIMIZEIMAGEOPTIONS structure */
OPTIMIZEBUFFERCALLBACK pfnOptBufferCB; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Optimizes a supported image format buffer using the passed optimization options.

Parameter

Description

pOrgImgBuffer

Pointer to the original image buffer in memory. The image format in memory should be one of the LEAD Image optimizer supported formats.

uOrgImgBufferSize

Size, in bytes, of the original image in memory, which is referenced by the pOrgImgBuffer parameter.

phOptImgBuffer

Address of a memory handle to be updated by the optimized image buffer. The user is responsible for freeing it by calling the GlobalFree Windows function.

puOptImgBufferSize

Pointer to a variable to be updated with the size of the optimized image buffer in memory, which is referenced by phOptImgBuffer.

pOptImgOptions

Pointer to an OPTIMIZEIMAGEOPTIONS structure that contains the options used in optimization. Pass NULL to use the default optimization options.

pfnOptBufferCB

Optional callback function for additional processing.

If you do not provide a callback function, use NULL as the value of this parameter.

If you do provide a callback function, use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in OPTIMIZEBUFFERCALLBACK Function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function optimizes the specified buffer and reduces its size, based on the specified optimization options.

The function will initialize the phOptImgBuffer handle and allocate the storage necessary to hold the optimized image. Since the function allocates storage to hold the optimized image, the user must free the allocated memory by calling the Windows GlobalFree function.

Note that the image buffer to be optimized should be one of the LEAD Image optimizer supported formats otherwise the function 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, and get a pointer to the first byte of this image. Pass this pointer as the pOrgImgBuffer parameter. Pass the size, in bytes, of the image in memory as the uOrgImgBufferSize parameter.
2. | Declare a memory handle (HGLOBAL) variable and pass its address as the phOptImgBuffer parameter. This function will allocate and unlock the memory needed to save the optimized image buffer.
3. | Declare a long integer (L_UINT32) variable. Pass the address of this variable as the puOptImgBufferSize parameter. This function will update this variable with the size, in bytes, of the optimized image buffer.
4. | Determine the optimization options to use, by doing one of the following:
 | Pass NULL in the pOptImgOptions parameter to optimize the image buffer using the default optimization options.
 | Get the default optimization options by calling L_OptGetDefaultOptions function, and update the structure values as you like. Pass the address of the updated optimization options structure in the pOptImgOptions parameter.
5. | Call this function to optimize the image buffer and update the phOptImgBuffer and uOptImgBufferSize variables with the optimized buffer and buffer size.

Required DLLs and Libraries

LTIMGOPT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_OptGetDefaultOptions, L_OptOptimizeDir, L_SaveBitmapMemory, L_LoadBitmapMemory.
Topics: | Optimizer: Optimization Functions
 | Image Optimization

Example

/* This Function will get the default optimization options to optimize the image buffer
pointed by phOrgImgBuffer parameter. */

L_INT L_FAR L_EXPORT fnOptBufferCB(L_INT nPercent, L_VOID L_FAR * pUserData)
{
L_TCHAR buf[1024]; // Message buffer

wsprintf(buf, TEXT("%d"), nPercent);
MessageBox(NULL, buf, TEXT("Optimizing"), MB_OK);

return SUCCESS;
}

L_INT OptimizeBufferFunction(L_UCHAR L_FAR * phOrgImgBuffer,
L_UINT32 uOrgImgBufferSize,
L_VOID L_FAR * pUserData)
{
HGLOBAL hOptImgBuffer = NULL; /* Handle to the Optimized Buffer in Memory*/
L_UINT32 uOptImgBufferSize = 0; /* size of the optimized buffer in Memory*/
OPTIMIZEIMAGEOPTIONS OptImgOptions; /* optimization options structure*/
L_UCHAR L_FAR * pOptImgBuffer = NULL;

// Get the default optimization options.
L_INT nRet = L_OptGetDefaultOptions(&OptImgOptions, sizeof(OPTIMIZEIMAGEOPTIONS));
if(nRet == SUCCESS)
{
// Optimize the image buffer
nRet = L_OptOptimizeBuffer(phOrgImgBuffer,
uOrgImgBufferSize,
&hOptImgBuffer, // to be updated.
&uOptImgBufferSize, // to be updated.
&OptImgOptions,
fnOptBufferCB,
pUserData);
if(nRet == SUCCESS)
{
// To work on the optimized buffer, We have to lock it.
pOptImgBuffer = (L_UCHAR L_FAR *) GlobalLock(hOptImgBuffer);
if(pOptImgBuffer)
{
/* Now, pOptImgBuffer is ready to work on; for example you can create a disk file
and dump this buffer to it.*/
// .
// .
// .

// Unlock the Memory Buffer.
GlobalUnlock(hOptImgBuffer);
// Free the Meory Buffer allocated by L_OptOptimizeBuffer function.
GlobalFree(hOptImgBuffer);
}
}
}
return nRet;
}


L_OptOptimizeDir

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_OptOptimizeDir(pszOrgDirPath, pszOptDirPath, pOptImgOptions, pszFilesExt, bIncludeSubDirs, pfnOptImgDirCB, pUserData)

L_TCHAR L_FAR * pszOrgDirPath; | /* full path directory to optimize */
L_TCHAR L_FAR * pszOptDirPath; | /* full path directory to save optimized images */
pOPTIMIZEIMAGEOPTIONS pOptImgOptions; | /* pointer to the OPTIMIZEIMAGEOPTIONS structure */
L_TCHAR L_FAR * pszFilesExt; | /* files extension(s) to optimize */
L_BOOL bIncludeSubDirs; | /* flag that indicates whether to include sub-directories */
OPTIMIZEIMAGEDIRCALLBACK pfnOptImgDirCB; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Optimizes a directory of images using the specified optimization options, and saves the optimized images to a new directory with the same hierarchy.

Parameter

Description

pszOrgDirPath

Character string that contains full path directory of supported images to optimize.

pszOptDirPath

Character string that contains full path directory to save the optimized image(s).

pOptImgOptions

Pointer to an OPTIMIZEIMAGEOPTIONS structure that contains the options used in optimization. Pass NULL to use the default optimization options.

pszFilesExt

Pointer to a character string that contains the extensions of the files to optimize. This is a NULL terminated string and can have a maximum length of MAX_PATH. For example:

To optimize all "gif" and "jpeg" files, pszFilesExt should be set to "*.gif;*.jpeg".

To optimize all the supported files found in the pszOrgDirPath directory, regardless of the their extensions, pszFilesExt should be set to "*.*".

bIncludeSubDirs

Flag that indicates whether to include sub-directories when optimizing. Possible values are:

Value

Meaning

TRUE

Include sub-directories when optimizing.

FALSE

Exclude sub-directories when optimizing.

pfnOptImgDirCB

Optional callback function for additional processing.

If you do not provide a callback function, use NULL as the value of this parameter.

If you do provide a callback function, use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in OPTIMIZEIMAGEDIRCALLBACK Function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function looks for all the selected and supported files in the pszOrgDirPath directory and optimizes them using the optimization options passed in the pOptImgOptions parameter. It then saves the optimized images to the pszOptDirPath directory.

Both the pszOrgDirPath and pszOptDirPath parameters should contain a full path, complete with drive name. The pszOrgDirPath parameter should contain the full path to the input (original) directory, and the pszOptDirPath parameter should contain the full path to the output (optimized) directory.

Required DLLs and Libraries

LTIMGOPT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_OptGetDefaultOptions, L_OptOptimizeBuffer.
Topics: | Optimizer: Optimization Functions
 | Image Optimization

Example

/* This Example is going to optimizes all files with extensions jpg, bmp and tmp */
L_INT L_FAR L_EXPORT fnOptDirCB(pOPTIMIZEIMAGEDIRINFO pImgDirInfo, L_VOID L_FAR * pUserData)
{
// Check if pCBData is a vlid pointer
if(pImgDirInfo)
{
L_TCHAR buf[200]; // Message buffer

switch(pImgDirInfo->nStatusCode)
{
case SUCCESS: /* Optimizing operation Successfully done */
{
MessageBox(NULL, TEXT("Operation Successfully Done"), TEXT("Optimizing"), MB_OK);
}
break;

case OPTIMIZE_DIR_PRE_OPTIMIZINGIMAGE: /* Pre Optimizing Image */
{
MessageBox(NULL, TEXT("Pre Optimize Image"), TEXT("Note"), MB_OK);
if((pImgDirInfo->pFileInfo->Format == FILE_JPEG) ||
(pImgDirInfo->pFileInfo->Format == FILE_JPEG_411) ||
(pImgDirInfo->pFileInfo->Format == FILE_JPEG_422) ||
(pImgDirInfo->pFileInfo->Format == FILE_EXIF_JPEG_411) ||
(pImgDirInfo->pFileInfo->Format == FILE_EXIF_JPEG_422))
pImgDirInfo->pOptImgOptions->JPEGColorSpace = JPEG_COLORSPACE_422;
}
break;
case OPTIMIZE_DIR_OPTIMIZINGIMAGE: /* Optimizing ... */
{
static i = 1; // Optimized files counter

// display the current file and total percent
wsprintf(buf, TEXT("%d %% of optimizing %s to %s \nFiles %d of %d"), pImgDirInfo->nFilePercent, pImgDirInfo->szOrgFileName, pImgDirInfo->szOptFileName, i, pImgDirInfo->nTotalFolderFilesCount);
MessageBox(NULL, buf, TEXT("Optimizing"), MB_OK);

// if nFilePercent = 100 increment the counter by 1
if((pImgDirInfo->nFilePercent == 100) && ((i + 1) <= pImgDirInfo->nTotalFolderFilesCount))
i++;
}
break;

default:
{
/* report error to user */
/* Give the user the ability to skip the current image only or cancel the whole operation*/
wsprintf(buf, TEXT("Error: %d - Optimizing Image!\n%s\nPress OK to skip this file and optimize the next one!"), pImgDirInfo->nStatusCode, pImgDirInfo->szOrgFileName);
if(MessageBox(NULL, buf, TEXT("Error"), MB_OKCANCEL|MB_ICONERROR) == IDOK)
return(ERROR_OPT_SKIPIMAGE);
else
return(ERROR_OPT_ABORT);
}
break;
}
}
return SUCCESS;
}

L_INT OptDirFunction(pOPTIMIZEIMAGEOPTIONS pOptImgOptions, L_BOOL bIncludeSubDir, L_VOID L_FAR * pUserData)
{
return L_OptOptimizeDir(TEXT("C:\\OriginalImages"), /* The original Dir to be optimized. */
TEXT("D:\\OptimizedImages"),/* The New Dir to save the Optimized image(s) to.*/
pOptImgOptions, /* Optimization options.*/
TEXT("*.jpg;*.bmp;*.tmp"), /* optimize all images with ext jpg, bmp and tmp only.*/
bIncludeSubDir, /* Optimize or not the sub-dirs.*/
fnOptDirCB, /* Callback */
pUserData); /* User data */
}


L_PaintDC

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintDC(hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */

Displays any image, at any size, to any device context (screen, printer, or memory dc). If the display surface has fewer colors than the image, this function dithers the output to that display surface without affecting the actual image data.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function lets you specify a source rectangle (with coordinates relative to the bitmap) and a destination rectangle (with coordinates relative to the device context). Scaling of the displayed image depends on the relationship between these two rectangles, as shown in the following illustration.

Note:

These illustrations are for a bitmap with a TOP_LEFT view perspective. For an explanation of bitmap coordinates and view perspectives, refer to Accounting for View Perspective. If the bitmap is not in TOP_LEFT view perspective, refer to Changing Bitmap Coordinates.

In addition, you can specify a clipping area within either rectangle to limit the area to be painted. For the destination rectangle, a clipping area is commonly specified to repaint part of the image that was temporarily covered up. For a source rectangle, you can use a clipping area to update the display when only part of the image in the source rectangle has changed.

The following illustration shows how specifying a source clipping area affects the display. Text has been added to the source bitmap (using the bitmap as a display surface), and the source clipping area specifies the area to be repainted.

You can specify the various rectangles in any way that meets your needs. Coordinates can have negative values and they can extend beyond the bounds of the bitmap or the device context. In fact, it is common for the display rectangle to be bigger than the device context, where scroll bars are used to see different parts of the image.

In simple cases, you can use this function as follows:

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PaintDCBuffer, L_PaintDCEffect, L_WindowLevel, L_CreatePaintPalette, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For complete sample code, refer to the PAINTDC example.

/* This example shows the minimum requirements for painting an image with a palette */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
HDC hdc; /* Device context for the current window */
RECT rLeadDest; /* Destination rectangle for painting */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context */
hdc = GetDC (hWnd);
/* Set the destination rectangle to be the same as the bitmap.
Other painting rectangles can take defaults. */
SetRect(&rLeadDest, 0, 0, BITMAPWIDTH(&LeadBitmap), BITMAPHEIGHT(&LeadBitmap));
/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette (hdc, &LeadBitmap);
/* Select our palette and save the old one */
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
/* Paint the image */
L_PaintDC ( hdc, /* Device context */
&LeadBitmap,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY); /* ROP3 code for a Normal Paint */
/* Restore the old palette */
SelectPalette (hdc, hSavedPalette, FALSE);

/* Delete the newly created palette */
DeleteObject (hOurPalette);

/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_PaintDCBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintDCBuffer(hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3, pBuffer, nRow, nCount)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */
L_UCHAR L_FAR * pBuffer; | /* pointer to the source buffer */
L_INT nRow; | /* first row to paint */
L_INT nCount; | /* number of rows to paint */

Paints image data into a device context from a buffer.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle that describes the image to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
pBuffer | Pointer to the buffer that contains the image data to paint.
nRow | The first row to paint. The painted portion of any row may be limited by the RECT parameters.
nCount | The number of rows to paint. The painted portion of any row may be limited by the RECT parameters. If the image data in pBuffer is compressed 1-bit data, you can specify the number of lines as a negative value (-nLines), as explained in Speeding Up 1-Bit Documents.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function references a LEAD bitmap handle, which may or may not have a loaded bitmap. In either case, the following fields must be specified in the LEAD BITMAPHANDLE structure:

The Width, Height, BitsPerPixel, Order, and ViewPerspective fields must all be set to the correct values for the image. (You can use the L_InitBitmap function to set the values.)

The pPalette must be a valid palette (an array of RGBQUAD values). You can create or update the palette using the L_PutBitmapColors function.

Except for the buffer specifications, this function uses source and destination rectangles the same as L_PaintDC. For a complete explanation, refer to L_PaintDC.

You can call L_PaintDCBuffer from a callback function to paint an image while a bitmap is being loaded. This technique is used in the FILEREADCALLBACK procedures in the DEMO.C example program.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PaintDC, L_PaintDCEffect, L_WindowLevel, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For a short example, refer to FILEREADCALLBACK. For complete sample code, refer to the RESIZE example.


L_PaintDCCMYKArray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintDCCMYKArray (hDC, ppBitmapArray, uBitmapArrayCount, pSrc, pClipSrc, pDst, pClipDst, uROP3, hClrHandle);

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE L_FAR * ppBitmapArray; | /* array of pointers to BITMAPHANDLE handle */
L_UINT uBitmapArrayCount; | /* number of items in the bitmaps array */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */
HANDLE hClrHandle; | /* optional color conversion handle */

Displays an array of CMYK bitmaps, at any size, to any device context (screen, printer, or memory dc).

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
ppBitmapArray | Pointer to an array of pointers to the bitmaps that contain each plane. You should have 4 or 5 members in the array, depending on whether you want to paint with alpha channel information.
 | All the bitmaps must have the same width, height, bits per pixel and palette. uBitmapArrayCount indicates how many pointers are stored in the array. The bitmaps are in this order: C, M, Y, K, Alpha (optional).
uBitmapArrayCount | Number of bitmaps present in ppBitmapArray.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
hClrHandle | Optional color conversion handle used to convert CMYK data to BGR during painting. Pass NULL to let LEADTOOLS use the built-in color conversion functions.
 | If you pass hClrHandle != NULL and the LTCLR is missing, the function returns the ERROR_INV_COLORSPACE error code.

Returns

SUCCESS | The function was successful.
ERROR_LTCLR_MISSING | LTCLR DLL cannot be loaded.
< 1 | An error occurred. Refer to Return Codes.

Comments

The data is automatically converted to BGR and dithered (if necessary) without affecting the bitmaps in the array.

The bitmap array is typically created using L_LoadFileCMYKArray.

For more information on how the source and rectangle parameters behave, refer to the function L_PaintDC.

Windows can only paint BGR data. Therefore, it is necessary to convert CMYK data to BGR during the painting process. Notice that the painting of regular bitmaps, which are already BGR, is faster than the painting of CMYK arrays of bitmaps.

The color conversion can be performed using the Color Conversion API. For more information refer to the Color Conversion Help File . These conversions are accurate, but are slower than the built-in CMYK->RGB conversion formulas.

To use the accurate conversions, create a color handle using L_ClrInit and pass it as hClrHandle.

To use the fast conversions, pass NULL for hClrHandle.

But note that there is a visible difference between passing a real hClrHandle and using NULL for hClrHandle. Also, make sure you create a correct color CMYK->BGR conversion handle.

When the handle hClrHandle is no longer needed, it should be freed by calling L_ClrFree .

Required DLLs and Libraries

LTDIS

LTCLR (if you use hClrHandle)

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PaintDC, L_LoadFileCMYKArray, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_ClrInit , L_ClrFree
Topics: | Handling CMYK Files as Separate Bitmaps
 | Raster Image Functions: Displaying Images

Example

/* This example will load and paint an array of CMYK bitmaps. The color conversion is using the accurate (slower) method.
The example will not perform any error checking to make the code easier to understand.
*/
#define CMYK_FILE "c:\\cmyk.tif"

static L_INT ClrInit(HANDLE L_FAR*phClrHandle)
{
CONVERSION_PARAMS Params;
CMYK_PARAMS  CmykParams;

FMEMSET(&Params, 0, sizeof(Params));
Params.uStructSize = sizeof(Params);

CmykParams.uStructSize = sizeof(CMYK_PARAMS);
CmykParams.nMask = CMYK_GCR;
CmykParams.nGcr_level = 175; /* 17.5 % GCR value */
Params.pCmykParams = &CmykParams;

Params.nMethod = USE_ICC;
Params.nActiveMethod = USE_ICC;

return L_ClrInit
  (phClrHandle, CCS_CMYK, CCS_BGR, &Params);
}

L_INT LoadCMYKArray(HWND hWnd)
{
BITMAPHANDLE   BitmapC, BitmapM, BitmapY, BitmapK;
pBITMAPHANDLE  CMYKArray[4] = {&BitmapC, &BitmapM, &BitmapY, &BitmapK};
L_UINT   u;
HANDLE   hClrHandle;

// load CMYK array
L_LoadFileCMYKArray(CMYK_FILE, CMYKArray, 4, sizeof(BITMAPHANDLE), 8,    LOADFILE_ALLOCATE|LOADFILE_STORE, NULL, NULL, NULL, NULL);

HDC hDC = GetDC(hWnd); // get the window DC
// set the destination rect to be the same as each plane (100% zoom)
RECT  rcDst;
SetRect(&rcDst, 0, 0, BitmapC.Width, BitmapC.Height);

// create the color conversion handle
ClrInit(&hClrHandle);

L_PaintDCCMYKArray(hDC, CMYKArray, 4, NULL, NULL, &rcDst, NULL, SRCCOPY, hClrHandle);

// free the color conversion handle
if(hClrHandle != NULL)
L_ClrFree
  (hClrHandle);

// release the DC
ReleaseDC(hWnd, hDC);

// free the CMYK array allocated by L_LoadFileCMYKArray
for(u = 0; u < 4; u++)
L_FreeBitmap(CMYKArray[u]);

SetWindowText(hWnd, "Done");
return nRet;
}


L_PaintDCEffect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintDCEffect(hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3, uEffect)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */
L_UINT uEffect; | /* effect to apply when painting */

Applies an effect when painting a bitmap to a screen. The effect, commonly used for slide show transitions, specifies how the image is painted, not how it looks when painting is finished.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
uEffect | The effect to apply when painting. For valid values, refer to Effects.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If the screen has fewer colors than the image, this function dithers the output to that display surface without affecting the actual image data.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Otherwise, this function works the same as L_PaintDC. For a complete explanation, refer to L_PaintDC.

L_PaintDCEffect paints an image faster if its view perspective is bottom left. LEAD CMP images have a bottom-left view perspective, but some other formats have a top-left perspective. To get uniformly fast paints on all images, you can set the perspective after you load them, as shown in the following code. (You do not have to change them back before saving them in the original format, because the save functions set the orientation for the specified format.)

if (Bitmap.ViewPerspective != BOTTOM_LEFT)
L_ChangeBitmapViewPerspective ( NULL, &Bitmap, sizeof(BITMAPHANDLE), BOTTOM_LEFT );

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PaintDC, L_PaintDCBuffer, L_WindowLevel, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For complete sample code, refer to the PAINTEFF example.

/* This example shows the minimum requirements for using the L_PaintDCEffect
function to paint an image with a palette */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
HDC hdc; /* Device context for the current window */
RECT rLeadDest; /* Destination rectangle for painting */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context */
hdc = GetDC (hWnd);
/* Set the destination rectangle to be the same as the bitmap.
Other painting rectangles can take defaults. */
SetRect(&rLeadDest, 0, 0, BITMAPWIDTH(&LeadBitmap), BITMAPHEIGHT(&LeadBitmap));
/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette (hdc, &LeadBitmap);
/* Select our palette and save the old one */
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
/* Paint the image */
L_PaintDCEffect ( hdc, /* Device context */
&LeadBitmap,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY, /* ROP3 code for a Normal Paint */
EFFECT_SPIRAL_IN); /* Spiral effect */
/* Restore the old palette */
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_PaintDCOverlay

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintDCOverlay(hDC, pBitmap, nIndex, pSrc, pClipSrc, pDst, pClipDst, uROP3);

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle containing the overlay */
L_INT nIndex; | /* the index of the overlay bitmap used for painting */
LPRECT pSrc; | /* the source rectangle (in pBitmap coordinates, not in overlay coordinates!) */
LPRECT pClipSrc; | /* the source clipping rectangle (in pBitmap coordinates, not in overlay coordinates!) */
LPRECT pDst; | /* the destination rectangle (in pBitmap coordinates, not in overlay coordinates) */
LPRECT pClipDst; | /* the destination clipping rectangle (in pBitmap coordinates, not in overlay coordinates) */
L_UINT32 uROP3; | /* windows ROP code for display */

Paints the overlay at the specified index. Use this function to paint overlays that are not automatically painted.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay used for painting. The overlay should have a bitmap. If the overlay is embedded into a bitmap bitplane, make sure you create an overlay bitmap prior to calling this function. This index is zero-based.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the main bitmap. You can pass NULL to use the default, which matches the main bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the main bitmap. You can pass NULL to use the default, which matches the main bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uFlags | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will paint an overlay bitmap. For more information on the paint rectangles, see L_PaintDC. L_PaintDC will paint all the overlays that have OVERLAY_AUTOPAINT set in the uFlags member of the OVERLAYATTRIBUTES structure. The overlays are painted in ascending index order: overlay 0 is painted first, then overlay 1, etc.

Use this function to manually paint an overlay. For example, to change the order in which the overlays are painted, clear the OVERLAY_AUTOPAINT flag from the uFlags member of the overlay's OVERLAYATTRIBUTES structure and call L_PaintDCOverlay directly.

To temporarily make an overlay top-most, call L_PaintDCOverlay after L_PaintDC. To permanently make an overlay top-most, change its index and give it the highest defined index.

The overlay bitmap’s 1 pixels are painted with the color set in the crColor member of the OVERLAYATTRIBUTES structure. The overlay bitmap’s 0 pixels are considered transparent.

For more information on the overlay attributes, including the OVERLAY_AUTOPAINT flag and crColor, refer to OVERLAYATTRIBUTES.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PaintDC, L_SetOverlayAttributes, L_UpdateBitmapOverlayBits, L_SetOverlayBitmap, OVERLAYATTRIBUTES, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Combining Images
 | Overlay Overview

Example

/* This example assumes pBitmap contains overlays. It will make it look as if overlay 0 is topmost */
/* The example also assumes hDC and pDest have been initialized elsewhere */
L_PaintDC(hDC, pBitmap, NULL, NULL, pDest, NULL, SRCCOPY);
L_PaintDCOverlay(hDC, pBitmap, 0, NULL, NULL, pDest, NULL, SRCCOPY);
/* Now overlay 0 is topmost (it covers all the other overlays) */


L_PaintRgnDC

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintRgnDC(hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */

Paints the bitmap region to a device context. This function works the same as L_PaintDC, except that only the bitmap region is painted.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_PaintRgnDCBuffer, L_PaintRgnDCEffect, L_WindowLevel, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes
 | Implementing Transparency

Example

For complete sample code, refer to the FEATURE3 example.

/* This example shows the minimum requirements for painting
the current region of a bitmap using the bitmap’s palette */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
HDC hdc; /* Device context for the current window */
RECT rLeadDest; /* Destination rectangle for painting */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context */
hdc = GetDC (hWnd);
/* Set the destination rectangle to be the same as the bitmap.
Other painting rectangles can take defaults. */
SetRect(&rLeadDest, 0, 0, BITMAPWIDTH(&LeadBitmap), BITMAPHEIGHT(&LeadBitmap));
/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette (hdc, &LeadBitmap);
/* Select our palette and save the old one */
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
/* Paint the image */
L_PaintRgnDC ( hdc, /* Device context */
&LeadBitmap,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY); /* ROP3 code for a Normal Paint */
/* Restore the old palette */
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_PaintRgnDCBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintRgnDCBuffer (hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3, pBuffer, nRow, nCount)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */
L_UCHAR L_FAR * pBuffer; | /* pointer to the source buffer */
L_INT nRow; | /* first row to paint */
L_INT nCount; | /* number of rows to paint */

Paints image data into a device context from a buffer. This function works the same as L_PaintDCBuffer, except that only the bitmap region is painted.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
pBuffer | Pointer to the buffer that contains the image data to paint.
nRow | The first row to paint. The painted portion of any row may be limited by the RECT parameters.
nCount | The number of rows to paint. The painted portion of any row may be limited by the RECT parameters.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bitmap must be allocated before you can create a region for it. Therefore, if you use this function in a paint-while-load routine, you must use your callback function to create the region after the bitmap is allocated.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_PaintRgnDC, L_PaintRgnDCEffect, L_WindowLevel, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

For complete sample code, refer to the FEATURE3 example.

/* This FILEREADCALLBACK function creates a region and paints the
region as it loads the file. */
/**************** Global declarations **************************************/
BITMAPHANDLE LeadBitmap; /* Bitmap handle */
HPALETTE hpalPaint; /* Paint palette handle */
HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
RECT rLeadDest; /* Destination rectangle for painting */
RECT rLeadSource; /* Source rectangle for painting */
FILEINFO FileInfo; /* LEAD File Information structure. */
/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
} IMAGECBPARM;
/*******************************************************************************/
L_INT L_EXPORT EXT_CALLBACK LoadImageCB(pFILEINFO pFileInfo, pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData )
{
RGNXFORM XForm; /* Structure for transforming display coordinates */
RECT rRgnRect; /* Rectangle that defines the region */
RECT rClientSize;
/* If this is the first call (nRow = 0), select and realize the palette;
and create the region to be painted */
if((uFlags & FILEREAD_FIRSTPASS) && (uFlags & FILEREAD_FIRSTROW))
{
/* Set the source rectangle to use the whole bitmap */
SetRect(&rLeadSource, 0, 0, pFileInfo->Width, pFileInfo->Height);
SendMessage (pUserData->hwnd, WM_QUERYNEWPALETTE, 0, 0L);
SelectPalette( pUserData->hdc, hpalPaint, TRUE );
RealizePalette(pUserData->hdc);
/* Set RGNXFORM fields, */
XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = pFileInfo->Width;
XForm.nXScalarDen = rLeadDest.right - rLeadDest.left;
XForm.nYScalarNum = pFileInfo->Height;
XForm.nYScalarDen = rLeadDest.bottom - rLeadDest.top;
XForm.nXOffset = 0;
XForm.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientSize.right/8, rClientSize.bottom/8,
rClientSize.right/2, rClientSize.bottom/2);
/* Create an elliptical region */
L_SetBitmapRgnEllipse(&LeadBitmap, &XForm, &rRgnRect, L_RGN_SET);
}
/* Paint the buffer to the specified device context */
L_PaintRgnDCBuffer( pUserData->hdc, /* Device context - from function parameter */
pBitmap, /* Bitmap handle - from function parameter */
&rLeadSource, /* Source rect - set globally in WM_CREATE */
&rLeadSource, /* Source clip rect - same as source rect */
&rLeadDest, /* Destination rect - set globally in WM_CREATE */
&rLeadDest, /* Destination clip rect - same as destination rect */
SRCCOPY, /* Normal ROP code for painting */
pBuffer, /* Input buffer - from function parameter */
nRow, /* First row in buffer - from function parameter */
nLines ); /* Number of lines in the buffer - from function parameter */
return( SUCCESS );
}


L_PaintRgnDCEffect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PaintRgnDCEffect (hDC, pBitmap, pSrc, pClipSrc, pDst, pClipDst, uROP3, uEffect)

HDC hDC; | /* handle to the target device context */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT pSrc; | /* pointer to the display source rectangle */
LPRECT pClipSrc; | /* pointer to the display source clipping rectangle */
LPRECT pDst; | /* pointer to the display destination rectangle */
LPRECT pClipDst; | /* pointer to the display destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display */
L_UINT uEffect; | /* effect to apply when painting */

Applies an effect when painting a bitmap region to a device context. This function works the same as L_PaintDCEffect, except that only the bitmap region is painted.

Parameter | Description
hDC | Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap that has the region to paint.
pSrc | Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pClipSrc | Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed.
 | The coordinates in the RECT structure are relative to the bitmap. You can pass NULL to use the default, which matches the bitmap.
pDst | Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context.
 | The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.
pClipDst | Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up.
 | The coordinates in the RECT structure are relative to the device context. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message.
uROP3 | The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.
uEffect | The effect to apply when painting. For valid values, refer to Effects.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Multipass painting for the EFX_EFFECT_PUSH_CLASS is disabled.

Required DLLs and Libraries

LTEFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FrameBitmapRgn, L_PaintRgnDC, L_PaintRgnDCBuffer, L_WindowLevel, L_RectToBitmap, L_RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

For complete sample code, refer to the FEATURE3 example.

/* This example shows the minimum requirements for using L_PaintRgnDCEffect
to paint the current region of a bitmap using the bitmap’s palette */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
HDC hdc; /* Device context for the current window */
RECT rLeadDest; /* Destination rectangle for painting */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context */
hdc = GetDC (hWnd);
/* Set the destination rectangle to be the same as the bitmap.
Other painting rectangles can take defaults. */
SetRect(&rLeadDest, 0, 0, BITMAPWIDTH(&LeadBitmap), BITMAPHEIGHT(&LeadBitmap));
/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette (hdc, &LeadBitmap);
/* Select our palette and save the old one */
hSavedPalette = SelectPalette (hdc, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hdc);
/* Paint the image */
L_PaintRgnDCEffect ( hdc, /* Device context */
&LeadBitmap,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rLeadDest, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY, /* ROP3 code for a normal paint */
EFFECT_SPIRAL_IN); /* Spiral effect */
/* Restore the old palette */
SelectPalette (hdc, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hdc);
return;
}


L_PerlinBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PerlinBitmap(pBitmap, uSeed, uFrequency, uIteration, uOpacity crBClr, crFClr, nxCircle, nyCircle, nFreqLayout, nDenLayout, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT32 uSeed; | /* seed value for the randomization process */
L_UINT uFrequency; | /* x and y axis frequency */
L_UINT uIteration; | /* number of iterations */
L_UINT uOpacity; | /* percent combination */
COLORREF crBClr; | /* background color */
COLORREF crFClr; | /* foreground color */
L_INT nxCircle; | /* x coordinate of the center point of the layout circles */
L_INT nyCircle; | /* y coordinate of the center point of the layout circles */
L_INT nFreqLayout; | /* layout frequency */
L_INT nDenLayout; | /* layout density */
L_UINT uFlags; | /* flags */

Uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
uSeed | 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.
uFrequency | Value that represents the frequency component for both the x and y axis. Possible values range from 0 to 16. No noise is created if the value is 0. Increasing this value increases the noise.
uIteration | Value that represents the number of iterations that will be calculated. Possible 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.
uOpacity | Value that represents the percentage to be used when combining the original bitmap with the noise. Possible values range from 0 through 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.
crBClr | A COLORREF value that represents the background color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
crFClr | A COLORREF value that represents the foreground color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
nxCircle | The x coordinate, in pixels and in bitmap coordinates, for the center point of the concentric circles. Possible values range from 0 to the width of the bitmap. This parameter is only used if the PRL_CIRCLE flag is set.
nyCircle | The y coordinate, in pixels and in bitmap coordinates, for the center point of the concentric circles. Possible values range from 0 to the height of the bitmap. This parameter is only used if the PRL_CIRCLE flag is set.
nFreqLayout | 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. Possible values range from 0 through 100. Increase this value to increase the number of circles or lines drawn.
nDenLayout | Value that represents the density of the layout for the produced noise. Possible values range from 0 through 100. When using a low nDenLayout value the noise will appear with light color.
uFlags | 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 | [0x00] Produce noise as a new bitmap.
 | PRL_COMBINE | [0x01] Combine the noise and the bitmap pixels using the uOpacity value.
 | PRL_DIFFERENCE | [0x02] Apply the difference between the noise and the bitmap pixels.
 | The following flags indicate which layout pattern to use for the noise:
 | PRL_CIRCLE | [0x00] Lay out the noise in concentric circles. Set the center for the circle using nxCircle and nyCircle.
 | PRL_LINE | [0x10] Lay out the noise in lines at a 45 degree angle.
 | PRL_RANDOM | [0x20] Lay out the noise randomly.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture. Depending 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 L_PerlinBitmap function.

This function is similar to the L_CloudsBitmap function in that they both use Perlin equations to generate pseudo-random noise, but each function applies different equations to the noise to produce the texture.

Use the L_AddBitmapNoise function in order to add random noise to a bitmap.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgAddNoise , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_AddBitmapNoise

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Using the L_PerlinBitmap function

Example

/* The following example loads a bitmap and adds Perlin noise to it: */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Add noise to the bitmap with automatic seeding, and using a frequency value of 10, */
/* a number of iterations value of 8, a percent of combination value of 50, */
/*a black background, a red foreground, */
/*with the center point of the noise circles in the middle of the bitmap, */
/*a layout frequency value of 4, a noise layout density value of 20 */
/*and lay out the noise in circles in a new bitmap*/
L_PerlinBitmap(&LeadBitmap, 0, 10, 8, 50, RGB (0, 0, 0), RGB (255, 0, 0), (L_INT) Leadbitmap.Width / 2, (L_INT) Leadbitmap.Height / 2, 4, 20, PRL_PURE |PRL_CIRCLE);


L_PerspectiveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PerspectiveBitmap(pBitmap, pPoints, crBkgColor, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT L_FAR * pPoints; | /* pointer to an array of points */
COLORREF crBkgColor; | /* background color */
L_UINT uFlag; | /* flag */

Gives a bitmap a 3-D effect, as if it exists on a flat plane and has been skewed into a different shape. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
pPoints | Pointer to an array of points that determine the new locations of image corners. It should contain four points; points at indices 0, 1, 2 and 3 determine the new locations of left-top, right-top, left-bottom and right-bottom image corners respectively.
crBkgColor | Background color.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_SpherizeBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images
 | Raster Image Functions: Processing an Image

Example

/* The following example loads a bitmap, and applies the 3D perspective effect*/BITMAPHANDLE LeadBitmap;POINT pNewLocations [4];
/* Load the bitmap, keeping the bits per pixel of the file */L_LoadBitmap (TEXT("Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
pNewLocations [0].x=LeadBitmap.Width*3/9;
pNewLocations [0].y=LeadBitmap.Height*1/12;
pNewLocations [1].x=LeadBitmap.Width*3/4;
pNewLocations [1].y=LeadBitmap.Height*2/12;
pNewLocations [2].x=LeadBitmap.Width*2/10;
pNewLocations [2].y=LeadBitmap.Height*8/10;
pNewLocations [3].x=LeadBitmap.Width*10/11;
pNewLocations [3].y=LeadBitmap.Height*7/10;

/*Apply the filter*/
L_PerspectiveBitmap(&LeadBitmap, pNewLocations,RGB(255,255,255), PERSPECTIVE_IMAGE);


L_PicturizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PicturizeBitmap(pBitmap, pszDirName, uFlags, nCellWidth, nCellHeight, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_TCHAR L_FAR * pszDirName; | /* specific directory */
L_UINT uFlags; | /* flags */
L_INT nCellWidth; | /* width of the rectangles */
L_INT nCellHeight; | /* height of the rectangles */
PICTURIZECALLBACK pfnCallback; | /* notification callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Replaces the current image with an image created using images present in the specified directory.

Parameter | Description
PBitmap | Pointer to the bitmap handle referencing the bitmap to which the process will be applied.
pszDirName | Character string containing the directory that contains the images. Only images from this directory will be used. Images in any subdirectories will NOT be used.
UFlags | 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. This causes a big improvement in the speed of the process. It is recommended to use it if you have enough memory to hold all the images
 | PICTURIZE_RESIZE | [0x0002] Resize the images that are not the required size (nCellWidth x nCellHeight).
 | PICTURIZE_RESAMPLE | [0x0004] Resample the images that are not the required size (nCellWidth x nCellHeight). (slower process, better quality)
 | PICTURIZE_ONCE | [0x0010] Use the 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 nCellWidth x nCellHeight
nCellWidth | Width of the images used to reconstruct the image.
nCellHeight | Height of the images used to reconstruct the image.
pfnCallback | Callback function which can be used for keeping track of the process, in addition to the status callback function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The image, or selected region, is broken down into rectangles of size nCellWidth x nCellHeight. For each rectangle, the image in the directory that is best suited to replace that rectangle is inserted into the original image.

pBitmap is updated only once for every row of lines, where each line has a height dimension of nCellHeight. Therefore, the pfnCallback can be used to show the progress of every cell. For more information, refer to the PICTURIZECALLBACK callback function.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

On an 8 BPP display, it is recommended that you create a fixed palette before you start the picturize process and use it to paint all the bitmaps. All the bitmaps which will be passed to the picturize callback will be 24BPP so a fixed palette is best. It is faster to create the palette before you start painting rather than creating it every time you paint a little square.

If PICTURIZE_BESTFIT is set, then nCellWidth and nCellHeight 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 nCellWidth and nCellHeight. 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 nCellWidth and nCellHeight.

If the bitmap width and height are not multiples of nCellWidth and nCellHeight 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 function.

When PICTURIZE_ONCE is set, the function will try not to use the same bitmap twice. Note that if there aren’t enough images, the function will return the ERROR_NOT_ENOUGH_IMAGES code if this flag is set.

When PICTURIZE_EQUALUSAGE is set, the function 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 that will be used ‘n+1’ times.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | PICTURIZECALLBACK, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Processing an Image

Example

For complete sample code, see the main DLL demo.

This example will assume that the original bitmap was painted at 100% zoom factor and that there are no scroll bars. It also assumes that we are painting on a display that doesn't need palettes. We imposed all the above limitations for simplicity and to make the code easier to understand.

L_INT nRet;
HWND hWnd;
pBITMAPHANDLE pBitmap;

FARPROC pfnUpdateRectCallback = MakeProcInstance ((FARPROC)
UpdateRectCallback, hInst);

// Picturize the bitmap in pBitmap
// - use all the images in c:\thumbs directory
// - load all images and resize the ones that are not the desired size
// - use 32x32 images
// - use UpdateRectCallback callback to show the progress
nRet = L_PicturizeBitmap(pBitmap,
TEXT("c:\\thumbs"),
PICTURIZE_LOADALL|PICTURIZE_RESIZE,
32, 32,
(PICTURIZECALLBACK)pfnUpdateRectCallback,
(L_VOID L_FAR*)hWnd);

FreeProcInstance(pfnUpdateRectCallback);
.
.
.
L_INT L_EXPORT EXT_CALLBACK UpdateRectCallback(pBITMAPHANDLE pThumb,
L_UINT x, L_UINT y, L_VOID L_FAR*pUserData)
{
HWND hWnd = (HWND)pUserData;
RECT rcDest;
HDC hdc = GetDC(hWnd);

// assume that the original bitmap was viewed at 100% zoom factor.
// Also assume that we are painting on a 24BPP display.
SetRect(&rcDest, x, y, x + pThumb->Width, y + pThumb->Height);

// paint the bitmap at (x,y) coordinates
L_PaintDC(hdc, pThumb, NULL, NULL, &rcDest, NULL, SRCCOPY);

ReleaseDC(hWnd, hdc);

// return an error code if you want to abort the process
return SUCCESS;
}


L_PicturizeBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PicturizeBitmapList(pBitmap, uCellWidth, uCellHeight, uLightnessFact, hList)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uCellWidth; | /* thumbnail width */
L_UINT uCellHeight; | /* thumbnail height */
L_UINT uLightnessFact; | /* lightness factor */

HBITMAPLIST hList;

/* handle to a list of bitmaps */

Picturizes the specified bitmap using thumbnail images created from the specified bitmap list.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be picturized.
uCellWidth | Width of the thumbnail bitmap.
uCellHeight | Height of the thumbnail bitmap.
uLightnessFact | 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.
hList | Handle to the list of bitmaps used to create the thumbnail images which are in turn used to picturize the specified image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The image, or selected region, is broken down into rectangles of size uCellWidth x uCellHeight. 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 uLightnessFact parameter can be used to change the lightness of the big image by changing the lightness of each rectangle.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PicturizeBitmap, L_PicturizeBitmapSingle, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* This example loads a bitmap and picturize it with a predefined list . */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
HBITMAPLIST hList;
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* picturize the bitmap with the predefined list (hList) */
L_PicturizeBitmapList(&LeadBitmap,20,15,200,hList);


L_PicturizeBitmapSingle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PicturizeBitmapSingle(pBitmap, pThumbBitmap, uCellWidth, uCellHeight, uLightnessFact)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pBITMAPHANDLE pThumbBitmap; | /* pointer to the thumbnail bitmap handle */
L_UINT uCellWidth; | /* thumbnail width */
L_UINT uCellHeight; | /* thumbnail height */
L_UINT uLightnessFact; | /* lightening or darkening value */

Picturizes the specified bitmap using the specified thumbnail image.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be picturized.
pThumbBitmap | Pointer to the bitmap handle that references the bitmap used to create the thumbnail.
uCellWidth | Width of the thumbnail bitmap.
uCellHeight | Height of the thumbnail bitmap.
uLightnessFact | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The image, or selected region, is broken down into rectangles of size uCellWidth x uCellHeight. 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 uLightnessFact parameter can be used to change the lightness of the big image by changing the lightness of each rectangle.

This function supports 12 and 16-bit87 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PicturizeBitmap, L_PicturizeBitmapList, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

/* This example loads a bitmap and picturize it with the same bitmap. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/*Picturize the bitmap */
L_PicturizeBitmapSingle(&LeadBitmap, &LeadBitmap,20,15,200);


L_PixelateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PixelateBitmap(pBitmap, uCellWidth, uCellHeight, uOpacity, CenterPt, uFlags);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uCellWidth; | /* cell width */
L_UINT uCellHeight; | /* cell height */
L_UINT uOpacity; | /* transparency percent */
POINT CenterPt; | /* effect center */
L_UINT uFlags; | /* flags */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uCellWidth | 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 uFlags.
 | If uFlags contains: | then, uCellWidth contains: | and the range of possible values for uCellWidth is:
 | PIX_RAD | PIX_WFRQ | the number of cells around the CenterPt. That is, the circle around the CenterPt is divided into uCellWidth equal parts, as shown below: | 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 CenterPt. That is, the circle around the CenterPt is divided into cells of uCellWidth degrees, as shown below: | 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.
uCellHeight | 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 uFlags.
 | If uFlags contains: | then, uCellHeight contains: | and the range of possible values for uCellHeight 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.

uOpacity | Value that represents how transparent the cells are, compared to the original pixels. This is a percentage. Possible values are 0 – 100. (0 is the total transparency and 100 is the total opacity.)
CenterPt | Point that represents the center of revolution when circular cells are used. This parameter will be ignored if PIX_RECT is set in uFlags.
uFlags | Flags that indicate the values used to fill the cells, the shape of the cells, and what type of data is in the uCellWidth and uCellHeight 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 uCellWidth value contains the cell width in pixels or the number of cells across the width of the bitmap. uCellHeight 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 CenterPt. If this flag is used, the uCellWidth value determines the angular component of the cell, and uCellHeight 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 the indicate what information is contained in the uCellWidth and uCellHeight 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will divide the image into rectangular or circular cells.

The uFlags 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 uFlags parameter, the cells will be centered around the specified CenterPt. 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.

Support for 12- and 16-bit grayscale images are available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

uFlags = PIX_RAD | PIX_WPER | PIX_HPER | PIX_AVR
uCellWidth = 90, uCellHeight = 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:

uFlags = PIX_RAD | PIX_WFRQ | PIX_HFRQ | PIX_AVR
uCellWidth = 90, uCellHeight = 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgPixelate , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* divide the image in to circular cells with angle length = 5°, and radius = 10 */
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_PixelateBitmap (&LeadBitmap, 5, 10, 100, CenterPt, PIX_AVR | PIX_RAD | PIX_WPER | PIX_HPER);


L_PlaneBendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PlaneBendBitmap(pBitmap, ptCenterPoint, uZValue, nDistance, uPlaneOffset, nRepeat, nPydAngle, uStretch, uBendFactor, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT ptCenterPoint; | /* point at which the viewer is looking */
L_UINT uZValue; | /* viewing screen offset on the Z-axis */
L_INT nDistance; | /* camera distance from the viewing screen */
L_UINT uPlaneOffset; | /* distance between planes */
L_INT nRepeat; | /* number of repeats */
L_INT nPydAngle; | /* view angle */
L_UINT uStretch; | /* compression factor */
L_UINT uBendFactor; | /* bending factor */
L_UINT uStartBright; | /* brightness of an external light source on the first bitmap displayed */
L_UINT uEndBright; | /* brightness of an external light source on the last bitmap displayed */
L_UINT uBrightLength; | /* changes in brightness along the Z axis */
COLORREF crBright; | /* color of an external light source that is shined on the bitmaps */
COLORREF crFill; | /* background color */
L_UINT uFlags; | /* flags */

Places the bitmap on parallel planes along the Z-axis, and bends the planes toward the center point. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
ptCenterPoint | POINT structure that contains 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.
uZValue | Viewing screen offset on the Z-axis, in pixels.
nDistance | Camera distance from the viewing screen, in pixels.
uPlaneOffset | Distance between the parallel planes.
nRepeat | Number of times the bitmap repeats along the Z-axis. If nRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.
nPydAngle | 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.
uStretch | Value that indicates whether to expand or compress the bitmap, and by how much. If uStretch < 100 bitmap will be expanded. If uStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.
uBendFactor | Determines the plane’s bending value. The range starts at 100 and increases indefinitely. If uBendFactor equals 100 the planes will not be bent.If uBendFactor > 100 planes will be bent. The value of this parameter is internally divided by 100.
uStartBright | 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.
uEndBright | 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.
uBrightLength | Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.
crBright | The COLORREF value that specifies the color of an external light source that shines on the displayed bitmaps.
crFill | The COLORREF value that specifies the background color.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uBrightLength value. The line of bitmaps may be bent toward a specified point by setting a bending value in the uBendFactor parameter.

By changing ptCenterPoint 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.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

CenterPoint(x,y)= (640,256)
uZValue = 0
nDistance= 256
uPlaneOffset= 256
nRepeat= -1
nPydAngle= 0
uStretch= 100
uBendFactor= 500
uStartBright= 0
uEndBright= 0
uBrightLength= 50
crBright= RGB(255,255,255)
crFill= RGB(0,0,0)
uFlags= PLANE_FILL_CLR|PLANE_DOWN

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreePlaneBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_FreeRadBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Raster Image Functions: Artisitic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* put the image on upper and lower parallel planes bended toward the center point*/
CenterPt.x = LeadBitmap.Width;
CenterPt.y = LeadBitmap. Height/2;

L_PlaneBendBitmap(&LeadBitmap, CenterPt, 0, LeadBitmap.Height, LeadBitmap.Width/2, -1, 0, 100,400,0,100, 20000, RGB(255,0,0), RGB(0,0,0), PLANE_DOWN | PLANE_UP | PLANE_FILL_CLR);


L_PlaneBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PlaneBitmap(pBitmap, ptCenterPoint, uZValue, nDistance, uPlaneOffset, nRepeat nPydAngle, uStretch, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT ptCenterPoint; | /* point at which the viewer is looking */
L_UINT uZValue; | /* viewing screen offset on the Z-axis */
L_INT nDistance; | /* camera distance from the viewing screen */
L_UINT uPlaneOffset; | /* distance between planes */
L_INT nRepeat; | /* number of repeats */
L_INT nPydAngle; | /* view angle */
L_UINT uStretch; | /* compression factor */
L_UINT uStartBright; | /* brightness of an external light source on the first bitmap displayed */
L_UINT uEndBright; | /* brightness of an external light source on the last bitmap displayed */
L_UINT uBrightLength; | /* changes in brightness along the Z axis */
COLORREF crBright; | /* color of an external light source that is shined on the bitmaps */
COLORREF crFill; | /* background color */
L_UINT uFlags; | /* flags */

Places the bitmap on parallel planes along the Z-axis. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
ptCenterPoint | POINT structure that contains the point at which the camera or viewer is looking. It may be outside the bitmap borders.
uZValue | Viewing screen offset on the Z-axis, in pixels.
nDistance | Camera distance from the viewing screen, in pixels.
uPlaneOffset | Distance between the parallel planes.
nRepeat | Number of times the bitmap repeats along the Z-axis. If nRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.
nPydAngle | 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.
uStretch | Value that indicates whether to expand or compress the bitmap, and by how much. If uStretch < 100 bitmap will be expanded. If uStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.
uStartBright | 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.
uEndBright | 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.
uBrightLength | Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.
crBright | The COLORREF value that specifies the color of an external light source that shines on the displayed bitmaps.
crFill | The COLORREF value that specifies the background color.
uFlags | 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. 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uBrightLength value.

By changing ptCenterPoint 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.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

CenterPoint(x,y)= (320,256)
uZValue = 0
nDistance= 256
uPlaneOffset= 256
nRepeat= -1
nPydAngle= 0
uStretch= 100
uStartBright= 0
uEndBright= 0
uBrightLength= 50
crBright= RGB(255,255,255)
crFill= RGB(0,0,0)
uFlags= PLANE_FILL_CLR|PLANE_DOWN

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreePlaneBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_FreeRadBendBitmap, L_PlaneBendBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Raster Image Functions: Artisitic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* put the image on left and right parallel planes*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;

L_PlaneBitmap(&LeadBitmap, CenterPt, 0, LeadBitmap.Height, LeadBitmap.Width/2, -1,0,25,0,100, 20000, RGB(255,0,0), RGB(0,0,0), PLANE_RIGHT | PLANE_LEFT | PLANE_FILL_CLR);


L_PlasmaFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PlasmaFilterBitmap(pBitmap, pPlasmaInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPPLASMAINFO pPlasmaInfo; | /* pointer to a structure */

Applies color patterns that blend into each other like plasma. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pPlasmaInfo | Pointer to a PLASMAINFO structure that contains information about the plasma effect.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

As an example, suppose you call the L_PlasmaFilterBitmap function, using a uOpacity value of 0, which means that no image is to be used, and you use the following settings:

Parameter | Value
uShift | 0
uOpacity | 0
uSize | 1000
uFlags | PLSTYP_RANDOM1 | PLSCLR_RGB2

The following figure results:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MaskConvolutionBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgPixelate , L_PixelateBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

/* The following example applies a diagonal plasma effect by adding and blending color patterns onto the given image */
PLASMAINFO PlasmaInfo;
BITMAPHANDLE LeadBitmap;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
PlasmaInfo.uStructSize = sizeof(PLASMAINFO);
PlasmaInfo.uShift = 0;
PlasmaInfo.uOpacity = 50;
PlasmaInfo.uSize = 300;
PlasmaInfo.uFlags = PLSTYP_DIAGONAL | PLSCLR_RGB2;
L_PlasmaFilterBitmap (&LeadBitmap, &PlasmaInfo);


L_PointFromBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PointFromBitmap(pBitmap, ViewPerspective, px, py)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT ViewPerspective; | /* destination view perspective */
L_INT L_FAR * px; | /* address of the x coordinate variable */
L_INT L_FAR * py; | /* address of the y coordinate variable */

Translates a point (x,y) from the bitmap's view perspective to the specified view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that contains the point.
ViewPerspective | Destination view perspective to which the point should be translated.
px | Address of variable for the X coordinate of the point.
py | Address of variable for the Y coordinate of the point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare variables for the X and Y coordinates of a point.
2. | Assign the values of a known point in the bitmap.
3. | Call this function, passing the addresses of the variables, and specifying the destination view perspective. (The function gets the source view perspective from the bitmap handle.)
4. | Get the translated point from the variables, which this function has updated.

For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PointToBitmap, L_RectFromBitmap, L_RectToBitmap, L_ChangeBitmapViewPerspective, L_RotateBitmapViewPerspective
Topics: | Accounting for View Perspective

Example

/* This example finds out where the origin of the bitmap would be */
/* in a TOP_LEFT90 ViewPerspective */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
L_INT x = 0, y = 0;
L_PointFromBitmap ( &LeadBitmap, TOP_LEFT90, &x, &y );


L_PointillistBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PointillistBitmap(pBitmap, uSize, crFillColor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uSize; | /* dot size */
COLORREF crFillColor; | /* background color */
L_UINT uFlags; | /* flags */

Converts image colors into randomly placed dots to create a pointillist painting, and uses the background color to fill the area between dots. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uSize | Dot size, in pixels.
crFillColor | Fill color.
uFlags | 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 crFillColor.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_PointillistBitmap using the following values:

Parameter | Value
uSize | 4
crFillColor | Black
uFlags | POINTILLIST_COLOR | POINTILLIST_STICKER

The following figure results:

Use the L_RomanMosaicBitmap function 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 L_MosaicBitmap function 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 L_PixelateBitmap function 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 L_MosaicTilesBitmap function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_DefaultDithering, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_HalfToneBitmap, L_MosaicBitmap, L_PixelateBitmap, L_MosaicTilesBitmap, L_RomanMosaicBitmap, L_CubismBitmap, L_DiceEffectBitmap, L_GlassEffectBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_CanvasBitmap, L_BricksTextureBitmap
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images

Example

/* The following example loads a bitmap, and applies the pointillist filter */

BITMAPHANDLE LeadBitmap;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/*Apply the filter*/
L_PointillistBitmap(&LeadBitmap, 25, RGB(255,255,255), POINTILLIST_COLOR | POINTILLIST_POINT);


L_PointToBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PointToBitmap(pBitmap, ViewPerspective, px, py)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT ViewPerspective; | /* source view perspective */
L_INT L_FAR * px; | /* address of the x coordinate variable */
L_INT L_FAR * py; | /* address of the y coordinate variable */

Translates a point (x,y) from the specified view perspective to the bitmap's view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
ViewPerspective | Source view perspective from which the point should be translated.
px | Address of variable for the X coordinate of the point.
py | Address of variable for the Y coordinate of the point.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare variables for the X and Y coordinates of a point.
2. | Assign the values of a known point using the coordinates of the source view perspective.
3. | Call this function, passing the addresses of the variables, and specifying the source view perspective. (The function gets the destination view perspective from the bitmap handle.)
4. | Get the translated point from the variables, which this function has updated.

For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PointFromBitmap, L_RectFromBitmap, L_RectToBitmap, L_ChangeBitmapViewPerspective, L_RotateBitmapViewPerspective
Topics: | Accounting for View Perspective

Example

/* This example finds out where a point in the TOP_LEFT90 ViewPerspective */
/* actually is in the bitmap */
BITMAPHANDLE LeadBitmap;
L_INT x = 0, y = 0;
L_PointToBitmap ( &LeadBitmap, TOP_LEFT90, &x, &y );


L_PolarBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PolarBitmap(pBitmap, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Converts the bitmap from rectangular to polar coordinates and vice versa. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function converts a bitmap from Cartesian (rectangular) coordinates to polar coordinates or 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 function 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 the bitmap contains 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgPolar , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* convert to polar coordinate */
L_PolarBitmap (&LeadBitmap, 0, FILL_RPT | CART_TO_POL);


L_PosterizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PosterizeBitmap(pBitmap, uLevels)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uLevels; | /* number of color levels to use */

Imposes a poster effect on a 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.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uLevels | The number of color levels to use. Valid values are 2 through 64.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SharpenBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgPosterize , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and posterizes it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply a poster effect with six color levels per plane */
L_PosterizeBitmap(&LeadBitmap, 6 );


L_PreLoadFilters

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PreLoadFilters(nFixedFilters, nCachedFilters, pszFilters)

L_INT nFixedFilters; | /* number of filters that stay loaded */
L_INT nCachedFilters; | /* number of filters that are loaded, but may be unloaded later */
L_TCHAR L_FAR * pszFilters; | /* character string containing filters */

Specifies the file format filters to be loaded.

Parameter

Description

nFixedFilters

Number of filters that should stay loaded in memory at all times.

nCachedFilters

Number of filters that should be loaded, but can be unloaded later to make room for other filters.

pszFilters

Character 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. pszFilters is in the form xyz, yuv... where XYZ are the 3 letters describing the file filter as in LFxyz14W.DLL or LFxyz14n.dll. For instance, if pszFilter is PCX,TIF,CMP then LFPCX14n.dll will be loaded then LFTIF14n.dll and then LFCMP14n.dll will be loaded. The first nFixedFilters will stay in memory at all times, then the next nCachedFilters 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 LFAVI14n.dll or LFFPX14n.dll) so the exact number of DLLs loaded is not necessarily nFixedFilters + nCachedFilters. For more information on available DLLs, refer to Files To Be Included With Your Application.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 other third party libraries loading DLLs, or if the programming environments themselves load many DLLs. You can use this function to restrict the number of file import/export DLLs that LEADTOOLS will load. Note that the fewer DLLs loaded, the slower the loading/saving of files will be, since there will be more loading/unloading of DLLs.

Please note that L_PreLoadFilters has effect only if called before the first time you try to load, save or get information about a file. If you try to load, save or get information about a file without calling L_PreLoadFilters first, LEAD loads default filters. For more information, refer to Loading File Filters.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_IgnoreFilters
Topics | Raster Image Functions: Input/Output File Filters,

Example

This example preloads the BMP, PCX, and TIFF filters, and allows 1 filter to be cached, while always keeping 2 loaded.

L_PreLoadFilters( 2, 1, TEXT("BMP,PCX,TIF"));


L_PrintBitmap

#include "l_bitmap.h"

HDC EXT_FUNCTION L_PrintBitmap(hDC, pBitmap, nX, nY, nWidth, nHeight, fEndDoc)

HDC hDC; | /* handle to the target device context (DC) */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nX; | /* x position to start the print */
L_INT nY; | /* y position to start the print */
L_INT nWidth; | /* printed width */
L_INT nHeight; | /* printed height */
L_BOOL fEndDoc; | /* end of document indicator */

Prints a bitmap to a the specified device. (This is the same as the L_PrintBitmap function, except that you can specify the device.)

Parameter | Description
hDC | Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT. Pass NULL to let the function use the system's default printer.
pBitmap | Pointer to the bitmap handle referencing the bitmap to print.
nX | X position to start the print. Pass a 0 to center the image horizontally on the page.
nY | Y position to start the print. Pass a 0 to center the image vertically on the page.
nWidth | The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.
 | Pass a 0 to let the function calculate the width. If you specify only the width or only the height, the function calculates the remaining dimension. If you pass zeros for both width and height, the function calculates the maximum dimensions that fit on the page while preserving the aspect ratio.
nHeight | The printed height. The value is in dots, and the actual height depends on the dots per inch (DPI) of the printer.
 | Pass a 0 to let the function calculate the height. If you specify only the width or only the height, the function calculates the remaining dimension. If you pass zeros for both width and height, the function calculates the maximum dimensions that fit on the page while preserving the aspect ratio.
fEndDoc | This is used to let LEADTOOLS know whether you plan to print another image on the same page or not.
 | Value | Meaning
 | TRUE | LEADTOOLS will free the hDC and send a paper eject.
 | FALSE | LEADTOOLS will assume that you plan to print another bitmap.

Returns

>0 | Function was successful. If bEndDOC is FALSE, the return value is the printer HDC.
0 | An error occurred.

Comments

You can specify the position and dimensions of the printed image, or let the function calculate values for you as follows:

You can specify the X and Y offsets of the image, or you can let the function center the image vertically, horizontally, or both.

You can specify the width, and let the function calculate the height to preserve the aspect ratio.

You can specify the height, and let the function calculate the width to preserve the aspect ratio.

You can let the function calculate the maximum printed width and height, while preserving the aspect ratio.

The function is designed to let you print multiple bitmaps on the same page. To do so, call the function with the fEndDoc argument set to FALSE for each image except the last one on the page. Then call the function with the fEndDoc argument set to TRUE. If you do not set the fEndDoc argument to TRUE on the last call, the hDC will not be freed, and the page will not flush.

If pBitmap is NULL, the nX, nY, nWidth, and nHeight arguments are ignored. If fEndDOC is FALSE, you can use the returned hDC to draw to the current printer page.

An alternative for greater flexibility is the L_PaintDC function, which you can use by specifying the printer as the display surface.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PrintBitmap, L_PrintBitmapFast
Topics: | Raster Image Functions: Displaying Images

Example

/* This example determines the output size to fit the image on
half of a page, and prints the bitmap twice on the same page. */
#ifndef _fmemset
#define _fmemset memset
#endif
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HDC PrinterDC; /* DC for the printer */
L_INT WidthAllowed, HeightAllowed, WidthFactor, HeightFactor; /* For size calculations */
L_INT PrintWidth, PrintHeight; /* Width and height of the printed image */
PRINTDLG PrintOpts; /* Print dialog structure */
DOCINFO DocInfo; /* Document information structure */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("GIRL.TGA"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Get the printer DC */
_fmemset( &PrintOpts, 0, sizeof(PrintOpts));
PrintOpts.lStructSize = sizeof(PrintOpts);
PrintOpts.Flags = PD_RETURNDC;
if( !PrintDlg(&PrintOpts) )
return;
if( (PrinterDC = PrintOpts.hDC) == NULL )
{
if( PrintOpts.hDevMode ) GlobalFree(PrintOpts.hDevMode);
if( PrintOpts.hDevNames) GlobalFree(PrintOpts.hDevNames);
return;
}
/* Initialize the document to be printed */
_fmemset( &DocInfo, 0, sizeof(DocInfo) );
DocInfo.cbSize = sizeof(DocInfo);
DocInfo.lpszDocName = TEXT("L_PrintBitmap example");
/* Initialize variables for fitting the image on half a page */
WidthAllowed = GetDeviceCaps(PrinterDC,HORZRES);
HeightAllowed = GetDeviceCaps(PrinterDC,VERTRES) * 4/10;
HeightFactor = BITMAPHEIGHT(&LeadBitmap);
WidthFactor = BITMAPWIDTH(&LeadBitmap);
/* See if using the maximum width will make the image too tall */
if((L_INT) (((L_INT32) WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{ /* Use the maximum width, and calculate the height value */
PrintWidth = WidthAllowed;
PrintHeight = (L_INT) (((L_INT32) PrintWidth * HeightFactor) / WidthFactor);
}
else
{ /* Use the maximum height, and calculate the width value */
PrintHeight = HeightAllowed;
PrintWidth = (L_INT) (((L_INT32) PrintHeight * WidthFactor) / HeightFactor);
}
/* Start the print job */
if( StartDoc(PrinterDC, &DocInfo) <= 0)
{
if( PrintOpts.hDevMode ) GlobalFree(PrintOpts.hDevMode);
if( PrintOpts.hDevNames) GlobalFree(PrintOpts.hDevNames);
DeleteDC(PrinterDC);
return;
}
StartPage(PrinterDC);
/* Print the first image */
L_PrintBitmap (PrinterDC, &LeadBitmap, 1, 1, PrintWidth, PrintHeight, FALSE);
/* Print the second image */
L_PrintBitmap (PrinterDC, &LeadBitmap, 1, HeightAllowed * 6/5, PrintWidth, PrintHeight, FALSE);
/* Flush the page and finish the print job */
EndPage( PrinterDC );
EndDoc( PrinterDC );
if( PrintOpts.hDevMode ) GlobalFree(PrintOpts.hDevMode);
if( PrintOpts.hDevNames) GlobalFree(PrintOpts.hDevNames);
DeleteDC(PrinterDC);


L_PrintBitmapFast

#include "l_bitmap.h"

HDC EXT_FUNCTION L_PrintBitmapFast (hDC, pBitmap, nX, nY, nWidth, nHeight, fEndDoc)

HDC hDC; | /* handle to the target device context (DC) */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nX; | /* x position to start the print */
L_INT nY; | /* y position to start the print */
L_INT nWidth; | /* printed width */
L_INT nHeight; | /* printed height */
L_BOOL fEndDoc; | /* end of document indicator */

Prints a bitmap to the specified device. (This is the same as the L_PrintBitmap function, except that it does no preprocessing of the image.)

Parameter | Description
hDC | Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the bitmap to print.
nX | X position to start the print.
nY | Y position to start the print.
nWidth | The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.
nHeight | The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.
fEndDoc | This is used to let LEADTOOLS know whether you plan to print another image on the same page or not.
 | Value | Meaning
 | TRUE | LEADTOOLS will free the hDC and send a paper eject.
 | FALSE | LEADTOOLS will assume that you plan to print another bitmap.

Returns

>0 | Function was successful. If bEndDOC is FALSE, the return value is the printer HDC.
0 | An error occurred.

Comments

The function is designed to let you print multiple bitmaps on the same page. To do so, call the function with the fEndDoc argument set to FALSE for each image except the last one on the page. Then call the function with the fEndDoc argument set to TRUE. If you do not set the fEndDoc argument to TRUE on the last call, the hDC will not be freed, and the page will not flush.

If pBitmap is NULL, the nX, nY, nWidth, and nHeight arguments are ignored and the returned DC is to the default printer, with the Window’s API functions StartDoc and StartPage already called. If fEndDoc is FALSE, you can use the returned hDC to draw to the current printer page. If you’re printing more than one page and you passed FALSE for fEndDoc, be sure to call EndPage then StartPage between each call to L_PrintBitmapFast.

An alternative for greater flexibility is the L_PaintDC function, which you can use by specifying the printer as the display surface.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_PrintBitmap
Topics: | Raster Image Functions: Displaying Images

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example determines the output size to fit the image on
half of a page, and prints the bitmap twice on the same page. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
HDC PrinterDC; /* DC for the printer */
L_INT WidthAllowed, HeightAllowed, WidthFactor, HeightFactor; /* For size calculations */
L_INT PrintWidth, PrintHeight; /* Width and height of the printed image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("GIRL.TGA"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Get the printer DC */
PrinterDC = L_PrintBitmapFast(NULL, NULL, 0, 0, 0, 0, FALSE);
/* Initialize variables for fitting the image on half a page */
WidthAllowed = GetDeviceCaps(PrinterDC,HORZRES);
HeightAllowed = GetDeviceCaps(PrinterDC,VERTRES) * 4/10;
HeightFactor = BITMAPHEIGHT(&LeadBitmap);
WidthFactor = BITMAPWIDTH(&LeadBitmap);
/* See if using the maximum width will make the image too tall */
if((L_INT) (((L_INT32) WidthAllowed * HeightFactor) / WidthFactor) < HeightAllowed)
{ /* Use the maximum width, and calculate the height value */
PrintWidth = WidthAllowed;
PrintHeight = (L_INT) (((L_INT32) PrintWidth * HeightFactor) / WidthFactor);
}
else
{ /* Use the maximum height, and calculate the width value */
PrintHeight = HeightAllowed;
PrintWidth = (L_INT) (((L_INT32) PrintHeight * WidthFactor) / HeightFactor);
}
/* Print the first image */
L_PrintBitmapFast(PrinterDC, &LeadBitmap, 1, 1, PrintWidth, PrintHeight, FALSE);
/* Print the second image */
L_PrintBitmapFast(PrinterDC, &LeadBitmap, 1, HeightAllowed * 6/5, PrintWidth, PrintHeight, TRUE);


L_ProcessPlayback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ProcessPlayback(hPlayback, puState)

HPLAYBACK hPlayback; | /* playback handle */
L_UINT L_FAR * puState; | /* address of the variable to be updated */

Processes the next state during an animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.
puState | Address of the variable to be updated with a constant that describes the new state of the animation playback engine. For possible values, refer to Animation Playback States.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is called in a loop to continually process the playback.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ClearPlaybackUpdateRect, L_GetPlaybackIndex, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

For an example, refer to L_AppendPlayback.

/* This example loads a bitmap list from an animated GIF or AVI file.
It then plays the animation, using the current bitmap as the target. */
HPALETTE hpalPaint; /* Paint palette handle. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image. */
void TestAnimate(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
HBITMAPLIST hList; /* Bitmap list */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for building the list */
HPLAYBACK hPlayback; /* Animation playback */
L_UINT uState; /* Next state in the playback */
RECT rcUpdate; /* Source clipping rectangle used in playback */
RECT rcDisplay; /* Display rectangle used in playback */
HDC hdc; /* Device context of the current window */
HPALETTE hPalette = NULL; /* Temporary copy of the current system palette */
/* Create the bitmap list from the input file (GIF or AVI) */
L_LoadBitmapList(pszFilename, &hList, 0, 0, NULL, NULL);
/* Get a copy of the first image's bitmap handle */
L_GetBitmapListItem(hList, 0, &TmpBitmap, sizeof(BITMAPHANDLE));
/* Create the palette that is used for playback */
hdc = GetDC (hWnd);
hpalPaint = L_CreatePaintPalette(hdc, &TmpBitmap);
ReleaseDC (hWnd, hdc);
/* Use the client area as the display rectangle,
assuming that the window is properly sized */
GetClientRect(hWnd,&rcDisplay);
/* Create the target bitmap that is used for playback */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE), TYPE_CONV,
TmpBitmap.Width,
TmpBitmap.Height,
TmpBitmap.BitsPerPixel,
TmpBitmap.Order,
NULL,
TmpBitmap.ViewPerspective, NULL, 0);
/* Update the palette of the target bitmap */
L_CopyBitmapPalette(&LeadBitmap, &TmpBitmap);
/* Create and run the playback */
L_CreatePlayback(&hPlayback, &LeadBitmap, hList);
do
{
L_ProcessPlayback(hPlayback, &uState);
switch(uState)
{
case PLAYSTATE_WAITINPUT:
L_CancelPlaybackWait(hPlayback);
break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
L_GetPlaybackUpdateRect(hPlayback, &rcUpdate, TRUE);
hdc = GetDC(hWnd);
if (hpalPaint)
{
hPalette = SelectPalette (hdc, hpalPaint, TRUE);
RealizePalette(hdc);
}
L_PaintDC(hdc, &LeadBitmap, NULL, &rcUpdate, &rcDisplay, &rcDisplay, SRCCOPY);
if (hpalPaint)
SelectPalette (hdc, hPalette, TRUE);
ReleaseDC(hWnd, hdc);
break;
}
} while(uState != PLAYSTATE_END);
/* Clean up */
L_DestroyPlayback(hPlayback, NULL);
L_DestroyBitmapList(hList);
}


L_PunchBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PunchBitmap (pBitmap, nValue, uStress, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* stretch amount */
L_UINT uStress; | /* punching intensity */
POINT CenterPt; | /* effect center */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Warps the bitmap by pinching it toward the center or expanding the bitmap away from its center. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nValue | Amount of stretching where :
 | Positive values: pinch the image toward its center.
 | Negative values: expand the image away from its center.
 | Valid values range from –500 to 500.
uStress | Amount of punching intensity. This value is ignored when nValue is less than 0. Valid values range from 0 to 1000.
CenterPt | POINT structure that contains the point around which the image will be pinched or punched.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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 nValue is positive.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will punch or pinch the bitmap around the specified CenterPt. 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgPunch , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* punch the image */
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_PunchBitmap (&LeadBitmap, 100, 100, CenterPt, 0, FILL_RPT | FILL_WOUTROT);


L_PutBitmapColors

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PutBitmapColors(pBitmap, nIndex, nCount, pPalette)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle to update */
L_INT nIndex; | /* index of the first color to update */
L_INT nCount; | /* number of colors to update */
LPRGBQUAD pPalette; | /* pointer to your palette */

Updates part or all of the bitmap handle's palette with colors from your palette.

Parameter | Description
pBitmap | Pointer to the bitmap handle to update.
nIndex | The index of the first color to update.
nCount | The number of colors to update.
pPalette | The array of RGBQUAD values that make up your palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You specify the index of the first color and the number of colors to update in the pPalette. For the reverse action, refer to L_GetBitmapColors.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetFixedPalette, L_ColorResBitmap, L_CreatePaintPalette, L_GetBitmapColors, L_DupPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

Refer to L_GetBitmapColors.


L_PutBitmapRow

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_PutBitmapRow(pBitmap, pBuffer, nRow, uBytes)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to the source buffer */
L_INT nRow; | /* number of the row to update */
L_UINT32 uBytes; | /* number of bytes to be updated */

Copies a row of image data from a buffer to a bitmap. The data is copied exactly as it is stored in the buffer. The buffer to which pBuffer points contains uncompressed data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy the row into.
pBuffer | Pointer to the buffer containing the image data.
nRow | The number of the row to update. The first row is 0, and the last row is 1 less than the bitmap height.
uBytes | Number of bytes to be updated. Use the BytesPerLine field in the bitmap handle to determine the byte count of each line.

Returns

>=1 | The number of bytes put.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bitmap memory must be locked when you use this function. Normally, you can call L_AccessBitmap to lock the memory before starting an operation that uses this function, then call L_ReleaseBitmap when the operation is finished.

You can use the bits per pixel of the image to determine the number of bytes to set the uBytes parameter. If the image is 8-bit then each byte is an index to the palette. If the image is a 24-bit image, then each three bytes represents one pixel element. Color order is determined by the Order field in the bitmap handle. This value can be ORDER_RGB, ORDER_BGR or ORDER_ROMM.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For a short example, refer to L_GetBitmapRow. For complete sample code, refer to the RESIZE example.


L_PutBitmapRowCol

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_PutBitmapRowCol(pBitmap, pBuffer, nRow, nCol, uBytes)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to the source buffer */
L_INT nRow; | /* number of the row to update */
L_INT nCol; | /* column offset within the row to update */
L_UINT32 uBytes; | /* number of bytes to update */

Copies data from a buffer to a bitmap, with an offset to the bitmap. The buffer to which pBuffer points contains uncompressed data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to put data into.
pBuffer | Pointer to the buffer containing the image data.
nRow | The number of the row to update. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to update. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uBytes | The number of bytes to update. Consider the bits per pixel, and avoid specifying a number that goes past the end of the row.
 | For a 1-bit bitmap, each byte represents 8 pixels. For a 4-bit bitmap, each byte represents 2 pixels. For an 8-bit bitmap, each byte represents 1 pixel. For a 16-bit bitmap, every 2 bytes represents one pixel. For 24-bit images, every three bytes represents one pixel. For a 32-bit bitmap, every four bytes represents one pixel. For a 48-bit bitmap, every six bytes represents one pixel. For a 64-bit bitmap, every eight bytes represents one pixel.

Returns

>=1 | The number of bytes put.
< 1 | An error occurred. Refer to Return Codes.

Comments

By using this low-level function to update any part of a row, you can write a procedure that updates a single pixel or a rectangular area within the bitmap.

This function accepts an offset parameter (nCol) in pixels and a length (uBytes) in bytes. Therefore, you must consider the bits per pixel of the bitmap when specifying these parameters. The following table describes the rules:

Bits Per Pixel | Column Offset (in Pixels) | Bytes to Update
1 | Must be a multiple of 8 (such as 0, 8, or 16). | Should not go past the end of the row. Consider that there are 8 pixels per byte.
4 | Must be an even number (such as 0, 2, or 4). | Should not go past the end of the row. Consider that there are 2 pixels per byte.
8 | Can be any column within the bitmap. | Should not go past the end of the row. Consider that there is 1 pixel per byte.
16 | Can be any column within the bitmap. | Must be a multiple of 2 (such as 2, 4, or 6), because there are 2 bytes per pixel. Also, it should not go past the end of the row.
24 | Can be any column within the bitmap. | Must be a multiple of 3 (such as 3, 6, or 9), because there are 3 bytes per pixel. Also, it should not go past the end of the row.
32 | Can be any column within the bitmap. | Must be a multiple of 4 (such as 4, 8, or 12), because there are 4 bytes per pixel. Also, it should not go past the end of the row.

The bitmap memory must be locked when you use this function. Normally, you can call L_AccessBitmap to lock the memory before starting an operation that uses this function, then call L_ReleaseBitmap when the operation is finished.

Color order of the target bitmap is determined by the Order field in the bitmap handle. This value can be ORDER_RGB, ORDER_BGR or ORDER_ROMM.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For a short example, refer to L_GetBitmapRowCol. For complete sample code, refer to the GETROW example.


L_PutBitmapRowColCompressed

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_PutBitmapRowColCompressed(pBitmap, pWorkBuffer, pRunBuffer, nRow, nCol, uWidth)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pWorkBuffer; | /* pointer to a work buffer */
L_UINT16 L_FAR * pRunBuffer; | /* pointer to the source buffer */
L_INT nRow; | /* number of the row to update */
L_INT nCol; | /* column offset within the row to update */
L_UINT32 uWidth; | /* number of pixels to update */

Puts a row (or part of a row) of 1-bit compressed data from a buffer to a bitmap that is maintained in its compressed format. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be updated.
pWorkBuffer | NULL or a pointer to an optional work buffer. Allocating the work buffer speeds processing if you call this function more than once, because if you do not allocate a work buffer, the function allocates and frees a temporary buffer each time it is called. The size of this buffer should be the same as the bitmap handle's BytesPerLine field.
pRunBuffer | Pointer to the input buffer, which contains 1-bit compressed image data.
nRow | The number of the row to update. The first row is 0, and the last row is 1 less than the bitmap height.
nCol | The column offset within the row to update. The first column offset is 0, and the last column offset is 1 less than the bitmap width.
uWidth | The number of pixels to retrieve.

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ExpandRow, L_CompressRow, L_GetBitmapRowColCompressed, L_GetBitmapRowCompressed, L_PutBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

/* This example demonstrates the low-level functions for accessing
1-bit compressed bitmap data. It demonstrates the ability to get and put
partial rows, and the ability to process partial rows in buffer-to-buffer
processing. The result of the function is an inverted rectangle in the
middle of the image. */

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestLoad(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
L_INT XOffset; /* Column offset of the rectangle to process */
L_INT XSize; /* Pixel width of the rectangle to process */
L_INT YOffset; /* Row offset of the rectangle to process */
L_INT YSize; /* Pixel height of the rectangle to process */
L_UCHAR L_HUGE * pBuffer; /* Buffer to hold the expanded row */
L_UINT16 L_HUGE * pRunBuffer; /* Buffer to hold the compressed row */
L_UCHAR L_HUGE * pWorkBuffer; /* Work buffer */
HGLOBAL hBuffer; /* Handle to the pBuffer */
HGLOBAL hRunBuffer; /* Handle to the pRunBuffer */
HGLOBAL hWorkBuffer; /* Handle to the pWorkBuffer */
int i, n; /* Counters */
/* Load the bitmap, at 1 bit per pixel */
L_LoadFile( pszFilename,&LeadBitmap, sizeof(BITMAPHANDLE),1,0,
LOADFILE_COMPRESSED | LOADFILE_ALLOCATE | LOADFILE_STORE,
NULL, NULL, NULL, NULL);
/* This example does not work with rotated view perspectives */
if ( (LeadBitmap.ViewPerspective != TOP_LEFT) || (LeadBitmap.ViewPerspective != BOTTOM_LEFT) )
L_ChangeBitmapViewPerspective ( NULL, &LeadBitmap, sizeof(BITMAPHANDLE), TOP_LEFT );
/* Specify a rectangle in the middle right part of the displayed image */
XOffset = LeadBitmap.Width / 3;
XSize = LeadBitmap.Width * 2 / 3;
YOffset = LeadBitmap.Height / 3;
YSize = LeadBitmap.Height / 3;
/* Adjust the YOffset if the view perspective is bottom left */
if (LeadBitmap.ViewPerspective == BOTTOM_LEFT)
{
YOffset = LeadBitmap.Height - YOffset - YSize;
}
/* Allocate the buffers */
hBuffer = GlobalAlloc(GMEM_MOVEABLE, ( XSize + 7) / 8);
pBuffer = (L_UCHAR L_FAR *)GlobalLock( hBuffer );
hRunBuffer = GlobalAlloc(GMEM_MOVEABLE, (XSize + 3) * 2);
pRunBuffer = (L_UINT16 L_HUGE *)GlobalLock( hRunBuffer );
hWorkBuffer = GlobalAlloc(GMEM_MOVEABLE, LeadBitmap.BytesPerLine);
pWorkBuffer = (L_UCHAR L_HUGE * )GlobalLock( hWorkBuffer );
/* Invert the colors of pixels in the left half of the rectangle. */
/* Notice that we get the whole rectangle, but process only half of it. */
L_AccessBitmap(&LeadBitmap);
for(i=YOffset; i < (YOffset + YSize); i++)
{
L_GetBitmapRowColCompressed(&LeadBitmap, pWorkBuffer,
pRunBuffer, i, XOffset, XSize);
L_ExpandRow(pRunBuffer, pBuffer, 0, XSize/2);
for(n=0; n < (XSize /16); n++)
pBuffer[n] = pBuffer[n] ^ 0xFF;
L_CompressRow(pRunBuffer, pBuffer, 0, XSize/2);
L_PutBitmapRowColCompressed(&LeadBitmap, pWorkBuffer, pRunBuffer, i,
XOffset, XSize/ 2);
}
L_ReleaseBitmap(&LeadBitmap);
/* Free memory that we no longer need */
GlobalFree(hBuffer);
GlobalFree(hRunBuffer);
GlobalFree(hWorkBuffer);
/* Update the paint palette to force a repaint */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
}


L_PutBitmapRowCompressed

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PutBitmapRowCompressed(pBitmap, pWorkBuffer, pRunBuffer, nRow, nLines)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pWorkBuffer; | /* pointer to a work buffer */
L_UINT16 L_FAR * pRunBuffer; | /* pointer to the source buffer */
L_UINT nRow; | /* number of the first row to update */
L_UINT nLines; | /* number of the rows to update */

Puts one or more rows of 1-bit compressed data from a buffer to a bitmap that is maintained in its compressed format. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to copy the rows into.
pWorkBuffer | NULL or a pointer to an optional work buffer. Allocating the work buffer speeds processing if you call this function more than once, because if you do not allocate a work buffer, the function allocates and frees a temporary buffer each time it is called. The size of this buffer should be the same as the bitmap handle's BytesPerLine field.
pRunBuffer | Pointer to the input buffer, which contains 1-bit compressed image data.
nRow | Number of the first row to update.
nLines | Number of rows to update.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is useful for working with 1-bit images that are loaded in their compressed formats for faster loading and display. For more information, refer to Speeding Up 1-Bit Documents.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ExpandRow, L_CompressRow, L_GetBitmapRowColCompressed, L_PutBitmapRowColCompressed, L_GetBitmapRowCompressed
Topics: | Speeding Up 1-Bit Documents

Example

Refer to L_GetBitmapRowCompressed.


L_PutPixelColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PutPixelColor(pBitmap, nRow, nCol, crColor)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
COLORREF crColor; | /* color to assign to the pixel */

Changes the color value of the specified pixel.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
nRow | The row number of the pixel. This is a zero-based value.
nCol | The column number of the pixel. This is a zero-based value.
crColor | The color to assign to the pixel. 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. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter.
 | In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. 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 functions will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS function, refer to L_GetPixelColor.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses bitmap coordinates to specify the pixel. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.

If you specify a pixel that is outside the bitmap or outside the region (if the bitmap has one), this function returns an error.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ReleaseBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_GetPixelColor.


L_PutPixelData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PutPixelData(pBitmap, pData, nRow, nCol, nSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_VOID L_FAR ; * pData; | /* pointer to a buffer */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
L_INT nSize; | /* size of the buffer */

Changes the data of the specified pixel. No transformations are performed on the pixel data.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
pData | Pointer to a buffer that contains the pixel data to set. This buffer should be able to store nSize bytes.
nRow | The row number of the pixel. This is a zero-based value.
nCol | The column number of the pixel. This is a zero-based value.
nSize | Size of the buffer pointed to by pData. The size should be large enough to contain the data for the pixel. The minimum size can be calculated with the following formula: (pBitmap->BitsPerPixel + 7) / 8.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called only for 8, 16, 24, 32, 48 and 64-bit bitmaps. For more information, refer to L_GetPixelData.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPixelData, L_GetPixelColor, L_AccessBitmap, L_ReleaseBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

For an example, refer to L_GetPixelData.


L_PuzzleEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_PuzzleEffectBitmap( pBitmap, uXBlock, uYBlock, uRandomize, uFlags, crColor);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uXBlock; | /* either the width of the block or the number of blocks per row */
L_UINT uYBlock; | /* either the height of the block or the number of blocks per column */
L_UINT uRandomize | /* starting point for randomization process */
L_UINT uFlags; | /* flags that specify how to apply the puzzle effect */
COLORREF crColor; | /* border color */

Splits the image into square blocks and randomizes these blocks inside the image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
uXBlock | 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.
uYBlock | 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.
uRandomize | The starting point for the randomization process. Valid values range from 0 through 500. Use 0 to have the function select the starting point.
uFlags | 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 uRandomize 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 uXBlock and uYBlock parameters as the width and height of each block, in pixels.
 | PUZZLE_COUNT | [0x0020] Apply the puzzle effect using the the uXBlock and uYBlock 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.
crColor | If PUZZLE_BORDER is set in uFlags, 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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.

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 uXBlock and uYBlock parameters for the dimensions of the blocks. If the PUZZLE_COUNT flag is set, then the image will be divided into blocks using the uXBlock and uYBlock 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 uRandomize parameter as follows:

If uRandomize is set to 0, the function will select the starting point for the randomize process. You will get a different result every time you call the function with uRandomize = 0.

If you set uRandomize to > 0, the function will use this value as a starting point for the randomize process. You will get the same result every time you call the function with the same value of uRandomize > 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 function to affect the image. If you pass 0 for uFlags, the function leaves the image unchanged.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_MosaicBitmap, L_PicturizeBitmap, L_PicturizeBitmapList, L_PicturizeBitmapSingle, L_PixelateBitmap, L_CubismBitmap, L_DiceEffectBitmap, L_RingEffectBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

/* This example loads a bitmap and applies a Puzzle Effect over the loaded image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply Puzzle Effect to this bitmap */
L_PuzzleEffectBitmap (&LeadBitmap, 10, 10, 0, PUZZLE_BORDER | PUZZLE_SHUFFLE | PUZZLE_COUNT | BITMAP_RESIZE, RGB(0,0,0));


L_RadialBlurBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RadialBlurBitmap (pBitmap, uDim, uStress, CenterPt)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* effect size */
L_UINT uStress; | /* effect intensity */
POINT CenterPt; | /* effect center */

Blurs the image by rotating the pixels around the specified center point. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uDim | An integer that represents the size of the neighborhood used in blurring. Increasing this value will increase the amount of blurring. Valid values are range in between 1 and 100.
uStress | An integer that represents the amount of the blur intensity. Valid values are range in between 1 and 100.
CenterPt | POINT structure that contains the point around which the pixels are rotated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function will blur the image in a radial form around the specified CenterPt. 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgRadialBlur , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Radial blur*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_RadialBlurBitmap (&LeadBitmap, 50, 10, CenterPt);


L_RadWaveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RadWaveBitmap(pBitmap, uAmplitude, uWaveLen, nPhase, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* radial wave size */
L_UINT uWaveLen; | /* wave’s length */
L_INT nPhase; | /* wave phase shift */
POINT CenterPt; | /* radial wave center */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Distorts a bitmap using a wave radiating from the specified center. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmplitude | An integer that represents the magnitude of the wave. Valid values range from 0 to 100.
uWaveLen | Value that represents the wave length, if DIS_PER is set in the uFlags parameter. Possible values range from 1 – 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in uFlags, this value is the number of repeated waves.
nPhase | Wave phase shift, in hundredths of degrees. The valid range is from –36000 to 36000 (The value in degrees is nPhase divided by 100).
CenterPt | POINT structure that contains the point from which the wave radiates.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | Flags that indicate how to handle exposed areas and what type of information is in the uWaveLen 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 uWaveLength parameter:
 | Value | Meaning
 | DIS_PER | [0x0000] The value in uWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is set, the valid range of uWaveLen is from 0 to 100.
 | DIS_FRQ | [0x0010] The value in uWaveLen is the frequency, or the number of times the wave repeats.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function applies a sinusoidal wave radiating 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgRadialWave , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* apply zoom wave from center of the image*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_RadWaveBitmap (&LeadBitmap, 5, 25, 0, CenterPt, 0, FILL_RPT | DIS_FRQ);


L_ReadFileComment

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileComment(pszFile, uType, pComment, uLength, pLoadOptions)

L_TCHAR L_FAR * pszFile; | /* character string containing the input file name */
L_UINT uType; | /* type of comment */
L_UCHAR L_FAR * pComment; | /* pointer to your buffer for the comment field */
L_UINT uLength; | /* size of your buffer for the comment field */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets a comment field from a file.

Parameter | Description
pszFile | Character string containing the input file name.
uType | The type of comment. Refer to Types of File Comments.
pComment | Pointer to your buffer that will hold the comment field, including the terminating NULL. You can pass NULL if you only want to get the length of the field (the return value).
uLength | The size of your buffer that will hold the comment field.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

>=0 | Length of the comment field.
< 0 | An error occurred. Refer to Return Codes.

Comments

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, you use the L_SetComment function to specify the coments to be saved.

The L_ReadFileComment function lets you read comments that are already saved in a file header. For more information refer to the L_SetComment function.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileCommentMemory, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment, L_ReadFileCommentOffset
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

Refer to L_SetComment.


L_ReadFileCommentExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileCommentExt (pszFile, uType, pComments, pBuffer, uLength, pLoadOptions)

L_TCHAR, L_FAR * pszFile; | /* file name */
L_UINT uType; | /* type of comment */
LPFILECOMMENTS pComments; | /*pointer to a structure containing information about the comments */
L_UCHAR, L_HUGE *pBuffer; | /*pointer to a buffer containing the comments /*
L_UINT, L_FAR * uLength; | /*pointer to the size of the comments.*/
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets a single comment, a group of comments or several groups of comments from a file.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
uType | The type of comment. Refer to Types of File Comments. A group of comments may be obtained such as CMNT_FPXSUMMARYINFORMATION, or more than one group of comments may be retrieved by using OR as in CMNT_FPXSUMMARYINFORMATION | CMNT_FPXFILESOURCEGROUP, or all comments may be obtained by using CMNT_ALL. See Example listed below. For more information concerning FlashPix file comments, see FlashPix File Comments.
pComments | Pointer to a structure which contains a data value indicating the number of comments stored, a pointer to an array of pointers which in turn point to the individual Comments, and a pointer to an array of integers which indicate the size of each Comment stored.
pBuffer | Pointer to the buffer that will hold all the comments
uLength | Pointer to the size of the buffer that will hold all the comments.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Presently this function only works with FlashPix format files.

The basic order of function calls to retrieve comments is as follows:

Get the size of the comments with L_GetFileCommentSize

Allocate a buffer of a corresponding size.

Read the comments with L_ReadFileCommentExt

Free the buffer

To write comments to a file, all the comments you wish to add to a new file must be set. L_SetComment sets each comment individually, but it does not save the comments to the file, it prepares the values for the next save.. Once all comments are set, the comments are saved using any function which saves files, such as L_SaveFile or L_SaveBitmap when creating a new file. If you wish to change a comment in an existing file, use L_WriteFileCommentExt.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadFileComment,
 | L_SetComment,
 | L_GetFileCommentSize
 | L_WriteFileCommentExt
Topics: | Raster Image Functions: Maintaining File Comments,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For the following examples:

L_UINT32 uLength;
L_TCHAR szMessage[80];
HGLOBAL hTextToGet;
L_CHAR L_FAR *pTextToGet;
L_FLOAT L_FAR *pFloat;
L_UINT32 L_FAR *pLong;
L_CHAR L_FAR *pString;
L_INT nStatus;
FPXCOMMENT_HEADER_ARRAY L_FAR *pArray;
FPXCOMMENT_HEADER_ELEMENT L_FAR *pElement;
FILECOMMENTS FileComments;
L_UCHAR L_FAR *pPointer [CMNT_LAST + 1];
L_UINT uSize[CMNT_LAST + 1];
//Read one group of comments:
/* Determine the size, in bytes, of the desired group of comments. */
nStatus = L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_FPXSUMMARYINFORMATION, &uLength, NULL);

/* Allocate a buffer based on the size of the comments obtained by L_GetFileCommentSize and stored in
uLength. */
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);

/* Initialize the FileComments structure. */
FileComments.count = CMNT_LAST + 1;
FileComments.pointer = pPointer;
FileComments.size = uSize;

/* Read the group of comments into the buffer. */
nStatus = L_ReadFileCommentExt (TEXT("TEST.FPX"), CMNT_FPXSUMMARYINFORMATION,
&FileComments, pTextToGet, &uLength, NULL);

/* Extract the desired individual comments from within the group */
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)pPointer [CMNT_FPXTITLE];
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) pPointer [CMNT_FPXSECURITY];

/* Test to be sure the comments exist. If they exist, print them.*/
if((pArray != NULL)&&(pElement != NULL))
{
pString = (L_CHAR L_FAR *)(pArray + 1);
pLong = (L_UINT32 L_FAR *)(pElement + 1);
wsprintf(szMessage, TEXT("%hs-%ul"), pString, *pLong);
MessageBox(NULL, szMessage, TEXT("Title & Security"), MB_OK);
}

/* Free the buffer. */
GlobalFree(hTextToGet);

//Read groups of comments:
nStatus = L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_FPXSUMMARYINFORMATION |
CMNT_FPXINTELLECTUALPROPERTYGROUP, &uLength, NULL);
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);
FileComments.count = CMNT_LAST + 1;
FileComments.pointer = pPointer;
FileComments.size = uSize;
nStatus = L_ReadFileCommentExt (TEXT("TEST.FPX"), CMNT_FPXSUMMARYINFORMATION |
CMNT_FPXINTELLECTUALPROPERTYGROUP,
&FileComments, pTextToGet, &uLength, NULL);
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)pPointer[CMNT_FPXTITLE];
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) pPointer[CMNT_FPXEXPOSURETIME];
if((pArray != NULL)&&(pElement != NULL))
{
pString = (L_CHAR L_FAR *)(pArray + 1);
pFloat = (L_FLOAT L_FAR *)(pElement + 1);
wsprintf(szMessage, TEXT("%hs-%f"), pString, *pFloat);
MessageBox(NULL, szMessage, TEXT("Title & Exposure Time"), MB_OK);
}
GlobalFree(hTextToGet);

//Read all comments:
nStatus = L_GetFileCommentSize(TEXT("TEST.FPX"), CMNT_ALL, &uLength, NULL);
hTextToGet = GlobalAlloc(GPTR, uLength);
pTextToGet = (L_UCHAR L_FAR *)GlobalLock(hTextToGet);
FileComments.count = CMNT_LAST + 1;
FileComments.pointer = pPointer;
FileComments.size = uSize;
nStatus = L_ReadFileCommentExt (TEXT("TEST.FPX"), CMNT_ALL, &FileComments, pTextToGet, &uLength, NULL);
pArray = (FPXCOMMENT_HEADER_ARRAY L_FAR *)pPointer[CMNT_FPXTITLE];
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) pPointer[CMNT_FPXEXPOSURETIME];
if((pArray != NULL)&&(pElement != NULL))
{
pString = (L_CHAR L_FAR *)(pArray + 1);
pFloat = (L_FLOAT L_FAR *)(pElement + 1);
wsprintf(szMessage, TEXT("%hs-%f"), pString, *pFloat);
MessageBox(NULL, szMessage, TEXT("Title & Exposure Time"), MB_OK);
}
GlobalFree(hTextToGet);


L_ReadFileCommentMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileCommentMemory(pBuffer, uType, pComment, uLength, nBufferSize, pLoadOptions)

L_UCHAR, L_FAR * pBuffer; | /* pointer to the file in memory */
L_UINT uType; | /* type of comment */
L_UCHAR, L_FAR * pComment; | /* pointer to your buffer for the comment field */
L_UINT uLength; | /* size of your buffer for the comment field */
L_INT32 nBufferSize; | /* size of the file in memory (in bytes) */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets a comment field from a file in memory.

Parameter | Description
pBuffer | Pointer to the file in memory.
uType | The type of comment. Refer to Types of File Comments.
pComment | Pointer to your buffer that will hold the comment field, including the terminating NULL. You can pass NULL if you only want to get the length of the field (the return value).
uLength | The size of your buffer that will hold the comment field.
nBufferSize | Size of the file in memory (in bytes).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

>=0 | Length of the comment field.
< 0 | An error occurred. An error occurred. Refer to Return Codes.

Comments

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, you use the L_SetComment function to specify the comments to be saved.

The L_ReadFileCommentMemory function lets you read comments that are already saved in a file in memory. For more information refer to the L_SetComment function.

Note: | More options are available in the LOADFILEOPTION structure.
Note: | This function does not support Kodak FlashPix files.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment, L_ReadFileCommentOffset
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example gets the CMNT_SZDATETIME comment from a TIFF file in memory */
void ReadComment ( L_CHAR L_HUGE *pBuf, L_INT32 lFileSize )
{
/* pBuf is the buffer holding the image file */
L_TCHAR szMessage[80]; /* MessageBox string */
L_CHAR L_FAR * pTextToGet; /* Comment string that we will get */
HGLOBAL hTextToGet; /* Handle for memory management */
L_INT CommentLength; /* Length of the comment string that we will get */
/* Use the return value to get the length of a comment in the file */
CommentLength = L_ReadFileCommentMemory (pBuf, CMNT_SZDATETIME, NULL, 0, lFileSize, NULL);
/* Allocate and lock a zero-filled buffer for the comment */
hTextToGet = GlobalAlloc(GPTR, CommentLength);
pTextToGet = (L_CHAR L_FAR *)GlobalLock( hTextToGet );
/* Get the actual comment from the file */
L_ReadFileCommentMemory ( pBuf,
CMNT_SZDATETIME,
(L_UCHAR L_FAR *) pTextToGet,
CommentLength,
lFileSize, NULL );
/* Show the comment that was saved in the file */
wsprintf (szMessage, TEXT("DATE_TIME:\n %hs"), pTextToGet);
MessageBox (NULL, szMessage, TEXT("Date_Time"), MB_OK);
/* Free memory */
GlobalUnlock(hTextToGet);
GlobalFree(hTextToGet);
}


L_ReadFileCommentOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileCommentOffset(fd, nOffsetBegin, nBytesToLoad, uType, pComment, uLength, pLoadOptions)

L_INT fd; | /* windows file handle of the file to load */
L_INT32 nOffsetBegin; | /* position of the first byte to load */
L_INT32 nBytesToLoad; | /* size of the embedded image file */
L_UINT uType; | /* type of comment */
L_UCHAR L_FAR * pComment; | /* pointer to your buffer for the comment field */
L_UINT uLength; | /* size of your buffer for the comment field */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

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.

Parameter | Description
fd | The Windows file handle of the file to load.
nOffsetBegin | The position, from the beginning of the file, of the first byte to load.
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.)
uType | The type of comment. Refer to Types of File Comments.
pComment | Pointer to your buffer that will hold the comment field, including the terminating NULL. You can pass NULL if you only want to get the length of the field (the return value).
uLength | The size of your buffer that will hold the comment field.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Like the L_ReadFileComment function, this function lets you read comments that are already saved in a file header. The only difference between the L_ReadFileComment function and this function is that this function allows you to specify an offset for the image data. For more information refer to the L_SetComment function.

The location of the image is specified as shown in the following simple illustration:

You must open the file and get a Windows file handle before calling this function. Redirected input (specified with L_RedirectIO) is disabled when this function is executing.

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, you use the L_SetComment function to specify the comments to be saved.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL

File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ReadFileComment, L_SaveFileOffset, L_SetComment, L_ReadFileCommentMemory
Topics: | Raster Image Functions: Maintaining File Comments and Tags
 | Types of File Comments

Example

/* The following sample will create a file with an offset and will read a comment from the file it just saved: */
#define COMMENT "I am the artist!"
L_VOID TestReadFileCommentOffset(HWND hWnd)
{
BITMAPHANDLE Bitmap;
L_INT nRet; /* Return value */
HFILE OffsetFile; /* File handle */
L_INT32 SizeWritten; /* Variable to be updated with the size written */

/* Load an existing bitmap */
nRet = L_LoadBitmap(TEXT("eagle.cmp"), &Bitmap, sizeof(BITMAPHANDLE),
0, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
{
MessageBox(hWnd, "Load has failed!", "FAILURE", MB_OK);
return;
}

#ifdef UNICODE
OffsetFile = _wcreat(TEXT("TOFFSET.TST"), 0);
#else
OffsetFile = _lcreat("TOFFSET.TST", 0);
#endif

/* Write some text in the file -- 29 characters and a terminator */
_lwrite(OffsetFile, "This is a 29-character string", 30);

/* set and save a comment into a file with an offset */
L_SetComment(CMNT_SZARTIST, (L_UCHAR L_FAR*)COMMENT, sizeof(COMMENT));

/* Save the image file with an offset inside the TOFFSET.TST file */
nRet = L_SaveFileOffset(OffsetFile, 30, &SizeWritten, &Bitmap, FILE_TIF, 1, 0,
SAVEFILE_FIXEDPALETTE, NULL, NULL, NULL);
/* Close the file */
_lclose(OffsetFile);

/* free the bitmap */
L_FreeBitmap(&Bitmap);

/* Notify the user with a message box */
if (nRet != SUCCESS)
{
MessageBox (NULL, TEXT("Error saving file"), TEXT("Error"), MB_OK);
return;
}

/***** Now load the file we just saved ****/
/* Open the file and get the file handle */
#ifdef UNICODE
OffsetFile = _wopen(TEXT("TOFFSET.TST"), OF_READ|OF_SHARE_DENY_WRITE );
#else
OffsetFile = _lopen("TOFFSET.TST", OF_READ|OF_SHARE_DENY_WRITE );
#endif

/* Get the comment size */
nRet = L_ReadFileCommentOffset( OffsetFile, 30, SizeWritten,
CMNT_SZARTIST, NULL, 0, NULL);
if(nRet > 0)
{
/* Allocate a buffer for the comment. Allocate extra byte for string terminator */
L_UCHAR L_FAR*pComment = (L_UCHAR L_FAR*)malloc(nRet + 1);
nRet = L_ReadFileCommentOffset(OffsetFile, 30, SizeWritten,
CMNT_SZARTIST, pComment, nRet + 1, NULL);
if(nRet > 0)
{
/* make sure the string is NULL-terminated */
pComment[nRet] = 0;
#ifdef UNICODE
/* convert the string to UNICODE and display it */
#else
MessageBox(hWnd, (LPSTR)pComment, "SUCCESS", MB_OK);
#endif
}
free(pComment);
}

/* Close the file */
_lclose(OffsetFile);

return;
}


L_ReadFileExtensions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileExtensions(pszFile, ppExtensionList, pLoadOptions)

L_TCHAR L_FAR * pszFile; | /* file name */
pEXTENSIONLIST L_FAR * ppExtensionList; | /* pointer to a pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads extensions from the specified Exif file. Please note that not all Exif files have extensions.

Parameter | Description
pszFile | Character string containing Exif file name.
ppExtensionList | Pointer to a pointer to an EXTENSIONLIST structure to be updated with the extensions read from the specified Exif file.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

>=0 | Length of the comment field.
< 0 | An error occurred. Refer to Return Codes.

Comments

Currently, this function works only with Exif files. Exif files can contain extra data stored as "FlashPix extensions". This function can be used to access this extra data. LEADTOOLS refers to this extra data as "extensions".

The L_LoadExtensionStamp function can be used to load a stamp from the extension and L_GetExtensionAudio can be used to get embedded audio data.

When the memory allocated by this function is no longer needed, call L_FreeExtensions to free the memory.

Required DLLs and Libraries

LTFIL
Exif file format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadExtensionStamp, L_GetExtensionAudio, L_FreeExtensions, L_ReadFileStamp
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

This example will show detailed information on the streams present in the Exif file.

#include <stdio.h>

static L_INT GetExifInfo(HWND hWnd, L_TCHAR L_FAR* pszName)
{
pEXTENSIONLIST pExtensionList;

L_INT nRet;

L_CHAR s[300];

L_UINT u;

L_CHAR aName[100];

L_CHAR aCLSID[50];

FILE *fd;

L_TCHAR szMsg[80];

nRet = L_ReadFileExtensions(pszName, &pExtensionList, NULL);
if(nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error %d getting extensions!"), nRet);
MessageBox(hWnd, szMsg, TEXT("ERROR"), MB_OK);
return nRet;
}

// use fopen so I can use fprintf

#ifdef UNICODE
fd = _wfopen(TEXT("c:\\temp\\1.txt"), TEXT("wt"));

#else

fd = fopen("c:\\temp\\1.txt", "wt");

#endif

if(!fd)
{
wsprintf(szMsg, TEXT("Error %d getting extensions!"), nRet);
MessageBox(hWnd, szMsg, TEXT("ERROR"), MB_OK);
return nRet;
}

// display whether we have a stamp, audio or both
switch(pExtensionList->uFlags & (EXTENSION_STAMP|EXTENSION_AUDIO))
{
case 0:
lstrcpy(s, TEXT("")); break;
case EXTENSION_STAMP:
lstrcpy(s, TEXT(", EXTENSION_STAMP")); break;
case EXTENSION_AUDIO:
lstrcpy(s, TEXT(", EXTENSION_AUDIO")); break;
case EXTENSION_STAMP|EXTENSION_AUDIO:
lstrcpy(s, TEXT(", EXTENSION_STAMP|EXTENSION_AUDIO")); break;
}
fprintf(fd, "Extension count: %d%s\n", pExtensionList->uCount, s);

for(u = 0; u < pExtensionList->uCount; u++)
{
// translate the Unicode string to multibyte
if( !WideCharToMultiByte(CP_ACP, // code page
0, // performance and mapping flags
pExtensionList->aList[u].pName, // wide-character string
-1, // number of chars in string
aName, // buffer for new string
sizeof(aName), // size of buffer
NULL, // default for unmappable chars
NULL)) // set when default char used
{
strcpy(aName, "ERROR decoding the Unicode string");
}

if(pExtensionList->aList[u].pClsid)
{
StringFromGUID2(pExtensionList->aList[u].pClsid, (LPWSTR)s, sizeof(s));
WideCharToMultiByte(CP_ACP, // code page
0, // performance and mapping flags
(LPWSTR)s, // wide-character string
-1, // number of chars in string
(LPSTR)aCLSID, // buffer for new string
sizeof(aCLSID), // size of buffer
NULL, // default for unmappable chars
NULL); // set when default char used
}
else
strcpy(aCLSID, "NULL");

// write information about stream 'u'

fprintf(fd, "[%d]: Name=%s, DataSize=%d, CLSID=%s\n", u, aName, pExtensionList->aList[u].uDataSize, aCLSID);

}

fclose(fd);

// run notepad to show this file
sprintf(s, "notepad c:\\temp\\1.txt");
WinExec(s, SW_SHOW);

L_FreeExtensions(pExtensionList);
return SUCCESS;
}


L_ReadFileGeoKey

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileGeoKey(pszFile, uTag, puType, pCount, pData, pLoadOptions)

L_TCHAR L_FAR pszFile; | /* input file name */
L_UINT16 uTag; | /* GeoKey to identify the data in the GeoTIFF file */
L_UINT L_FAR *puType; | /* pointer to a variable */
L_UINT L_FAR *pCount; | /* pointer to a variable */
L_VOID L_FAR *pData; | /* pointer to the buffer for the data */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets the specified GeoKey data from a TIFF file. This function is provided to support GeoKeys that you define.

Parameter | Description
pszFile | Character string that contains the input file name to load.
uTag | GeoKey ID that you specified by calling L_SetGeoKey function. 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.
puType | Pointer to a variable to be updated with the GeoKey type. This indicates whether the data pointed to by pData is SHORT, DOUBLE or ASCII. Possible values are:
 | Value | Meaning
 | TAG_ASCII | [2] The data pointed to by pData is an array of ASCII bytes.
 | TAG_SHORT | [3] The data pointed to by pData is an array of SHORT values (2 bytes each).
 | TAG_DOUBLE | [12] The data pointed to by pData is an array of floating points in DOUBLE format (8 bytes each).
puCount | Pointer to the variable to be updated with the number of items required for the pData buffer. Note that this is not the required number of bytes. The required number of bytes will be (*puCount) * number of bytes per value (1 for ASCII, 2 for SHORT, 8 for DOUBLE). If pData passed as NOT NULL, this variable will be updated with the count of data items.
pData | Pointer to the buffer to be updated with the data. You can pass NULL if you want to use this function's return value to determine the required buffer size.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You can use this function to obtain the GeoKey data from a particular file.

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, specifying NULL in the pData parameter, and using the return value to determine the required size of the buffer.
2. | Allocate the buffer.
3. | Call the function the second time, passing a pointer to your buffer in the pData parameter.

The most efficient way of reading the GeoKeys in a file is to enumerate them with L_EnumFileGeoKeys and then read each GeoKey with L_ReadFileGeoKey.

For more information about GeoKeys, refer to Implementing GeoKeys (GeoTIFF tags).

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetGeoKey, L_GetGeoKey, L_WriteFileGeoKey, L_WriteFileMetaData, L_EnumFileGeoKeys, L_SaveFile, L_SaveBitmap
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

For an example, refer to L_WriteFileGeoKey function.


L_ReadFileStamp

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileStamp(pszFile, pBitmap, uStructSize, pLoadOptions)

L_TCHAR, L_FAR * pszFile; | /* file name*/
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Reads a thumbnail image stored in a file and loads it into a specified bitmap.

Parameter | Description
pszFile | Character string containing the file name.
pBitmap | Pointer to the bitmap handle referencing the bitmap that will contain the thumbnail image.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Only EXIF, CMP, JFIF and FlashPix formats support stamps. However, not all file of these formats contain stamps.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetExtFileOption,
 | L_SetExtFileOption,
 | L_WriteFileStamp,
 | L_GetCompressFileStamp
Topics: | Raster Image Functions: Loading and Saving Stamp Images,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

Reads a thumbnail image stored in a FlashPix file and loads it into a specified bitmap.

BITMAPHANDLE StampBitmap;
L_ReadFileStamp(TEXT("TEST1.FPX"), &StampBitmap, sizeof(BITMAPHANDLE), NULL);


L_ReadFileTag

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_ReadFileTag(pFile, uTag, pType, pCount, pData, pLoadOptions)

L_TCHAR, L_FAR * pFile; | /* character string containing the input file name */
L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16, L_FAR * pType; | /* address of the variable for the data type */
L_UINT32, L_FAR * pCount; | /* address of the variable for the count */
L_VOID L_FAR * pData; | /* pointer to the buffer for the data */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets the specified tagged data from a TIFF file. This function is provided to support TIFF tags that you define.

Parameter | Description
pFile | Character string containing the input file name.
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the L_SetTag function. Examples of registered tags are:
 | Value | Meaning
 | 0x8298 | Copyright comment
 | 0x8769 | General Exif comments
 | 0x8825 | Exif GPS comments
 | 0x80A4 | Annotation TIFF tag defined as ANNTAG_TIFF.
pType | Address of the variable to be updated with the tagged data type. The following are possible values:
 | 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.
pCount | Address of the variable to be updated with the count of data items. The count is based on the tagged data type. For example, if the count is 2 and the data type is TAG_DOUBLE, the required buffer size is 16.
pData | Pointer to the buffer to be updated with the data. You can pass NULL if you want to use this function's return value to determine the required buffer size.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

>0 | Length of the tagged data, in bytes.
<= 0 | An error occurred. Refer to Return Codes.

Comments

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, specifying NULL in the pData parameter, and using the return value to determine the required size of the buffer.
2. | Allocate the buffer.
3. | Call the function the second time, passing a pointer to your buffer in the pData parameter.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetTag, L_GetTag, L_ReadFileTagMemory, L_DeleteTag
Topics: | Implementing TIFF Comments and Tags

Example

/* This example uses L_ReadFileTag to read a tag for the position of a company logo on an image.
It reads the tag from the TIFF file that is created in the example for L_SetTag. */
void TestReadTag()
{
L_TCHAR msgbuf[80]; /* buffer for the message string */
L_UINT16 LogoPosition = 0x8001; /* my private tag */
L_UINT16 TagType; /* tagged data type */
L_UINT32 TagCount; /* count of data items */
L_VOID L_FAR * pTagData; /* pointer to the buffer containing the data */
HGLOBAL hBuf; /* handle to the buffer */
L_INT32 BufferSize; /* required size of the buffer */
/* Get the required buffer size */
BufferSize = L_ReadFileTag(TEXT("TEST.TIF"), LogoPosition, &TagType, &TagCount, NULL, NULL);
/* Allocate and lock the buffer */
if ((TagType == TAG_SSHORT) && (BufferSize > 0))
{
hBuf = GlobalAlloc(GMEM_MOVEABLE, BufferSize);
pTagData = GlobalLock( hBuf );
}
else
{
return;
}
/* Get the tagged data */
L_ReadFileTag(TEXT("TEST.TIF"), LogoPosition, &TagType, &TagCount, pTagData, NULL);
/* Display a message showing the data */
if ((TagType == TAG_SSHORT) && (TagCount == 4))
{
wsprintf(msgbuf, TEXT("X = %d\nY= %d\nWidth = %d\nHeight = %d"),
((L_INT L_FAR *)pTagData)[0],
((L_INT L_FAR *)pTagData)[1],
((L_INT L_FAR *)pTagData)[2],
((L_INT L_FAR *)pTagData)[3]);
MessageBox (NULL, msgbuf, TEXT("Logo Position"), MB_OK);
}
/* Free memory that we no longer need */
GlobalUnlock (hBuf);
GlobalFree(hBuf);
return;
}


L_ReadFileTagMemory

#include "l_bitmap.h"

L_INT32 EXT_FUNCTION L_ReadFileTagMemory(pBuffer, uTag, pType, pCount, pData, nBufferSize, pLoadOptions)

L_UCHAR, L_FAR * pBuffer; | /* pointer to the file in memory */
L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16, L_FAR * pType; | /* address of the variable for the data type */
L_UINT32, L_FAR * pCount; | /* address of the variable for the count */
L_VOID L_FAR * pData; | /* pointer to the buffer for the data */
L_INT32 nBufferSize; | /* size of the file in memory (in bytes) */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Gets the specified tagged data from a TIFF file in memory. This function is provided to support TIFF tags that you define.

Parameter | Description
pBuffer | Pointer to the file in memory.
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the L_SetTag function.
pType | Address of the variable to be updated with the tagged data type. The following are possible values:
 | 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.
pCount | Address of the variable to be updated with the count of data items. The count is based on the tagged data type. For example, if the count is 2 and the data type is TAG_DOUBLE, the required buffer size is 16.
pData | Pointer to the buffer to be updated with the data. You can pass NULL if you want to use this function's return value to determine the required buffer size.
nBufferSize | Size of the file in memory (in bytes).
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

>=0 | Length of the tagged data, in bytes.
< 0 | An error occurred. Refer to Return Codes.

Comments

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, specifying NULL in the pData parameter, and using the return value to determine the required size of the buffer.
2. | Allocate the buffer.
3. | Call the function the second time, passing a pointer to your buffer in the pData parameter.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetTag, L_GetTag, L_ReadFileTag, L_DeleteTag
Topics: | Implementing TIFF Comments and Tags

Example

/* This example specifies a tag for recording the position of a company logo on an image.
It sets the tag with L_SetTag; saves the image as a TIFF file in memory; then uses
L_ReadFileTagMemory to read the tag from the file in memory. */
void TestReadTagMem(pBITMAPHANDLE pBitmap)
{
L_TCHAR msgbuf[80]; /* buffer for the message string */
L_UINT16 LogoPosition = 0x8001; /* my private tag */
L_UINT16 TagType = TAG_SSHORT; /* tagged data type */
L_UINT32 TagCount = 4; /* count of data items */
L_INT TagData[] = {5, 5, 24, 37,};
L_VOID L_FAR * pTagData = &TagData; /* pointer to the buffer containing tagged data */
HGLOBAL hBuf; /* handle to the buffer for the file*/
L_INT32 BufferSize; /* required size of the file buffer */
HGLOBAL hFileInMemory; /* memory handle for the file */
L_UINT32 uMemSize; /* size of the file in memory */
L_CHAR L_FAR *pData; /* pointer to the file in memory */
/* Set the tag data to be saved */
L_SetTag(LogoPosition, TagType, TagCount, pTagData);
/* Save the image as a TIFF file in memory */
L_SaveBitmapMemory(&hFileInMemory, pBitmap, FILE_TIF, pBitmap->BitsPerPixel, 0, &uMemSize, NULL);
/* Get the pointer to the memory-resident file */
pData = (L_CHAR L_FAR *) GlobalLock (hFileInMemory);
/* Clear the variables so that we can validate the data */
TagType = 0;
TagCount = 0;
TagData[0] = 0;
TagData[1] = 0;
TagData[2] = 0;
TagData[3] = 0;
/* Get the required size of the buffer for the tagged data */
BufferSize = L_ReadFileTagMemory(pData, LogoPosition, &TagType, &TagCount, NULL, uMemSize, NULL);
/* Allocate and lock the buffer */
if ((TagType == TAG_SSHORT) && (BufferSize > 0))
{
hBuf = GlobalAlloc(GMEM_MOVEABLE, BufferSize);
pTagData = GlobalLock( hBuf );
}
else
{
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);
return;
}
/* Get the tagged data */
L_ReadFileTagMemory(pData, LogoPosition, &TagType, &TagCount, pTagData, uMemSize, NULL);
/* Display a message showing the data */
if ((TagType == TAG_SSHORT) && (TagCount == 4))
{
wsprintf(msgbuf, TEXT("X = %d\nY= %d\nWidth = %d\nHeight = %d"),
((L_INT L_FAR *)pTagData)[0],
((L_INT L_FAR *)pTagData)[1],
((L_INT L_FAR *)pTagData)[2],
((L_INT L_FAR *)pTagData)[3]);
MessageBox (NULL, msgbuf, TEXT("Logo Position"), MB_OK);
}
/* Free memory that we no longer need */
GlobalUnlock (hBuf);
GlobalFree(hBuf);
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);
return;
}


L_ReadFileTransforms

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadFileTransforms(pszFile, pTransforms, pLoadOptions)

L_TCHAR, L_FAR * pszFile; | /* file name */
L_FAR, *pFILETRANSFORMS pTransforms; | /* pointer to a transform structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Reads the transforms stored with an image in a FlashPix file.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
pTransforms | Pointer to a transform structure.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note: | Page number is specified in the LOADFILEOPTION structure. To load a FlashPix file with or without the transforms, see FlashPix Transforms Options.
 | For more information on transforms in general, refer to FILETRANSFORMS.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetExtFileOption,
 | L_SetExtFileOption,
 | L_WriteFileTransforms, L_HighPassFilterBitmap
Topics: | Raster Image Functions: Getting and Setting File Information,
 | Raster Image Functions: Doing Geometric Transformations,
 | Raster Image Functions: Modifying Intensity Values,
 | Raster Image Functions: Loading Files,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

FILETRANSFORMS FileTransforms;

L_ReadFileTransforms(TEXT("TEST.FPX"), &FileTransforms, NULL);
//Increase the contrast by 20%
FileTransforms.fContrastAdjustment = FileTransforms.fContrastAdjustment * 1.2f;
L_WriteFileTransforms(TEXT("TEST.FPX"), &FileTransforms, FALSE, NULL);


L_ReadLoadResolutions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReadLoadResolutions(pszFile, pDimensions, pDimensionCount, pLoadOptions)

L_TCHAR, L_FAR * pszFile; | /* character string for the file name */
pDIMENSION pDimensions; | /* pointer to the array to be updated */
L_INT L_FAR * pDimensionCount; | /* address of the count variable to be updated */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */

Examines a FlashPix, PhotoCD, or JBIG file to determine which resolutions it contains.

Parameter | Description
pszFile | Character string containing the name of the file to examine.
pDimensions | Pointer to the array of DIMENSION structures to be updated with the available physical resolutions in the file. You can pass NULL if you only want to update the count variable.
pDimensionCount | Address of the pDimensionCount variable to be updated with the number of available resolutions.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 also use an older function (L_GetPCDResolution) to examine them. For FlashPix and JBIG files, which can contain images of various sizes, you must use this function to examine them.

You must allocate the array to be updated. One way to do this is to declare an array of the maximum size (29 elements). Another way is to call this function twice – the first time with NULL in the pDimensions parameter, so that you can get the number of elements and allocate storage of the appropriate size.

After you get the available resolutions, you can use the L_SetLoadResolution function to specify the one to be loaded.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetLoadResolution, L_SetLoadResolution, L_GetPCDResolution, L_GetSaveResolution, L_SetSaveResolution For Vector files: L_2DGetViewMode, L_2DSetViewMode, L_2DGetViewport, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing PhotoCD and FlashPix Features
 | Implementing JBIG Features

Example

/* This example shows how many physical resolutions are available,
selects the smallest one, then loads the file. */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
FILEINFO FileInfo; /* LEAD File Information structure, filled before calling TestLoad(). */

void TestLoad(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
pDIMENSION pDimensions; /* Pointer to the array to be updated */
HGLOBAL hDimensions; /* Handle to the buffer for the array */
L_INT DimensionCount; /* Number of physical resolutions */
L_TCHAR szMessage[256]; /* MessageBox string */
L_UINT32 uWidth; /* Width variable to be updated */
L_UINT32 uHeight; /* Height variable to be updated */
L_INT i; /* Loop counter */

/* Count the number of sizes */
L_ReadLoadResolutions(pszFilename, NULL, &DimensionCount, NULL);
/* Allocate memory to hold the array of DIMENSION structures */
hDimensions = GlobalAlloc(GMEM_MOVEABLE, sizeof(DIMENSION)* DimensionCount);
pDimensions = (pDIMENSION)GlobalLock( hDimensions );
/* Fill the array */
L_ReadLoadResolutions(pszFilename, pDimensions, &DimensionCount, NULL);
/* Display a message box that shows the available sizes */
wsprintf (szMessage, TEXT("Available dimensions:\n"));
for(i = 0; i < DimensionCount; ++i)
{
wsprintf (szMessage, TEXT("%s\n%d x %d"), szMessage,
pDimensions[i].nWidth, pDimensions[i].nHeight);
}
MessageBox( NULL, szMessage, TEXT("File Information"), MB_OK );
/* Set the size to load, the smallest size in this case */
L_SetLoadResolution(FileInfo.Format, pDimensions[0].nWidth, pDimensions[0].nHeight);
/* Free the memory that we allocated */
GlobalUnlock (hDimensions);
GlobalFree (hDimensions);
/* Get the dimensions that we just set and display them */
L_GetLoadResolution(FileInfo.Format, &uWidth, &uHeight, NULL);
wsprintf (szMessage, TEXT("Size that will be loaded:\n\n%d x %d"), uWidth, uHeight);
MessageBox( NULL, szMessage, TEXT("File Information"), MB_OK );
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (pszFilename, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Update the paint palette to force a repaint */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
}


L_RectFromBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RectFromBitmap(pBitmap, ViewPerspective, lprc)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT ViewPerspective; | /* destination view perspective */
LPRECT lprc; | /* pointer to the RECT structure to be translated */

Translates a Windows RECT structure from the bitmap's view perspective to the specified view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that contains the rectangle.
ViewPerspective | Destination view perspective to which the rectangle should be translated.
lprc | Pointer to the RECT structure to be translated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a Windows RECT structure and a pointer to it.
2. | Assign the values of a known rectangle in the bitmap.
3. | Call this function, passing the pointer to the RECT structure, and specifying the destination view perspective. (The function gets the source view perspective from the bitmap handle.)
4. | Get the translated rectangle from the RECT structure, which this function has updated.

For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PointFromBitmap, L_PointToBitmap, L_RectToBitmap, L_ChangeBitmapViewPerspective, L_RotateBitmapViewPerspective
Topics: | Accounting for View Perspective

Example

/* This example finds out where the RECT {10,10,100,100 } */
/* of the bitmap would be in a BOTTOM_LEFT ViewPerspective */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
RECT rc;
rc.top = 10;
rc.left = 10;
rc.bottom = 100;
rc.right = 100;
L_RectFromBitmap ( &LeadBitmap, BOTTOM_LEFT, &rc );


L_RectToBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RectToBitmap(pBitmap, nViewPerspective, lprc)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nViewPerspective; | /* source view perspective */
LPRECT lprc; | /* pointer to the RECT structure to be translated */

Translates a Windows RECT structure from a specified view perspective to the bitmap's view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap that contains the rectangle.
nViewPerspective | Source view perspective from which the rectangle should be translated.
lprc | Pointer to the RECT structure to be translated.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a Windows RECT structure and a pointer to it.
2. | Assign the values of the rectangle.
3. | Call this function, passing the pointer to the RECT structure, and specifying the source view perspective. (The function gets the destination view perspective from the bitmap handle.)
4. | Get the translated rectangle from the RECT structure, which this function has updated.

For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PointFromBitmap, L_PointToBitmap, L_RectFromBitmap, L_ChangeBitmapViewPerspective, L_RotateBitmapViewPerspective
Topics: | Accounting for View Perspective

Example

/* This example finds out where the RECT {10,10,100,100 } */
/* in the TOP_LEFT90 ViewPerspective actually is in the bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
RECT rc;
rc.top = 10;
rc.left = 10;
rc.bottom = 100;
rc.right = 100;
L_RectToBitmap ( &LeadBitmap, TOP_LEFT90, &rc );


L_RedirectIO

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_RedirectIO(pfnOpen, pfnRead, pfnWrite, pfnSeek, pfnClose, pUserData)

REDIRECTOPEN pfnOpen; | /* far pointer to an open procedure */
REDIRECTREAD pfnRead; | /* far pointer to a read procedure */
REDIRECTWRITE pfnWrite; | /* far pointer to a write procedure */
REDIRECTSEEK pfnSeek; | /* far pointer to a seek procedure */
REDIRECTCLOSE pfnClose; | /* far pointer to a close procedure */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Lets you replace the LEADTOOLS input/output functions for opening, reading, writing, seeking, and closing files.

Parameter | Description
pfnOpen | Far pointer to an open procedure. Use NULL to reset to the default. For a description of the callback function syntax, refer to REDIRECTOPEN Callback Function.
pfnRead | Far pointer to a read procedure. Use NULL to reset to the default. For a description of the callback function syntax, refer to REDIRECTREAD Callback Function.
pfnWrite | Far pointer to a write procedure. Use NULL to reset to the default For a description of the callback function syntax, refer to REDIRECTWRITE Callback Function.
pfnSeek | Far pointer to a seek procedure. Use NULL to reset to the default. For a description of the callback function syntax, refer to REDIRECTSEEK Callback Function.
pfnClose | Far pointer to a close procedure. Use NULL to reset to the default. For a description of the callback function syntax, refer to REDIRECTCLOSE Callback Function.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

None.

Comments

For example, you can redirect all of the LEADTOOLS I/O functions by using the multimedia extensions, or you can redirect all the toolkit I/O functions to your own I/O functions.

Use a NULL argument to reset an I/O function to its default setting. The redefinition of the I/O process is left to you to define.

This function cannot be used in combination with L_FeedLoad, L_LoadBitmapMemory, L_LoadMemory, L_StartFeedLoad, L_StopFeedLoad, L_SaveBitmapMemory, and L_SaveFileMemory.

Note:

This function does not support Kodak PhotoCD (PCD), FlashPix (FPX), or Microsoft FAX (AWD) files.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For complete sample code, refer to the REDIRECT example.

/* This example loads a file using redirected input and output.
Refer to the individual callback function descriptions to see how they are implemented. */

/************************** Global Declarations **********************************/
typedef struct tagDATA
{
HPALETTE hPalette; /* Logical palette for painting. */
L_TCHAR szFilename[128]; /* File name to load. */
FILEINFO FileInfo; /* FILEINFO structure. */
BITMAPHANDLE BitmapHandle; /* BITMAP HANDLE to hold the image. */
} DATA;
typedef struct tagUSERDATA
{
L_INT32 dwSize; /* Size of the buffer. */
L_INT32 dwUsed; /* Number of bytes used. */
L_CHAR L_HUGE *pData; /* Pointer to the buffer. */
L_CHAR L_HUGE *pCurData; /* Current pointer location. */
} USERDATA, L_FAR * LPUSERDATA;

/* Proc pointers for callback functions */
REDIRECTREAD lpfnCallBackRead; /* For MakeProcInstance */
REDIRECTOPEN lpfnCallBackOpen; /* For MakeProcInstance */
REDIRECTWRITE lpfnCallBackWrite; /* For MakeProcInstance */
REDIRECTSEEK lpfnCallBackSeek; /* For MakeProcInstance */
REDIRECTCLOSE lpfnCallBackClose; /* For MakeProcInstance */

DATA Data; /* Pointer to DATA structure */
HANDLE hInst; /* Current instance of the application */
HANDLE hBuf; /* Handle for globally allocated memory */
USERDATA UserData; /* User structure for I/O operation */

/* Prototypes for callback functions */
L_INT L_FAR L_EXPORT WindowsClose (L_INT FD, L_VOID L_FAR* pUserData);
L_INT32 L_FAR L_EXPORT WindowsSeek (L_INT FD, L_INT32 lnPos, L_INT nCount, L_VOID L_FAR* pUserData);
L_UINT L_FAR L_EXPORT WindowsWrite (L_INT FD, L_CHAR L_FAR * pBuf, L_UINT uCount, L_VOID L_FAR* pUserData);
L_UINT L_FAR L_EXPORT WindowsRead (L_INT FD, L_CHAR L_FAR * pBuf, L_UINT uCount, L_VOID L_FAR* pUserData);
L_INT L_FAR L_EXPORT WindowsOpen (const L_CHAR L_FAR * pFile, L_INT nMode, L_INT nShare, L_VOID L_FAR* pUserData);

/***************************************************************************************/
BOOL Window_OnCreate (HWND hWnd, CREATESTRUCT FAR * lpCreateStruct)
{
L_INT32 lSizeToRead;
HFILE hFile;
L_INT nRet;
UNREFERENCED_PARAMETER (lpCreateStruct);
/* We will allocate a buffer of the image size and read the image into it,
then all of our I/O operations will be operate on this buffer */
#ifdef UNICODE

hFile = _wopen (Data.szFilename, OF_READ | OF_SHARE_DENY_WRITE);

#else

hFile = _lopen (Data.szFilename, OF_READ | OF_SHARE_DENY_WRITE);

#endif

UserData.dwSize = _llseek (hFile, 0, FILE_END);
_llseek (hFile, 0, FILE_BEGIN);
/* Allocate a buffer to hold the file. */
hBuf = GlobalAlloc (GMEM_MOVEABLE, UserData.dwSize);
UserData.pData = (L_CHAR L_FAR *)GlobalLock (hBuf);
UserData.pCurData = UserData.pData;
UserData.dwUsed = 0;
lSizeToRead = 0;
/* Read the file in a loop, because the file could be larger than a single
read can request. */
while (lSizeToRead < UserData.dwSize)
{
nRet = _lread (hFile, (L_VOID L_HUGE *) UserData.pCurData,
(L_INT) min (UserData.dwSize - lSizeToRead, 32000));
lSizeToRead += nRet;
UserData.pCurData += nRet;
}
UserData.pCurData = UserData.pData;
_lclose (hFile);
/* Create instances of each I/O function*/
lpfnCallBackOpen = (REDIRECTOPEN) MakeProcInstance ((FARPROC) WindowsOpen, hInst);
lpfnCallBackRead = (REDIRECTREAD) MakeProcInstance ((FARPROC) WindowsRead, hInst);
lpfnCallBackWrite = (REDIRECTWRITE) MakeProcInstance ((FARPROC) WindowsWrite, hInst);
lpfnCallBackSeek = (REDIRECTSEEK) MakeProcInstance ((FARPROC) WindowsSeek, hInst);
lpfnCallBackClose = (REDIRECTCLOSE) MakeProcInstance ((FARPROC) WindowsClose, hInst);
/* Initialize the bitmap to the image width, height, and 8 bits per pixel. */
L_InitBitmap (&Data.BitmapHandle, sizeof(BITMAPHANDLE), Data.FileInfo.Width,
Data.FileInfo.Height, 8);
/* Use our own routines to replace the internal I/O calls */
L_RedirectIO ((REDIRECTOPEN) lpfnCallBackOpen,
(REDIRECTREAD) lpfnCallBackRead,
(REDIRECTWRITE) lpfnCallBackWrite,
(REDIRECTSEEK) lpfnCallBackSeek,
(REDIRECTCLOSE) lpfnCallBackClose, &UserData);
/* Load the bitmap as an 8 bit */
nRet = L_LoadBitmap (Data.szFilename, &Data.BitmapHandle, sizeof(BITMAPHANDLE), 8, ORDER_RGB, NULL, NULL);
/* Reset the I/O routines to the default ones. */
L_RedirectIO (NULL, NULL, NULL, NULL, NULL, NULL);
/* Free the function instances */
FreeProcInstance ((FARPROC) lpfnCallBackOpen);
FreeProcInstance ((FARPROC) lpfnCallBackRead);
FreeProcInstance ((FARPROC) lpfnCallBackWrite);
FreeProcInstance ((FARPROC) lpfnCallBackClose);
FreeProcInstance ((FARPROC) lpfnCallBackSeek);
FORWARD_WM_QUERYNEWPALETTE (hWnd, SendMessage);
GlobalUnlock (hBuf);
GlobalFree (hBuf);
return (nRet); /* SUCCESS (TRUE) if creation is OK */
}


L_ReleaseBitmap

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_ReleaseBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Releases memory back to Windows, reversing the action of the L_AccessBitmap function. This has the same effect as the Windows API GlobalUnlock function.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be released.

Returns

None.

Comments

Use this along with the L_AccessBitmap function to control the access to bitmap data in memory. Any attempt to access the image data after calling L_ReleaseBitmap will result in an application error.

You should call this function whenever the image is not used, so that Windows can manage its memory properly.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AccessBitmap, L_ClearBitmap, L_GetBitmapRow, L_PutBitmapRow, L_GetBitmapRowCol, L_PutBitmapRowCol, L_GetPixelColor, L_PutPixelColor
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For a short example, refer to L_GetBitmapRow. For complete sample code, refer to the RESIZE example.


L_RemapBitmapHue

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RemapBitmapHue(pBitmap, pMask, pHTable, pSTable, pVTable, uLUTLen)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR pMask; | /* table of 256 bytes identifying valid values in hue table */
L_UINT L_FAR pHTable; | /* table of 256 bytes representing the hue lookup table */
L_UINT L_FAR pSTable; | /* table of 256 bytes representing the saturation lookup table */
L_UINT L_FAR pVTable; | /* table of 256 bytes representing the value lookup table */
L_UINT uLUTLen; | /* length of the lookup table */

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 pMask table. It is used for all resolutions, including 48 and 64-bit images.

Parameter | Description
pMask | Lookup table that identifies which values in the pHTable, pSTable and pVTable are valid. If pMask[i] is non-zero, then pHTable, pSTable and pVTable are to be used. If pMask[i] is 0 then pHTable, pSTable and pVTable are ignored. If pMask is NULL, all entries in the pHTable, pSTable and pVTable are used.
pHTable | Hue look up table. If the pMask table value for a particular pixel hue is non-zero, then the hue is changed to the corresponding entry in pHTable. For example, if a pixel value has a hue of 85 and pMask[85] is non-zero, the hue is changed to pHTable[85]. If pHTable is NULL, the hue of each pixel is unchanged.
pSTable | Saturation look up table. If the pMask table value for a particular pixel hue is non-zero, then the saturation is changed to the corresponding entry in pSTable. For example, if a pixel value has a hue of 85 and pMask[85] is non-zero, the saturation is changed to pSTable[85]. If pHTable is NULL, the saturation is changed to pSTable[85]. If pSTable is NULL, the saturation of each pixel is unchanged.
pVTable | Value look up table. If the pMask table value for a particular pixel hue is non-zero, then the value is changed to the corresponding entry in pVTable. For example, if a pixel value has a hue of 85 and pMask[85] is non-zero, the value is changed to pVTable[85]. If pHTable is NULL, the value is changed to pVTable[85]. If pVTable is NULL, the value of each pixel is unchanged.
uLUTLen | Length of the lookup table. Possible values are:
 | Value | Meaning
 | 65536 | 16-bit image
 | 4096 | 12-bit image
 | 256 | 8-bit image

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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<(uLUTLen – 1) and

0<=y<x

or in the HSV color space

HSV(0,x,x) where

0<=x<=(uLUTLen – 1)

The pMask lookup table identifies which values in the pHTable are valid. If a pMask value is 0, then the corresponding value in the pHTable is ignored. If a pMask value is non-zero, then the corresponding value in the pHTable is used. For example, if a pixel has a hue value of 240 and pMask[240] is nonzero, then the hue value of 240 is replaced with pHTable[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.. uLUTLen – 1. For example, if uLUTLen = 256

This function 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 function.

Color | Hue(0..359) | Hue(0..255)
Red | 0 | 0
Green | 120 | 85
Blue | 240 | 170

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Use L_RGBtoHSV() and L_HSVtoRGB to convert between RGB and HSV colorspace.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColorHSVRange, L_SetBitmapRgnColorRGBRange, L_RGBtoHSV, L_HSVtoRGB, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Using Color Values in LEADTOOLS

Example

// This example changes all green hues (and hues near green) to the hue of crNewColor
// The example uses the following macros:
#define INCREMENT(x, uLUTLen) ((x+1)% uLUTLen)
#define DECREMENT(x, uLUTLen) ((x+ (uLUTLen – 1))% uLUTLen)
#define ADD(x,y, uLUTLen) ((x+y)% uLUTLen)
L_INT TestFunction(pBITMAPHANDLE pBitmap, COLORREF crNewColor)
{
L_UINT L_FAR * uMaskTable;
L_UINT L_FAR * uHueTable;
HSVREF hsvRef;
L_UINT uHueGreen, uHueChange;
L_INT iHueChange;
L_INT i, iCount, nRet, uLUTLen;

if(pBitmap->BitsPerPixel >= 48)
uLUTLen = 0x10000;
else if(!ISGRAY(pBitmap))
uLUTLen = 256;
else if(pBitmap->pLUT && pBitmap->Flags.UseLUT)
uLUTLen = 256;
else
uLUTLen = (1 << pBitmap->BitsPerPixel);

//Allocate tables
uMaskTable = malloc (uLUTLen * sizeof(L_UINT));
uHueTable = malloc (uLUTLen * sizeof(L_UINT));

//Initialize tables
for (i=0; i<uLUTLen; i++)
{
uMaskTable[i] = 0;
uHueTable[i] = i;
}

//Get the hue for green
hsvRef = L_RGBtoHSV(RGB(0,255,0));
uHueGreen = hsvRef.uH;

//Obtain new hue
hsvRef = L_RGBtoHSV(crNewColor);
iHueChange = (L_INT)hsvRef.uH - (L_INT)uHueGreen;
uHueChange = (iHueChange>0) ? (L_UINT)iHueChange : (L_UINT)(iHueChange + (uLUTLen – 1));
uHueGreen *= (uLUTLen - 1)/255;
uHueChange *= (uLUTLen - 1)/255;

//Set values in uHueTable, uMaskTable
uHueTable[uHueGreen] = (uHueTable[uHueGreen] + uHueChange);
uMaskTable[uHueGreen] = 1;

//set the hues near green (+/- 15)
iCount = (15 * (uLUTLen - 1))/255;
for (i=INCREMENT(uHueGreen,uLUTLen); iCount > 0; i = INCREMENT(i, uLUTLen), iCount--)
{
uHueTable[i] = ADD(uHueTable[i], uHueChange, uLUTLen);
uMaskTable[i] = 1;
}
iCount = (15 * (uLUTLen - 1))/255;
for (i=DECREMENT(uHueGreen, uLUTLen); iCount > 0; i =DECREMENT(i, uLUTLen), iCount--)
{
uHueTable[i] = ADD(uHueTable[i],uHueChange, uLUTLen);
uMaskTable[i] = 1;
}

nRet = L_RemapBitmapHue(pBitmap, uMaskTable, uHueTable, NULL, NULL, uLUTLen);
if(uMaskTable)
free(uMaskTable);
if(uHueTable)
free (uHueTable);
return nRet;
}


L_RemapBitmapIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RemapBitmapIntensity(pBitmap, pLUT, uLUTLen, uChannel)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR * pLUT; | /* table of uLUTLen integers containing lookup values */
L_UINT uLUTLen; | /* length of the lookup table */
L_UINT uChannel; | /* color plane indicator */

Uses a lookup table to change a bitmap's intensity values. You can apply the change to red, green, blue, or all color channels.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
pLUT | Table of uLUTLen integers containing lookup values.
uLUTLen | Length of the lookup table. Possible values are:
 | Value | Meaning
 | 65536 | 16-bit / sample image
 | 4096 | 12-bit / sample image
 | 256 | 8-bit / sample image
uChannel | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The current intensity values correspond to the table indexes. The values of the entries are the new values to be applied.

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.

The bitmap intensity level range depends on the resolution of the image. For 64-bit, 48-bit, and 16-bit bitmaps, the intensity levels range form 0 to 2^16-1. For 12-bit bitmaps, the intensity levels range from 0 to 2^12-1. For other resolutions, the intensity levels range from 0 to 255.

Be sure that pLUT contains the number of the bitmap intensity levels. For example if the bitmap is 16-bit (the maximum bitmap intensity level is 2^16 – 1).

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_GetUserLookUpTable, L_GetFunctionalLookUpTable, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

/* This example will invert loaded bitmap by using lookup table affected by linear function*/

L_UINT LookupTable[256]; /* Array to hold lookup table*/
BITMAPHANDLE LeadBitmap; /*Bitmap handle to hold the loaded image */

/* Load the bitmap, forced to 24 per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/*Get Lookup table where the array calculated by the linear function for all the items of the array is from 0 - 255*/
LookupTable[0] = 255;
LookupTable[255] = 0;
L_GetFunctionalLookupTable (LookupTable, 256,0, 255, 0, FLT_LINEAR);
L_RemapBitmapIntensity(&LeadBitmap, LookupTable, 256, CHANNEL_MASTER);


L_RemoveBitmapListItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RemoveBitmapListItem(hList, uIndex, pBitmap)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uIndex; | /* position of the bitmap in the list */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */

Removes a bitmap from the list, and lets you treat it as an individual bitmap.

Parameter | Description
hList | Handle to the list of bitmaps.
uIndex | Position of the bitmap in the list. Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9. When you remove a bitmap from a list, the indexes of other bitmaps change to accommodate the removal.
pBitmap | Pointer to the bitmap handle that you can use afterward to work with the individual bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function does not free the bitmap. If you want to remove a bitmap from a list and free the bitmap, you should use L_DeleteBitmapListItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/* This example removes even numbered bitmaps from a list and deletes them. */
void TestModifyList(HBITMAPLIST hList)
{
BITMAPHANDLE TmpBitmap; /* Temporary bitmap for manipulating the list */
L_UINT i; /* Loop counter */
L_UINT uCount; /* Number of bitmaps in the list */
/* Remove even numbered bitmaps from the list and delete them */
L_GetBitmapListCount(hList, &uCount);
for (i = 0; i <= uCount; i += 2)
{
L_RemoveBitmapListItem(hList, i, &TmpBitmap);
L_FreeBitmap(&TmpBitmap);
}
}


L_RemoveRedeyeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RemoveRedeyeBitmap(pBitmap, rcNewColor, uThreshold, nLightness)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF rcNewColor; | /* new eye color */
L_UINT uThreshold; | /* threshold value */
L_INT nLightness; | /* lightening or darkening value */

Removes the "red eye" effect in color images by converting the red color in the eye to the new specified color.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be modified.
rcNewColor | COLORREF variable that contains the new color value used to replace the red color in the eyes.
uThreshold | Threshold value that indicates which pixels will be changed by this function. 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.
nLightness | "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 function preserves the lightness of the original pixels and substitutes the red color with the new color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function has no effect on grayscale images, since there is no "red eye" problem in grayscale images.

To use this function the user should select a small region around the eye. Otherwise, the function will change all the red color in the image. This function also allows the user to replace the red color with a new color for the eyes that is nearest to the original color.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports 48 and 64-bit color images. Support for 48 and 64-bit color images is available only in the Document/Medical toolkits.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_SetStatusCallback, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Applying Artistic Effects

Correcting Colors

Raster Image Functions: Modifying Intensity Values

Raster Image Functions: Getting and Setting Pixel Values

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap that has a red eye problem, creates an elliptical region, and applies the redeye removal function on it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
void TestFunction(HWND hWnd)
{
RECT rRgnRect; /* Rectangle that defines the region */
COLORREF rcNewColor; /* the new color of the eyes */
/* Load a bitmap */
L_LoadBitmap (TEXT("REDEYE.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Specify a rectangle to define the region rounded the eye. This region is specified by the mouse on the IMGFEATR demo*/
SetRect(&rRgnRect, 80, 20, 100, 40);
/* Create an elliptical region */
L_SetBitmapRgnEllipse(&LeadBitmap, NULL, &rRgnRect, L_RGN_SET);
/* Specify the new color for eyes */
rcNewColor = RGB(5, 20, 10);
/* Apply the redeye removal function */
L_RemoveRedeyeBitmap(&LeadBitmap, rcNewColor, 125, 100);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
}


L_RenderZoomView

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RenderZoomView(hDC ,hWnd)

HDC hDC; | /* handle to the device context for display */
HWND hWnd; | /* handle to a window */

Displays the Zoom Views that are attached to the specified window in the specified device context.

Parameter | Description
hDC | Handle to the device context where the Zoom View(s) are to be displayed.
hWnd | Handle to a window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

Anytime the window receives a WM_PAINT message, you should call the L_RenderZoomView function in order to display the Zoom View(s) attached to the window.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount
Topics: | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_CreateZoomView.


L_ResampleBitmap

This function has been removed. You can achieve the same functionality by calling L_SizeBitmap and passing SIZE_RESAMPLE for uFlags.


L_Resize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_Resize(pBuffer, nRow, nBitsPerPixel, pXSize, pYSize, pResizeData)

L_UCHAR, L_FAR * pBuffer; | /* pointer to the buffer with a line to be resized */
L_INT nRow; | /* current row of the original bitmap */
L_INT nBitsPerPixel; | /* bits per pixel of both bitmaps */
L_INT L_FAR * pXSize; | /* address of a variable for the resized width */
L_INT L_FAR * pYSize; | /* address of a variable for the required repetitions */
L_VOID L_FAR* pResizeData; | /* pointer to the data packet */

Resizes a buffer to the new size specified with the L_StartResize function.

Parameter | Description
pBuffer | Pointer to the buffer containing a line from the original image to be resized. Your code must allocate the buffer and copy the data into it before calling this function.
 | The same buffer holds the data before and after it is resized. Therefore, the buffer must be big enough to hold whichever is larger. (The original line is larger when reducing an image; the resulting line is larger when enlarging the image.)
nRow | Current row of the original bitmap.
nBitsPerPixel | Bits per pixel, which is the same for the original and the resized bitmap.
pXSize | Address of an integer variable to be updated with the width of the resized line. This function updates the variable with number of pixels the new line was sized to.
pYSize | Address of an integer variable to be updated with the required number of copy repetitions. This function updates the variable with the number of times needed to copy the new resized line buffer to the new image.
 | When an image is being enlarged, some lines must be copied more than once. When an image is being reduced, some lines must be eliminated (not copied at all). For example:
 | A value of 0 means that the line should not be copied.
 | A value of 1 means that the line should be copied once.
 | A value of 2 means that the line should be copied twice.
 | And so on ....
pResizeData | Pointer to the data packet used in L_StartResize. If L_Resize is called from within a callback procedure, then it is recommended that you pass pResizeData as part of your user data parameter in the callback procedure. This is required to prevent the loss of the address of pResizeData if the segment is changed in a 16-bit operating system.

Returns

>= 0 | The value of the pYSize parameter, indicating the number of times the line was copied.
< 0 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must do the following:

1. | Call the L_StartResize function.
2. | Declare and allocate a buffer (pBuffer) to hold each line. The same buffer holds the data before and after it is resized. Therefore, the buffer must be big enough to hold whichever is larger. (The original line is larger when reducing an image; the resulting line is larger when enlarging the image.)
3. | Declare two integer variables (pXSize and pYSize), which this function will update with information about the compressed line of data.

When all lines have been processed, you must call L_StopResize.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ResampleBitmap, L_ResizeBitmap, L_SizeBitmap, L_StartResize, L_StopResize, L_DlgResize
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For a short example, refer to L_StartResize. For complete sample code, refer to the RESIZE example.


L_ResizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ResizeBitmap(pSrcBitmap, pDstBitmap, uFlags)

pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
pBITMAPHANDLE pDstBitmap; | /* pointer to the destination bitmap handle */
L_UINT uFlags; | /* flags that determine resizing options */

Resizes the image from an existing bitmap, and puts the resized image into a destination bitmap, leaving the original bitmap intact.

Parameter | Description
pSrcBitmap | Pointer to the bitmap handle referencing the source bitmap.
pDstBitmap | Pointer to the bitmap handle referencing the destination bitmap to contain the new resized image.
uFlags | Flags that determine resizing options. Possible values are:
 | Value | Meaning
 | SIZE_NORMAL | [0x0000] Resize normally.
 | SIZE_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 bitwise OR ( | ) to combine this flag with another one. For example, SIZE_RESAMPLE | SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You are responsible for allocating enough storage for the destination bitmap. If only one copy is desired, use the L_SizeBitmap function instead of this one.

If you are working with an 8-bit or less image, before calling this function, you must ensure that both bitmap handles refer to the same palette. To do so, you can use the L_CopyBitmapPalette function to duplicate the palette as follows:

L_CopyBitmapPalette(&DestinationBitmap, &SourceBitmap.hPalette);

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_DlgResize , L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a temporary bitmap, and uses L_ResizeBitmap to create a new
bitmap half the size of the original. The example also demonstrates low-level functions for
initializing and allocating a bitmap. The same tasks can be done more efficiently with
high-level functions. */
/* Note that the result is not very good because we resize a dithered image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
L_INT NewWidth, NewHeight; /* Resize dimensions */
/* Load the temporary bitmap at 8 bits per pixel so that we can demonstrate
how to handle its palette. */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);
/* Define the dimensions for resizing */
NewWidth = TmpBitmap.Width / 2;
NewHeight = TmpBitmap.Height / 2;
/* Initialize the new bitmap handle. */
L_InitBitmap( &LeadBitmap, sizeof(BITMAPHANDLE), NewWidth, NewHeight, TmpBitmap.BitsPerPixel );
/* Allocate the storage to hold the image data. */
L_AllocateBitmap( &LeadBitmap, TYPE_CONV );
/* Duplicate the palette */
L_CopyBitmapPalette(&LeadBitmap, &TmpBitmap);
/* Set other useful values in the bitmap handle */
LeadBitmap.ViewPerspective = TmpBitmap.ViewPerspective;
LeadBitmap.XResolution = TmpBitmap.XResolution;
LeadBitmap.YResolution = TmpBitmap.YResolution;
LeadBitmap.Order = TmpBitmap.Order;
/* Resize TmpBitmap to create LeadBitmap */
L_SaveBitmap(TEXT("d:\\temp\\RESIZE.BMP"), &LeadBitmap, FILE_BMP, 0, 0, NULL);
L_ResizeBitmap (&TmpBitmap, &LeadBitmap, SIZE_NORMAL);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
/* Free the resized bitmap */
L_FreeBitmap(&LeadBitmap);


L_ResizeBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ResizeBitmapRgn(pBitmap, uDim, uFlag, bAsFrame)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* number of pixels to resize the width */
L_UINT uFlag; | /* flag */
L_BOOL bAsFrame; | /* flag */

Resizes a bitmap region by the specified number of pixels.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to resize.
uDim | Number of pixels by which to resize the region.
uFlag | 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.
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 uDim for the resized region. If uFlag is RGN_EXPAND, the frame created will exist outside the boundaries of the resized region. If uFlag is RGN_CONTRACT, the frame will be within the boundaries of the resized region.
 | FALSE | Resize the region only. Do not create a frame.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function keeps the same bitmap handle and resizes the bitmap region that it references.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_ResizeBitmap, L_StartResize, L_Resize, L_StopResize, L_DlgResize
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

/*For complete sample code, refer to the ImgChd.c module of the IMGFEATR example. */

/* This example changes a bitmap region size */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

void TestFunction( )
{
RECT rRgnRect; /* Rectangle that defines the region /
/* Load a bitmap */
L_LoadBitmap (TEXT("RESIZERGN.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE),0,ORDER_BGR,NULL, NULL);
/* Specify a rectangle to define a region , this region specify by the mouse on IMGFEATR demo*/
SetRect(&rRgnRect, 80, 20, 100, 40);
/* Create an elliptical region */
L_SetBitmapRgnEllipse (&LeadBitmap, NULL, &rRgnRect, L_RGN_SET);
/* contract the bitmap region by 20 pixels*/
L_ResizeBitmapRgn(&LeadBitmap, 20, RGN_CONTRACT, FALSE);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
}


L_RevEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RevEffectBitmap(pBitmap, uLineSpace, uMaximumHeight)

pBITMAPHANDLE pBitmap; | /* pointer to bitmap handle */
L_UINT uLineSpace; | /* spacing between lines */
L_UINT uMaximumHeight; | /* maximum wave height */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uLineSpace | The space (in pixels) between each wave.
uMaximumHeight | The maximum height (in pixels) that the wave can reach.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function, 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 uLineSpace parameter.

You can get a more stable wave by performing either of the following:

Apply any type of blur like L_GaussianFilterBitmap blur with a large nRadius value.

Apply the L_RevEffectBitmap and pass a small value to uMaximumHeight.

Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_EmbossBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply Rev effect on the image*/
L_RevEffectBitmap (&LeadBitmap, 3, 37);


L_ReverseBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReverseBitmap(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Reverses the specified bitmap (left to right) to produce a mirror image.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to reverse.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RotateBitmap, L_RotateBitmapFine, L_ShearBitmap, L_FlipBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the FEATURE2 example.

/* This example loads a bitmap and reverses it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Reverse the bitmap */
L_ReverseBitmap(&LeadBitmap);


L_ReverseBitmapViewPerspective

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ReverseBitmapViewPerspective(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Performs a fast reverse operation by changing the bitmap's view perspective.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to reverse.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function is similar to L_RotateBitmapViewPerspective.

The bitmap data remains unchanged.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReverseBitmap, L_RotateBitmapViewPerspective, L_RotateBitmap, L_RotateBitmapFine, L_ShearBitmap, L_FlipBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For complete sample code, refer to the FEATURE2 example.

/* This example loads a bitmap and reverses it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Reverse the bitmap */
L_ReverseBitmapViewPerspective(&LeadBitmap);


L_RGBtoHSV

#include "l_bitmap.h"

HSVREF EXT_FUNCTION L_RGBtoHSV(crColor)

COLORREF crColor;

/* RGB input value */

Returns an HSV value that is an equivalent representation of the specified RGB value.

Parameter | Description
crColor | The RGB input value.

Returns

An HSVREF that contains the Hue, Saturation, Value equivalent of the specified RGB value.

Comments

The HSV value is the Hue ,Saturation, Value color space. Traditionally, hue ranges from 0 to 359. However, the hue component of the HSVREF is represented by an unsigned byte. Therefore, 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 ranges from 0 to 255 where 0 means the highest amount of white and 255 means no white.

Value ranges from 0 to 255 where 0 means highest amount of black and 255 means no black.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RemapBitmapHue, L_SetBitmapRgnColorHSVRange, L_SetBitmapRgnColorRGBRange, L_HSVtoRGB, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Doing Color Space Conversion
 | Working with an Existing Bitmap Region
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Using Color Values in LEADTOOLS

Example

For an example, refer to L_RemapBitmapHue.


L_RingEffectBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RingEffectBitmap (pBitmap, nXOrigin, nYOrigin, uRadius, uRingCount, uRandomize, crColor, nAngle, uFlags);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nXOrigin; | /* the X – coordinate of the rings’ center */
L_INT nYOrigin; | /* the Y – coordinate of the rings’ center */
L_UINT uRadius; | /* maximum radius of all the rings or the width of each ring */
L_UINT uRingCount; | /* number of rings */
L_UINT uRandomize; | /* starting point for randomization process */
COLORREF crColor; | /* color for filling exposed areas */
L_INT nAngle; | /* angle of rotation */
L_UINT uFlags; | /* flags */

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 function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be modified.
nXOrigin | The X-Coordinate (in pixels) for the origin of the rings.
nYOrigin | The Y-Coordinate (in pixels) for the origin of the rings.
uRadius | If the flag RING_RADIUS is set in uFlags, this is the width of each ring, in pixels. If RING_MAXRADIUS is set in uFlags, this is the maximum radius, in pixels. In this latter case, the width of each ring is equal to uRadius / uRingCount + 1.
uRingCount | Number of rings.
uRandomize | The starting point for randomization process. Valid range is 0-500. If 0, the function will pick the starting point. If > 0, this value will be the starting point.
crColor | The color used to fill the undefined area. This parameter is used only if uFlags contains RING_COLOR.
nAngle | The rotation angle value for each ring compared to the inner ring, in hundredths of degrees. This parameter is used only if uFlags contains RING_FIXEDANGLE. The range of the acceptable values is from –18000 to 18000. This value is divided internally by 100.
uFlags | Flags which control the function’s 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 undefined 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 (nAngle).
 | RING_RADIUS | [0x0100] Indicates that uRadius contains the width of each ring, in pixels. If you use this flag, do not use RING_MAXRADIUS.
 | RING_MAXRADIUS | [0x0200] Indicates that uRadius contains the maximum radius, in pixels, that corresponds to the external ring. In this case, the width of each ring is uRadius / uRingCount + 1. If you use this flag, do not use RING_RADIUS.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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.

Divides the image into a certain number of rings. Each ring is rotated compared to its inner ring according to a shift angle. The function will pick the shift angle at random (if RING_FIXEDANGLE flag is not set) or will use the angle specified by nAngle (RING_FIXEDANGLE flag is set).

If RING_FIXEDANGLE flag is not set then the function will pick the shift angle randomly. The starting point (that is, the "randomize value") for the random number generator is selected through the uRandomize parameter, as follows:

If uRandomize is set to zero then the function will select a random value between 1 and 500 for the randomize value.

If uRandomize is > 0, it will be used for the randomize value. Note that uRandomize should be between 1 and 500 in this case.

Although the numbers generated are random, if you start with the same randomize value you will always get the same sequence of random numbers. This means that if you call the function twice with the same value for uRandomize, you will get the same result.

The center of the rings is determined by the nXOrigin and nYOrigin parameters. The function calculates the width of each ring by dividing the maximum radius (uRadius when uFlags is set to RING_MAXRADIUS) by the number of rings (uRingCount + 1).

The minimum width of each circle is 2. If the result of the division is less than 2, the function will draw uRadius / 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 function 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 nAngle. In other words, each index will be rotated against the original position by nAngle * <ring index>. (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 function will pick random rotation angles for each ring.

The width of the ring is determined as follows:

If RING_RADIUS is set, uRadius is the width of each ring

If RING_MAXRADIUS is set, uRadius will be the maximum ring radius. In this case, the width of each ring will be uRadius / uRingCount + 1.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_MosaicBitmap, L_PicturizeBitmap, L_PicturizeBitmapList, L_PicturizeBitmapSingle, L_PixelateBitmap, L_CubismBitmap, L_DiceEffectBitmap, L_PuzzleEffectBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

/* This example loads a bitmap and applies a Spiral Effect over the loaded image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
L_UINT uXorg, uYorg, uRadius;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

uXorg = (L_UINT)(LeadBitmap.Width/2);
uYorg = (L_UINT)(LeadBitmap.Height/2);
uRadius = uXorg;

/* Apply a ring effect to this bitmap with origin (uXorg, uYorg). The maximum ring radius is equal to half of the bitmap’s width. Draw 10 rings, fill the undefined areas with the Black color and the shift angle is equal to 1 degrees. Note that you will have undefined areas only if the bitmap width is greater than the bitmap height. */
L_RingEffectBitmap(&LeadBitmap, uXorg, uYorg, uRadius, 10, 0, RGB(0,0,0), 100, RING_COLOR | RING_FIXEDANGLE | RING_MAXRADIUS);


L_RippleBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RippleBitmap (pBitmap, uAmplitude, uFrequency, nPhase, uAttenuation, CenterPt, crFill, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* wave's magnitude */
L_UINT uFrequency; | /* number of repeated waves */
L_INT nPhase; | /* wave phase shift */
L_UINT uAttenuation; | /* amplitude decay rate */
POINT CenterPt; | /* effect center */
COLORREF crFill; | /* color value */
L_UINT uFlag; | /* flag */

Warps the image in concentric rings. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmplitude | Wave magnitude(amount of displacement).
uFrequency | Number of repeated waves along the radial line.
nPhase | Wave phase shift, in hundredths of degrees. The valid range is from –36000 to 36000 (The value in degrees is nPhase divided by 100).
uAttenuation | 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.
CenterPt | POINT structure that contains the center of the Ripple wave.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will warp the image as a series of rings radiating out from the CenterPt. 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgRippler , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Ripple bitmap*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_RippleBitmap (&LeadBitmap, 20, 10, 0, 0, CenterPt, 0, FILL_RPT);


L_RomanMosaicBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RomanMosaicBitmap(pBitmap, uTileWidth, uTileHeight, uBorder, uShadowAngle, uShadowThresh, crColor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uTileWidth; | /* tile width */
L_UINT uTileHeight; | /* tile height */
L_UINT uBorder; | /* tile border */
L_UINT uShadowAngle; | /* shadow angle */
L_UINT uShadowThresh; | /* shadow threshold */
COLORREF crColor; | /* background color */
L_UINT uFlags; | /* flags */

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. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
uTileWidth | Value that indicates the width of the tile, in pixels. The meaning of the uTileWidth parameter differs according to the flags that are set in the uFlags member. Possible values are:
 | If uFlags contains | uTileWidth 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.
uTileHeight | Value that indicates the height of the tile. The meaning of the uTileHeight parameter differs according to the flags that are set in the uFlags member. Possible values are:
 | If uFlags contains | uTileHeight 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.
uBorder | Value that indicates the border width (space between the tiles), in pixels. The valid range is from 1 to 15.

uShadowAngle | Angle value indicating the direction of the light source that produces the shadow. This member can be used if the RMN_SHADOWRGB flag or the RMN_SHADOWGRAY flag is set. 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.
uShadowThresh | Value that is used to determine which pixels will be affected by the shadow. Valid values range from 0 through 255. This member will be used if the MSCT_SHADOWRGB flag or the MSCT_SHADOWGRAY flag is set. Pixels with values above this threshold will be affected.
crColor | The COLORREF value that specifies the fill color to be used in between the tiles. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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 uTileWidth contains the tile width in pixels, and uTileHeight 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 uTileWidth 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function 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 L_RomanMosaicBitmap function using the following values:

Parameter | Value
uTileWidth | 2
uTileHeight | 2
uBorder | 20
uShadowAngle | na
uShadowThresh | na
crColor | Black
uFlags | RMN_BOTH | RMN_FLAT

The following figure results:

Use the L_MosaicBitmap function 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 L_PixelateBitmap function 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 L_MosaicTilesBitmap function 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 L_PointillistBitmap function to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_PixelateBitmap, L_MosaicTilesBitmap, L_PointillistBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects

Example

/* Apply the Roman Mosaic effect using rectangular tiles, with gray shadows */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("Image1.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
L_RomanMosaicBitmap(&LeadBitmap, 15, 15, 5, SHADOW_E, 0, RGB(0,0,0), RMN_BOTH | RMN_SHADOWGRAY);


L_RotateBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RotateBitmap(pBitmap, nAngle, uFlags, crFill)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* hundredths of degrees to rotate (+/-) */
L_UINT uFlags; | /* resize flag */
COLORREF crFill; | /* background fill color */

Rotates a bitmap by the number of degrees specified.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
nAngle | Hundredths of degrees to rotate (+/-). This can be a number from 0 to 36,000. A positive value will rotate the image in a clockwise rotation, while a negative value will rotate the image in a counter-clockwise rotation.
uFlags | Flag to keep the resulting image the same size as the original image or to resize according to the rotation direction specified. Valid values are:
 | Value | Meaning
 | ROTATE_RESIZE | [0x0001] Size resulting image as needed.
 | ROTATE_RESAMPLE | [0x0002] Perform bilinear interpolation when rotating.
 | ROTATE_BICUBIC | [0x0004] Perform bicubic interpolation when rotating.
 | 0 | Do not resize the image. Crop it.
crFill | The background fill color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function has the following features:

It uses the center of the image as the center of rotation.

It can rotate the image clockwise or counterclockwise up to 360 degrees in 1-degree increments.

It can resize the image to accommodate the rotated height and width, or it can retain the original height and width, cropping the bitmap as necessary.

It uses crFill as the background color to fill any new area created by the rotation.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

ROTATE_RESAMPLE and ROTATE_BICUBIC can be combined with ROTATE_RESIZE, but they can not be combined with each other. Therefore, 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.

Interpolation can be done while rotating certain images. This produces superior output, eliminating the jaggedness occurring when rotating images at angles that are not multiple of 90. (ie when nAngle is not a multiple of 9000).

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 L_GrayScaleBitmap(pBitmap, 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 L_WindowLevel function has been called. Call L_GrayScaleBitmap(pBitmap, 12) or L_GrayScaleBitmap(pBitmap, 16) if L_RotateBitmap 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, L_RotateBitmap ignores the resampling flags and the rotate is performed without interpolation.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RotateBitmapFine, L_RotateBitmapViewPerspective, L_ShearBitmap, L_FlipBitmap, L_ReverseBitmap, L_DlgRotate , L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Document Imaging
 | Detecting Registration Marks
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the FEATURE1 example.

/* This example loads a bitmap and rotates it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Rotate the bitmap 45 degrees counterclockwise, increasing the size as necessary */
L_RotateBitmap(&LeadBitmap, -4500, ROTATE_RESIZE, RGB(255, 0, 0) );


L_RotateBitmapFine

This function has been removed. You can achieve the same functionality by calling L_RotateBitmap.


L_RotateBitmapViewPerspective

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_RotateBitmapViewPerspective(pBitmap, nAngle)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* degrees of rotation */

Rotates an image by changing the bitmap's view perspective. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
nAngle | Degrees of rotation. Valid values +-90, +-180, +-270, or +-360. Positive values are clockwise; negative values are counterclockwise.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function achieves fast rotation by changing only the view perspective. After using this function, you can reverse the result by restoring the original View Perspective.

Some functions must account for the view perspective. For general information about view perspectives, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_RotateBitmapFine, L_RotateBitmap, L_ShearBitmap, L_FlipBitmap, L_ReverseBitmap, L_DlgRotate
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

/* This example rotates the bitmap's ViewPerspective 90 degrees */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */

L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_RotateBitmapViewPerspective ( &LeadBitmap, 90 );


L_SampleTargetBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SampleTargetBitmap(pBitmap, crSample, crTarget, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF crSample; | /* sample color */
COLORREF crTarget; | /* target color */
L_UINT uFlags; | /* flags */

Corrects color values by shifting the sample colors to the target colors. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
crSample | The COLORREF value that specifies the Sample color. The red value for red channel, green value for green channel, blue value for blue channel.
crTarget | The COLORREF value that specifies the Target color. The red value for red channel, green value for green channel, blue value for blue channel.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For example, suppose you are working with a color image. In crSample you set the red value portion of the COLORREF structure 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 uFlags, 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreePlaneBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_FreeRadBendBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors

Example

/* The following example loads bitmap, and applies the sample target function:*/
BITMAPHANDLE LeadBitmap;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap(TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/*Apply the filter*/
L_SampleTargetBitmap(&LeadBitmap, RGB(50, 100, 150), RGB(60, 90 , 150), SAMP_RED| SAMP_MID);


L_SaveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveBitmap(pszFile, pBitmap, nFormat, nBitsPerPixel, nQFactor, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* output file name */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves an image contained in a bitmap to a file in any of the supported compressed or uncompressed formats.

Parameter | Description
pszFile | Character string containing the output file name.
pBitmap | Pointer to the bitmap handle referencing the bitmap that holds the image data.
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, FILE_EXIF_JPEG, and FILE_PNG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 handle's hPalette field 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.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Note:

More options are available in the SAVEFILEOPTION structure.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveFile, L_SaveFileOffset, L_CompressBitmapWithStamp, L_FileConvert, L_SetExtFileOption, L_SetComment, L_DlgSave , L_SaveFileMemory
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: Low-Level Compression Functions
 | Raster Image Functions: Loading and Saving Stamp Images
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the DRAW example.

/* This example loads a temporary bitmap and saves it to a new file */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the temporary bitmap */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Save the image as a 24-bit Windows BMP file */
L_SaveBitmap(TEXT("TEST.BMP"), &TmpBitmap, FILE_BMP, 24, 0, NULL);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);


L_SaveBitmapBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveBitmapBuffer(pBuffer, uInitialBufferSize, puFinalFileSize, pBitmap, nFormat, nBitsPerPixel, nQFactor, pfnSaveBufferCB, pUserData, pSaveOptions)

L_UCHAR L_FAR * pBuffer; | /* pointer to a memory buffer */
L_UINT32 uInitialBufferSize; | /* size of the memory buffer in bytes */
L_UINT32 L_FAR * puFinalFileSize; | /* pointer to a variable */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
SAVEBUFFERCALLBACK pfnSaveBufferCB; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a file in a memory buffer that the user must allocate. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
pBuffer | Pointer to a buffer allocated by the user. Note that if this buffer is not large enough to accommodate the file in memory, the SAVEBUFFERCALLBACK is called to allow the user to reallocate the buffer.
uInitialBufferSize | Size of pBuffer in bytes. Note that the buffer size can be reallocated in the pfnSaveBufferCB callback.
puFinalSize | Pointer to a variable that will contain the final size of the file in memory. This is not the final size of the allocated buffer, which may be larger than the memory file.
pBitmap | Pointer to the bitmap handle that describes the data to be saved. The bitmap handle can contain the actual data, but does not have to, since the callback function can supply the data.
 | However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closest BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
pfnSaveBufferCB | Optional callback function for reallocating the buffer if it is not large enough to accommodate the save. NULL can be passed for this parameter. However, if NULL is passed for this parameter and the buffer is not large enough, the function will fail.
 | The callback function must adhere to the syntax described in SAVEBUFFERCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

L_SaveFileBuffer saves a bitmap to a file in a memory buffer that the user must allocate. The output can be in any of the supported compressed or uncompressed file formats. This function is similar to L_SaveFileMemory, except the user is responsible for allocating/reallocating buffers. The SAVEBUFFERCALLBACK notifies the user if the buffer is not large enough. The user can then reallocate the buffer. For more information, see SAVEBUFFERCALLBACK.

If the user wants to allocate a buffer that is large enough to hold the file in memory, an upper bound on the file size can be estimated by the following formula:

RequiredBytes = (Image Width) * (Image Height) * (BitsPerPixel) / 8

Note that this is an estimate—this does not include the size of the file header, and it does not take into account any compression. It is best to use a SAVEBUFFERCALLBACK so that the user can be notified if the buffer is not large enough.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This function cannot be used in combination with L_RedirectIO.

Note: | More options are available in the SAVEFILEOPTION structure.
Note: | FPX, PCD, AWD and AVI files cannot be saved to memory.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveFileBuffer, L_SaveFileMemory, L_SaveBitmapMemory, L_LoadFile, L_LoadFileOffset, L_GetCompressFileStamp, L_SaveBitmap, L_SaveFileOffset, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback
 | For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow
 | Saving a Region

Example

//This example loads the file 'pszFile', and then saves it to a memory buffer
//that the caller allocates. Note that when the buffer becomes filled,
//the ExampleSaveBufferCB callback is called to notify the caller to reallocate
//the buffer. After the save is completed, the size of the file in memory is displayed.
//Finally, the memory buffer containing the file is loaded into pBitmap
//********************************************************************************/
typedef struct _tagMYBUFFER
{
L_CHAR *pBuffer;
L_UINT32 dwBufferSize;
} MYBUFFER, *pMYBUFFER;

L_INT SampleSaveBitmapBuffer(L_TCHAR *pszFile, pBITMAPHANDLE pBitmap)
{
L_INT nRet;
BITMAPHANDLE Bitmap;
L_UINT32 dwFinalFileSize;
L_TCHAR szMsg[100];

MYBUFFER MyBuffer;
MyBuffer.dwBufferSize = 100;
MyBuffer.dwBufferSize = 0;
MyBuffer.pBuffer = NULL;

nRet = L_LoadBitmap(pszFile, &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

if (nRet != SUCCESS)
return nRet;

MyBuffer.pBuffer = (L_CHAR L_FAR *)malloc(MyBuffer.dwBufferSize); //large enough to hold rgbw.bmp
if (MyBuffer.pBuffer == NULL)
return FAILURE;

nRet = L_SaveBitmapBuffer(MyBuffer.pBuffer,
MyBuffer.dwBufferSize,
&dwFinalFileSize,
&Bitmap,
FILE_BMP,
0,
0,
ExampleSaveBufferCB,
&MyBuffer,
NULL);

if (nRet != SUCCESS)
return nRet;

wsprintf(szMsg, TEXT("Final Buffer Size: %d"), dwFinalFileSize);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
nRet = L_LoadBitmapMemory (MyBuffer.pBuffer, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, dwFinalFileSize, NULL, NULL);

free(MyBuffer.pBuffer);

return nRet;
}


L_SaveBitmapList

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveBitmapList(lpszFile, hList, nFormat, nBits, nQFactor, pSaveOptions)

L_TCHAR L_FAR* lpszFile; | /* output file name */
HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_INT nFormat; | /* output file format */
L_INT nBits; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a list of bitmaps in a multi-page file.

Parameter | Description
lpszFile | Character string containing the output file name.
hList | Handle to the list of bitmaps.
nFormat | Output file format. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF). For possible values, refer to Formats of Output Files.
 | Single image formats are also valid (although only one image can be stored).
nBits | Resulting file's pixel depth. For possible values, refer to Formats of Output Files. If nBits is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Single-image formats are also valid for output, but only the first image in the list is saved.

Note:

More options are available in the SAVEFILEOPTION structure.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor, L_SetExtFileOption, L_SetComment, L_DlgSave
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example saves a list of 8-bit bitmaps as an animated GIF file. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the playback target */
void TestSaveList(HBITMAPLIST hList)
{
BITMAPHANDLE TmpBitmap; /* Temporary bitmap handle */
SAVEFILEOPTION SaveFileOption; /* File options when saving */

/* Get a copy of the first image's bitmap handle */
L_GetBitmapListItem(hList, 0, &TmpBitmap, sizeof(BITMAPHANDLE));
/* Get the default SAVEFILEOPTION values */
L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));

/* Use the target bitmap's palette as the global palette */
L_GetBitmapColors(&LeadBitmap, 0, 256, SaveFileOption.GlobalPalette);

/* Assign the other SAVEFILEOPTION fields */
SaveFileOption.Flags = ESO_GLOBALBACKGROUND|ESO_GLOBALPALETTE;
SaveFileOption.GlobalWidth = TmpBitmap.Width;
SaveFileOption.GlobalHeight = TmpBitmap.Height;
SaveFileOption.GlobalLoop = 0;
SaveFileOption.GlobalBackground = LeadBitmap.Background;

/* Save the bitmap list as an animated GIF file */
L_SaveBitmapList(TEXT("testan.gif"), hList, FILE_GIF, 8, 0, &SaveFileOption);
return;
}


L_SaveBitmapMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveBitmapMemory(phHandle, pBitmap, nFormat, nBitsPerPixel, nQFactor, puSize, pSaveOptions)

HGLOBAL L_FAR * phHandle; | /* address of the memory handle */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT32 L_FAR * puSize; | /* address of a file-size variable to be updated */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

Parameter

Description

phHandle

Pointer to the memory handle that will be updated with a new memory handle that contains the saved image. To append a page to an existing image, this pointer should point to a valid memory handle (*phHandle!=NULL). If you have no image saved in memory, this pointer should point to NULL (*phHandle=NULL).

If you pass a valid memory handle, the old handle will become invalid and a new handle created. The new handle may have the same value as the old handle, however, this is not guaranteed.

pBitmap

Pointer to the bitmap handle referencing the bitmap that holds the image data.

nFormat

Output file format. For valid values, refer to Formats of Output Files.

nBitsPerPixel

Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.

nQFactor

This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors.

puSize

Address of a variable, which the function updates to give you the size of the file.

pSaveOptions

Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a memory handle. You can then pass its address in this function, which will allocate the memory, save the bitmap, and unlock the memory. Set the value of the HANDLE to NULL.
2. | Declare a long integer (L_UINT32) variable for the file-size. You can then pass its address in this function, which will update its value with the size of the file.
3. | Call this function to save the bitmap in the specified memory handle.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This function cannot be used in combination with L_RedirectIO.

Note: | More options are available in the SAVEFILEOPTION structure. However, please note that the PageNumber data member of the SAVEFILEOPTION structure is not valid with this function. Therefore you cannot save a multi-page file with this function.
Note: | This function does not support Kodak FlashPix (FPX), Kodak PhotoCD (PCD), or Microsoft FAX (AWD) files.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetExtFileOption, L_SetComment, L_SaveFileMemory
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: Low-Level Compression Functions
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the SAVEMEM example.

/* This example loads a temporary bitmap, saves it as a file in memory,
then loads the memory-resident file into a new bitmap handle */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */
BITMAPHANDLE TmpBitmap; /* Bitmap handle for the initial image */
HGLOBAL hFileInMemory=NULL; /* Memory handle */
L_UINT32 uMemSize; /* Size of the data in memory */
L_CHAR L_FAR *pData; /* Pointer to the data in memory */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Save the image as a CMP file in memory */
L_SaveBitmapMemory(&hFileInMemory, &TmpBitmap, FILE_CMP, 24, QS, &uMemSize, NULL);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);
/* Get the pointer to the memory-resident file */
pData = (L_CHAR L_FAR *) GlobalLock (hFileInMemory);
/* Load the new bitmap from memory at its own bits per pixel */
L_LoadBitmapMemory (pData, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, uMemSize, NULL, NULL);
/* Clean up */
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);


L_SaveBitmapWithLayers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveBitmapWithLayers(pszFile, pBitmap, nFormat, nBitsPerPixel, nQFactor, hLayers, pLayerInfo, nLayers, pSaveOptions)

L_TCHAR L_FAR * pszFile; | /* output file name */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
HBITMAPLIST hLayers; | /* handle to a list of bitmaps */
pLAYERINFO pLayerInfo; | /* pointer to a structure */
L_INT nLayers; | /* number of layers in pLayerInfo */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves an image contained in a bitmap to a file, along with the specified layers.

Parameter | Description
pszFile | Character string containing the output file name.
pBitmap | Pointer to the bitmap handle referencing the bitmap that holds the image data.
nFormat | Output file format. Currently, only PSD (FILE_PSD) files support layers.
nBitsPerPixel | Resulting file's pixel depth. For color images this can be 24 or 32. For grayscale images this can be 8.
nQFactor | Reserved for future use. Pass 0.
hLayers | Handle to the bitmap list that contains the layers to save in the output file. The layers should have the same bits per pixel as the file. Every bitmap in the list will be saved as a layer. The first bitmap in the list will be interpreted as the first layer. The bitmaps in the bitmap list must have the same bits per pixel as specified in nBitsPerPixel.
pLayerInfo | Pointer to an optional array of LAYERINFO structures. If this is NULL, then each layer will start at (0, 0) and will have the same size as the image. If this is not NULL, then the layer information for each layer in hLayers will be stored here. The number of LAYERINFO structures is given in nLayers.
nLayers | The number of LAYERINFO structures in the pLayerInfo array. This value should be the same as the number of bitmaps in the hLayers bitmap list. This parameter is used only if pLayerInfo is not NULL.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Currently, only the PSD format supports layers.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadLayer, L_SaveBitmap, L_SaveFile, L_SaveFileOffset, L_CompressBitmapWithStamp, L_FileConvert, L_SetComment, L_DlgSave , L_SaveFileMemory
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

/* This example saves a bitmap and 3 layers */
BITMAPHANDLE Bitmap;
HBITMAPLIST hLayers;

L_CreateBitmapList(&hLayers);

/* load the bitmap for the first layer */
L_LoadBitmap (TEXT("layer0.bmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_InsertBitmapListItem (hLayers, -1, &Bitmap);

/* load the bitmap for the second layer */
/* Note that I do not free the bitmap I just loaded because I inserted it in the list */
L_LoadBitmap (TEXT("layer1.bmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_InsertBitmapListItem (hLayers, -1, &Bitmap);

/* load the bitmap for the third layer */
/* Note that I do not free the bitmap I just loaded because I inserted it in the list */
L_LoadBitmap (TEXT("layer2.bmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_InsertBitmapListItem (hLayers, -1, &Bitmap);

/* Load the bitmap that is made up of all the layers */
L_LoadBitmap (TEXT("image.bmp"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Save this bitmap and all the layers */
L_SaveBitmapWithLayers(TEXT("image.psd"), &Bitmap, FILE_PSD, 0, 0, hLayers, NULL, 0, NULL);

/* Free the bitmap */
L_FreeBitmap (&Bitmap);

/* Free the layers bitmap list and all the bitmaps contained in it */
L_DestroyBitmapList(hLayers);


L_SaveFile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFile(pszFile, pBitmap, nFormat, nBitsPerPixel, nQFactor, uFlags, pfnCallback, pUserData, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* name of the image file to save */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine function behavior */
FILESAVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Creates a file in any of the supported compressed or uncompressed formats, using input data that your callback function supplies.

Parameter | Description
pszFile | Character string containing the name of the image file to save.
pBitmap | Pointer to the bitmap handle that describes the data to be saved. The bitmap handle can contain the actual data, but does not have to, since your callback function can supply the data.
 | However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
uFlags | Binary flags that determine the behavior of L_SaveFile. You can specify one of the following values:
 | Value | Meaning
 | SAVEFILE_FIXEDPALETTE | [0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.
 | SAVEFILE_OPTIMIZEDPALETTE | [0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.
 | SAVEFILE_MULTIPAGE | [0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the syntax described in FILESAVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If you provide a callback function, it must supply the image data. It can also do other useful things, such as updating a status bar.

If you do not provide a callback function, this function saves data from the specified bitmap.

If you use a callback and save the bitmap as a MacPaint (MAC) file, the image to be saved must have a width of 576 and a height of 720 (the required dimensions of that format).

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

Note: | More options are available in the SAVEFILEOPTION structure.
Note: | More options are available in the SAVEFILEOPTION structure.
Note: | If SAVE_MULTIPAGE is passed in uFlags, this takes precedence over the ESO_REPLACEPAGE or ESO_INSERTPAGE flags set in SAVEFILEOPTION.

Note: For information about loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error if you attempt to save a signed image to a format other than DICOM or TIFF.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmap, L_SaveFileOffset, L_CompressBitmapWithStamp, L_FileConvert, L_SetExtFileOption, L_SetComment, L_DlgSave , L_SaveFileMemory
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: Low-Level Compression Functions
 | Raster Image Functions: Loading and Saving Stamp Images
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the SAVECB example.

/****************************************************************************************
This example uses L_SaveFile with a callback function that supplies the image data.
Refer to the FILESAVECALLBACK function to see how the callback function supplies
the image data.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */

/* Prototype for the FILESAVECALLBACK function */
L_INT L_EXPORT EXT_CALLBACK SaveImageCB (pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR * pBuffer,
L_UINT nRowBegin,
L_UINT nRowsToGet,
L_VOID L_FAR * pUserData);
/****************************************************************************************/
void TestSaveFunction(void)
{
L_INT nRet; /* Return value */
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
FILESAVECALLBACK lpfnSaveCallback;
/* Set the callback function for the L_SaveFile function.*/
lpfnSaveCallback = (FILESAVECALLBACK) MakeProcInstance(
(FARPROC) SaveImageCB, hInst );
/* Set the dithering method for the save */
LeadBitmap.DitheringMethod = FLOYD_STEIN_DITHERING;
/* Save the file as an 8-bit Windows BMP file with a fixed palette */
nRet = L_SaveFile(TEXT("TEST2.BMP"),
&LeadBitmap,
FILE_BMP, 8, 0,
SAVEFILE_FIXEDPALETTE,
lpfnSaveCallback,
NULL,
NULL);
FreeProcInstance ((FARPROC) lpfnSaveCallback);
/* Notify the user with a message box */
if (nRet == SUCCESS)
{
MessageBox (NULL, TEXT("File was saved"), TEXT("Notice"), MB_OK);
}
else
{
wsprintf (szMessage, TEXT("Error %d saving the file"), nRet);
MessageBox (NULL, szMessage, TEXT("Error"), MB_OK);
}
return;
}


L_SaveFileBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFileBuffer(pBuffer, uInitialBufferSize, puFinalFileSize, pBitmap, nFormat, nBitsPerPixel, nQFactor, uFlags, pfnFileSaveCB, pfnSaveBufferCB, pUserData, pSaveOptions)

L_UCHAR L_FAR * pBuffer; | /* pointer to a memory buffer */
L_UINT32 uInitialBufferSize; | /* size of the memory buffer in bytes */
L_UINT32 L_FAR * puFinalFileSize; | /* pointer to a variable */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine function behavior */
FILESAVECALLBACK pfnFileSaveCB; | /* optional callback function */
SAVEBUFFERCALLBACK pfnSaveBufferCB; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a file in a memory buffer that the user must allocate, using input data that the FILESAVECALLBACK callback function supplies. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
pBuffer | Pointer to a buffer allocated by the user. Note that if this buffer is not large enough to accommodate the file in memory, the SAVEBUFFERCALLBACK is called to allow the user to reallocate the buffer.
uInitialBufferSize | Size of pBuffer in bytes. Note that the buffer size can be reallocated in the pfnSaveBufferCB callback.
puFinalSize | Pointer to a variable that will contain the final size of the file in memory. This is not the final size of the allocated buffer, which may be larger than the memory file.
pBitmap | Pointer to the bitmap handle that describes the data to be saved. The bitmap handle can contain the actual data, but does not have to, since the callback function can supply the data.
 | However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closest BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
uFlags | Binary flags that determine the behavior of L_SaveFileBuffer. You can specify one of the following values:
 | Value | Meaning
 | SAVEFILE_FIXEDPALETTE | [0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.
 | SAVEFILE_OPTIMIZEDPALETTE | [0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.
 | SAVEFILE_MULTIPAGE | [0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pfnFileSaveCB | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the syntax described in FILESAVECALLBACK Function.
pfnSaveBufferCB | Optional callback function for reallocating the buffer if it is not large enough to accommodate the save. NULL can be passed for this parameter. However, if NULL is passed for this parameter and the buffer is not large enough, the function will fail.
 | The callback function must adhere to the syntax described in SAVEBUFFERCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

L_SaveFileBuffer saves a bitmap to a file in a memory buffer that the user must allocate. The output can be in any of the supported compressed or uncompressed file formats. This function is similar to L_SaveFileMemory, except the user is responsible for allocating/reallocating buffers. The SAVEBUFFERCALLBACK notifies the user if the buffer is not large enough. The user can then reallocate the buffer. For more information, see SAVEBUFFERCALLBACK.

If the user wants to allocate a buffer that is large enough to hold the file in memory, an upper bound on the file size can be estimated by the following formula:

RequiredBytes = (Image Width) * (Image Height) * (BitsPerPixel) / 8

Note that this is an estimate—this does not include the size of the file header, and it does not take into account any compression. It is best to use a SAVEBUFFERCALLBACK so that the user can be notified if the buffer is not large enough.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This function cannot be used in combination with L_RedirectIO.

Note: More options are available in the SAVEFILEOPTION structure.

Note: FPX, PCD, AWD and AVI files cannot be saved to memory.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmapBuffer, L_SaveFileMemory, L_SaveBitmapMemory, L_LoadFile, L_LoadFileOffset, L_GetCompressFileStamp, L_SaveBitmap, L_SaveFileOffset, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution, L_SetLoadInfoCallback
 | For Vector files: L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Using a PanWindow
 | Saving a Region

Example

//This example loads the file 'pszFile', and then saves it to a memory buffer
//that the caller allocates. Note that when the buffer becomes filled,
//the ExampleSaveBufferCB callback is called to notify the caller to reallocate
//the buffer. After the save is completed, the size of the file in memory is displayed.
//The image 'pszFile' is flipped, and saved as the second page of the memory buffered TIF
//Finally, the second page of the memory buffer containing the file is loaded into pBitmap

typedef struct _tagMYBUFFER
{
L_CHAR *pBuffer;
L_UINT32 dwBufferSize;
} MYBUFFER, *pMYBUFFER;

L_INT SampleSaveFileBuffer(L_TCHAR *pszFile, pBITMAPHANDLE pBitmap)
{
L_INT nRet;
BITMAPHANDLE Bitmap;
L_UINT32 dwFinalFileSize;
L_TCHAR szMsg[100];
SAVEFILEOPTION SaveFileOption;
LOADFILEOPTION LoadFileOption;

MYBUFFER MyBuffer;
MyBuffer.dwBufferSize = 100;
MyBuffer.dwBufferSize = 0;
MyBuffer.pBuffer = NULL;

nRet = L_LoadBitmap(pszFile, &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

if (nRet != SUCCESS)
return nRet;

MyBuffer.pBuffer = (L_CHAR L_FAR *)malloc(MyBuffer.dwBufferSize); //large enough to hold rgbw.bmp
if (MyBuffer.pBuffer == NULL)
return FAILURE;

L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
SaveFileOption.PageNumber = 1;

L_SaveFileBuffer(MyBuffer.pBuffer,
MyBuffer.dwBufferSize,
&dwFinalFileSize,
&Bitmap,
FILE_TIF,
0,
0,
0,
NULL,
ExampleSaveBufferCB,
&MyBuffer,
&SaveFileOption);

wsprintf(szMsg, TEXT("Buffer Size After First Save: %d"), dwFinalFileSize);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);

L_FlipBitmap(&Bitmap);

SaveFileOption.PageNumber = 2;

L_SaveFileBuffer(MyBuffer.pBuffer,
MyBuffer.dwBufferSize,
&dwFinalFileSize,
&Bitmap,
FILE_TIF,
0,
0,
0,
NULL,
ExampleSaveBufferCB,
&MyBuffer,
&SaveFileOption);

wsprintf(szMsg, TEXT("Final Buffer Size: %d"), dwFinalFileSize);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);

LoadFileOption.PageNumber = 2;
nRet = L_LoadBitmapMemory (MyBuffer.pBuffer, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, dwFinalFileSize, &LoadFileOption, NULL);

free(MyBuffer.pBuffer);

return nRet;
}


L_SaveFileCMYKArray

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFileCMYKArray (pszFile, ppBitmapArray, uBitmapArrayCount, nFormat, nBitsPerPixel, nQFactor, uFlags, pfnCallback, pUserData, pSaveOptions);

L_TCHAR L_FAR *pszFile; | /* name of the image file to save */
pBITMAPHANDLE L_FAR * ppBitmapArray; | /* array of pointers to BITMAPHANDLE handle */
L_UINT uBitmapArrayCount; | /* number of items in the bitmaps array */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* desired bits per pixel for each bitmap */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine function behavior */
FILESAVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

This function saves an array of bitmaps as a CMYK TIFF file.

Parameter | Description
pszFile | Character string containing the name of the image file to save.
ppBitmapArray | Array of pointers to the bitmaps that contain each color plane. There should be 4 or 5 members in the array, depending on whether there is alpha channel information to save.
 | All the bitmaps must have the same width, height, bits per pixel and palette. uBitmapArrayCount indicates how many pointers are stored in the array. The bitmaps are in this order: C, M, Y, K, Alpha (optional).
uBitmapArrayCount | Number of bitmaps present in ppBitmapArray.
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.

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 L_FileInfo 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 L_FileInfo will report 16 bits less (48 or 64-bit).

nQFactor | Reserved for future use. This parameter is ignored at the moment.
uFlags | Binary flags that determine the behavior of L_SaveFileCMYKArray. You can specify one of the following values:
 | 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 is appended to the end of the file. More advanced options can be passed using pSaveOptions.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the syntax described in FILESAVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
ERROR_INV_COLORSPACE | Invalid color space.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will save a CMYK file without performing a color conversion. Each bitmap in the array will contain one of the C, M, Y, K, or Alpha planes. The Alpha plane is optional. The ppBitmapArray should contain:

4 elements if no Alpha information is included or

5 elements if the Alpha information is included

To load the array of bitmaps, use L_LoadFileCMYKArray.

To save the array of bitmaps as a file format not supported by this function, call L_ColorMergeBitmap to create a BGR bitmap and save the generated bitmap using L_SaveFile.

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 select the planar save mode, set SAVEFILEOPTION.Flags2 to ESO2_SAVEPLANAR [0x00000002]. Note that this option is set in the Flags2 member, not the Flags member (the SAVEFILEOPTION structure has two flag members: Flags and Flags2).

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadFileCMYKArray, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_SaveFile, L_ConvertColorSpace, L_ClrInit , L_ClrFree
Topics: | Handling CMYK Files as Separate Bitmaps
 | Loading and Saving Images
 | Raster Image Functions: Saving Files

Example

For an example, refer to L_LoadFileCMYKArray.


L_SaveFileMemory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFileMemory(phHandle, pBitmap, nFormat, nBitsPerPixel, nQFactor, uFlags, pfnCallback, pUserData, puSize, pSaveOptions)

HANDLE L_FAR * phHandle; | /* pointer to a memory handle */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine function behavior */
FILESAVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
L_UINT32 L_FAR *puSize; | /* pointer to the size of the memory handle */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
phHandle | Pointer to the memory handle that will be updated with a new memory handle that contains the saved image. To append a page to an existing image, this pointer should point to a valid memory handle (*phHandle!=NULL). If you have no image saved in memory, this pointer should point to NULL (*phHandle=NULL).
 | If you pass a valid memory handle, the old handle will become invalid and a new handle created. The new handle may have the same value as the old handle, however, this is not guaranteed.
pBitmap | Pointer to the bitmap handle that describes the data to be saved. The bitmap handle can contain the actual data, but does not have to, since your callback function can supply the data.
 | However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors
uFlags | Binary flags that determine the behavior of L_SaveFile. You can specify one of the following values:
 | Value | Meaning
 | SAVEFILE_FIXEDPALETTE | [0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.
 | SAVEFILE_OPTIMIZEDPALETTE | [0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.
 | SAVEFILE_MULTIPAGE | [0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the syntax described in FILESAVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
puSize | Pointer to the size of the memory handle. If you are appending a page to an image in memory, and you specify a valid memory handle in *phHandle, puSize should contain the exact size of *phHandle. If you have no image in memory, this will initially be ignored. After returning from the function, the memory location pointed to by puSize will be updated with the size of the memory handle.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, do the following:

1. | Declare a memory handle. You can then pass its address in this function, which will allocate the memory, save the bitmap, and unlock the memory. Set the value of the HANDLE to NULL.
2. | Declare a long integer (L_UINT32) variable for the file-size. You can then pass its address in this function, which will update its value with the size of the file.
3. | Call this function to save the bitmap in the specified memory handle.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This function cannot be used in combination with L_RedirectIO.

Note: | More options are available in the SAVEFILEOPTION structure.
Note: | FPX, PCD, AWD and AVI files cannot be saved to memory.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error if you attempt to save a signed image to a format other than DICOM or TIFF.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmap, L_SaveFileOffset, L_CompressBitmapWithStamp, L_FileConvert, L_SetExtFileOption, L_SetComment, L_DlgSave , L_SaveBitmapMemory, L_SaveFile
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

HWND hMainWnd;

L_INT SaveBitmapData (L_TCHAR L_FAR* pFilename, pBITMAPHANDLE pBitmapHandle, L_INT nType)
{
L_INT nRet;
HFILE hFile;
HANDLE hData;
L_CHAR L_FAR *pData;
L_CHAR L_HUGE *pDataMover;
L_UINT32 uSize;
SAVEFILEOPTION SaveFileOption;
LOADFILEOPTION LoadFileOption;

L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
L_GetDefaultLoadFileOption(&LoadFileOption, sizeof(LOADFILEOPTION));
SaveFileOption.PageNumber = 1;

/* save first page */
nRet = L_SaveFileMemory (&hData, pBitmapHandle, FILE_TIF,
0, 0, 0, NULL, NULL, &uSize, &SaveFileOption);

/* flip image */
L_FlipBitmap(pBitmapHandle);

SaveFileOption.PageNumber = 2;
/* save second page */
if(nRet == SUCCESS)
nRet = L_SaveFileMemory (&hData, pBitmapHandle, FILE_TIF,
0, 0, 0, NULL, NULL, &uSize, &SaveFileOption);

pData = (L_CHAR L_FAR *) GlobalLock (hData);
pDataMover = pData;

if (nRet == SUCCESS)
{
MessageBox (NULL, TEXT("Image Saved To Memory!"), TEXT("SUCCESS"), MB_OK);
L_FreeBitmap (pBitmapHandle);
InvalidateRect (hMainWnd, NULL, TRUE);
UpdateWindow (hMainWnd);
}

/* Open/Create the file to write. */
#ifdef UNICODE

hFile = _wcreat (pFilename, 0);

#else

hFile = _lcreat (pFilename, 0);

#endif

if (hFile == -1)
{
MessageBox (NULL, TEXT("Error Opening File!"), TEXT("Error"), MB_OK);
return (FALSE); /* Failure on creation! */
}

/* Write the file in a loop, because the file could be larger than a
single write can request. */
while (uSize > 0)
{
nRet = _lwrite (hFile, pDataMover,
(L_INT) min (uSize, (L_UINT32) 32000));

if (nRet == -1)
{
MessageBox (NULL, TEXT("Error writing file!"), TEXT("Error"), MB_OK);
nRet = FALSE; /* Failure on write! */
break;
}
else
{
uSize -= nRet;
pDataMover += nRet;
}
}

if (nRet != -1)
MessageBox (NULL, TEXT("Memory File Has Been Written To Disk!"), TEXT("SUCCESS"), MB_OK);

_lclose (hFile);
GlobalUnlock (hData);
GlobalFree (hData);

/* load page 2 from the saved file */
LoadFileOption.PageNumber = 2;
nRet = L_LoadBitmap (pFilename, pBitmapHandle, sizeof(BITMAPHANDLE), 0, ORDER_BGR, &LoadFileOption, NULL);
if(nRet == SUCCESS)
{
InvalidateRect (hMainWnd, NULL, TRUE);
UpdateWindow (hMainWnd);
}
else
MessageBox (NULL, TEXT("Error Loading from file!"), TEXT("Error"), MB_OK);

return (nRet);
}


L_SaveFileOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFileOffset(fd, nOffsetBegin, nSizeWritten, pBitmap, nFormat, nBitsPerPixel, nQFactor, uFlags, pfnCallback, pUserData, pSaveOptions)

L_INT fd; | /* Windows file handle of the file to save */
L_INT32 nOffsetBegin; | /* offset within the file to embed the image file */
L_INT32 L_FAR * nSizeWritten; | /* address of a file-size variable to be updated */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine function behavior */
FILESAVECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a file in any supported format, using a callback function, and letting you specify an offset within the file to begin saving. This enables you to embed an image file in another file.

Parameter | Description
fd | The Windows file handle of the file to save.
nOffsetBegin | The offset within the specified file to embed the saved image file. For example, if you specify 5, then 5 bytes of other data will precede the embedded file.
nSizeWritten | Address of a variable to be updated with the size of the embedded image file.
pBitmap | Pointer to the bitmap handle that describes the data to be saved. The bitmap handle can contain the actual data, but does not have to, since your callback function can supply the data.
 | However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files.
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files. If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JPEG, FILE_JPEG_411, FILE_JPEG_422, FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
 | For possible values, refer to Compression Quality Factors.
uFlags | Binary flags that determine the behavior of L_SaveFile. You can specify one of the following values:
 | Value | Meaning
 | SAVEFILE_FIXEDPALETTE | [0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.
 | SAVEFILE_OPTIMIZEDPALETTE | [0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.
 | SAVEFILE_MULTIPAGE | [0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the syntax described in FILESAVECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function overwrites existing data at the specified location in the file.

You can use this function to update an image that you loaded with the L_LoadFileOffset function.

The offset is specified in bytes. You must open the file and get a Windows file handle before calling this function. You must also declare a variable to receive the resulting size of the embedded image file (in the nSizeWritten parameter).

If you use a callback and save the bitmap as a MacPaint (MAC) file, the image to be saved must have a width of 576 and a height of 720 (the required dimensions of that format).

Support for writing AVI files is only available in the Multimedia toolkits.

Note:

More options are available in the SAVEFILEOPTION structure.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error if you attempt to save a signed image to a format other than DICOM or TIFF.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveBitmap, L_SaveFile, L_CompressBitmapWithStamp, L_FileConvert, L_SetExtFileOption, L_SetComment, L_DlgSave , L_SaveFileMemory, L_ReadFileCommentOffset
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: Low-Level Compression Functions
 | Raster Image Functions: Loading and Saving Stamp Images
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the OFFSET example.

/* This example saves an image file with a 30-byte offset.
It then loads the file that it just saved. Note that the SizeWritten
variable from the save is reused when loading. A real application would
have to get this information another way when loading. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the current image */
void TestFunction(void)
{
L_INT nRet; /* Return value */
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
HFILE OffsetFile; /* File handle */
L_INT32 SizeWritten; /* Variable to be updated with the size written */
/* Create a file */
#ifdef UNICODE

OffsetFile = _wcreat(TEXT("TOFFSET.TST"), 0);

#else

OffsetFile = _lcreat("TOFFSET.TST", 0);

#endif

/* Write some text in the file -- 29 characters and a terminator */
_lwrite(OffsetFile, "This is a 29-character string", 30);
/* Save the image file with an offset inside the TOFFSET.TST file */
nRet = L_SaveFileOffset(OffsetFile, 30, &SizeWritten, &LeadBitmap, FILE_BMP, 8, 0,
SAVEFILE_FIXEDPALETTE, NULL, NULL, NULL);
/* Close the file */
_lclose(OffsetFile);
/* Notify the user with a message box */
if (nRet == SUCCESS)
{
MessageBox (NULL, TEXT("File was saved"), TEXT("Notice"), MB_OK);
}
else
{
wsprintf (szMessage, TEXT("Error %d saving the file"), nRet);
MessageBox (NULL, szMessage, TEXT("Error"), MB_OK);
return;
}
/* Free the bitmap */
L_FreeBitmap (&LeadBitmap);
/***** Now load the file we just saved ****/
/* Open the file and get the file handle */
#ifdef UNICODE

OffsetFile = _wopen(TEXT("TOFFSET.TST"), OF_READ|OF_SHARE_DENY_WRITE );

#else

OffsetFile = _lopen("TOFFSET.TST", OF_READ|OF_SHARE_DENY_WRITE );

#endif

/* Load the file with a 30-byte offset */
nRet = L_LoadFileOffset( OffsetFile, 30, SizeWritten,
&LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
NULL, NULL, NULL, NULL);
/* Close the file */
_lclose(OffsetFile);
/* Notify the user with a message box. The BPS in the message confirms
that it is a new image. */
if (nRet == SUCCESS)
{
wsprintf (szMessage, TEXT("New file loaded at %d BPS"), LeadBitmap.BitsPerPixel);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
}
else
{
wsprintf (szMessage, TEXT("Error %d loading the file"), nRet);
MessageBox (NULL, szMessage, TEXT("Error"), MB_OK);
}
return;
}


L_SaveFileTile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SaveFileTile(pszFile, pBitmap, nCol, nRow, pfnCallback, pUserData, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* file name */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nCol; | /* left column of tile */
L_INT nRow; | /* top row of tile */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves a bitmap to a specified rectangular location in an existing FlashPix file. It only works with uncompressed FlashPix files. If a compressed FlashPix file is passed in, an error will be returned.

Parameter | Description
pszFile | Character string containing the name of the image file to save.
pBitmap | Pointer to the bitmap handle for the loaded data.
nCol | Left column number of tile.
nRow | Top row number of tile.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

More options are available in the SAVEFILEOPTION structure.

This function only works with the FlashPix file format.

This function supports signed data images, but only DICOM and TIFF formats support signed data. This function will return an error code if you attempt to save a signed image to a format other than DICOM or TIFF.

If the bitmap has a region, the region stored in the bitmap will be saved, if the image is saved as one of the TIFF file formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadFileTile,
 | L_SetExtFileOption,
 | L_GetExtFileOption,
 | L_DlgSave
Topics: | Raster Image Functions: Loading Files,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

BITMAPHANDLE Bitmap;
FILEINFO FileInfo;
FileInfo.uStructSize = sizeof(FileInfo);

L_LoadBitmap (TEXT("TEST.FPX"), &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_FileInfo(TEXT("TEST.FPX"), &FileInfo, sizeof(FILEINFO), 0, NULL);
// Save a bitmap in the center of the image
L_SaveFileTile(TEXT("TEST.FPX"), &Bitmap, (FileInfo.Width - Bitmap.Width)/2, (FileInfo.Height - Bitmap.Height)/2, NULL, NULL, NULL);


L_SaveICCProfile

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SaveICCProfile(pszFilename, pICCProfile, pSaveOptions)

L_TCHAR L_FAR * pszFilename; | /* name of a file */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves (embeds) an ICC profile in an image file.

Parameter | Description
pszFilename | Character string containing the name of the file in which to save/embed an ICC profile.
pICCProfile | Pointer to an ICCPROFILEEXT structure that contains the ICC profile to save/embed.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options, and the profile will be saved on page 1.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 pSaveOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfileExt. If L_SaveICCProfile succeeds, free the ICC profile by calling L_FreeICCProfileExt. In fact, when any ICCPROFILEEXT structure initialized by L_InitICCProfileExt is no longer needed, the memory must be freed by calling L_FreeICCProfileExt.

The pData member of the ICCPROFILEEXT structure points to one block of memory that contains the entire ICC profile. The uDataSize contains the size of the material pointed to by pData. As tags are added or deleted, these members are not automatically updated. Ordinarily, to update these members, you must call L_GenerateICCPointer. However, this function updates these members itself, without requiring a separate call to L_GenerateICCPointer.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Saving an ICC Profile

Example

For an example, refer to L_InitICCProfileExt.


L_ScrambleBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ScrambleBitmap(pBitmap, nColStart, nRowStart nWidth, nHeight, uKey, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle for the bitmap to be scrambled */ .
L_INT32 nColStart; | /* starting column in pixels (0-based) */
L_INT32 nRowStart; | /* starting row in pixels (0-based) */
L_INT32 nWidth; | /* width of area to scramble in pixels */
L_INT32 nHeight; | /* height of area to scramble in pixels */
L_INT32 uKey; | /* key that determines the scramble */
L_UINT uFlags; | /* flag that determines whether to encrypt or decrypt the area. */

Scrambles all or a portion of a bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to a bitmap handle for the bitmap to be scrambled.
nColStart | Starting column in pixels (0-based).
nRowStart | Starting row in pixels (0-based).
nWidth | Width of area to scramble in pixels.
nHeight | Height of area to scramble in pixels.
uKey | Key that determines the scramble. This is an unsigned integer with a minimum value of 0 and a maximum value of 4294967295 (0xffffffff).
uFlags | Flag that determines whether to encrypt or decrypt the area. Possible values are:
 | Value | Meaning
 | SB_ENCRYPT | Encrypts the area (the reverse of a decrypt).
 | SB_DECRYPT | Decrypts the area (the reverse of an encrypt).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Scrambling a rectangular area means that the pixels in that area are shuffled around into a pseudo-random location within the area.

Some properties of shuffling:

No colors are introduced,

Color counts remain unchanged

Given the same encrypt area (defined by nColStart, nRowStart, nWidth, nHeight) and the same key, setting (uFlags = SB_ENCRYPT) is the inverse of (uFlags = SB_DECRYPT)

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AnnGetMetafile, L_AnnSetMetafile, L_AnnGetPredefinedMetafile, L_AnnSetPredefinedMetafile, L_AnnEncryptApply, L_AnnSetEncryptOptions, L_AnnGetEncryptOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing an Automated Annotation Program
 | Implementing a Non-automated Annotation Program

Example

// This example scrambles the upper left quadrant of a bitmap
// using the key 123
L_VOID ExampleScrambleBitmap(pBITMAPHANDLE pBitmap)
{
if (!pBitmap)
return;

L_ScrambleBitmap(pBitmap, 0, 0, BITMAPWIDTH(pBitmap)/2, BITMAPHEIGHT(pBitmap)/2, 123, SB_ENCRYPT);
}


L_ScreenCaptureBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ScreenCaptureBitmap(hDC, pBitmap, uStructSize, pRect)

HDC hDC; | /* handle to the source device */
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
LPRECT pRect; | /* portion of the device context to capture */

Loads a bitmap from the specified rectangle within a device context.

Parameter | Description
hDC | Handle to the source device. The mapping mode of the device context must be MM_TEXT.
pBitmap | Pointer to the bitmap handle referencing the target bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pRect | The windows RECT structure that specifies the portion of the device context to capture.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Normally, this function is used for capturing images displayed on the screen. The resulting bitmap will have the same bits per pixel as the display device.

Before calling this function, you must declare a bitmap handle, but do not allocate the bitmap. This function allocates the bitmap.

LEAD provides several other screen capture functions for increased versatility in capturing images from the screen. For more information, refer to the Screen Capture Help File (refer to Ltscrdllx.chm).

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Topics:

Raster Image Functions: Input and Output

Example

For complete sample code, refer to the FRAME.C module of the DEMO example.

/* This example captures the whole screen */

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the captured image */

void TestFunction(HWND hWnd)
{
RECT ScreenRect; /* Rectangle for the whole screen */
HDC ScreenDC; /* Device context for the whole screen */

/* Get the device context for the whole screen */
ScreenDC = GetDC (NULL);

/* Get the rectangle for the whole screen */
SetRect (&ScreenRect, 0, 0, GetDeviceCaps (ScreenDC, HORZRES),
GetDeviceCaps (ScreenDC, VERTRES));

/* Capture the whole screen */
L_ScreenCaptureBitmap (ScreenDC, &LeadBitmap, sizeof(BITMAPHANDLE), &ScreenRect);
/* The palette might have changed */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);

/* Release the device context */
ReleaseDC (NULL, ScreenDC);

return;
}


L_SearchRegMarksBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SearchRegMarksBitmap (pBitmap, pSearchData, uMarkCount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle to be searched */
LPSEARCHMARKS pSearchMarks; | /* array describing the registration marks to be found */
L_UINT uMarkCount; | /* size of array */

Searches pBitmap for the registration marks according to the information in pSearchMarks. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be searched for registration marks.
pSearchMarks | Pointer to an array of SEARCHMARKS structures describing all the characteristics of the registration marks.
uMarkCount | Number of elements in pSearchMarks.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function searches the bitmap for registration marks. The pSearchMarks array contains the information about the registration marks. Declare the array before calling the function. You should specify the following:

Member | Description
uStructSize | The size of SEARCHMARKS structure. (you only need to fill the first element of the array).
uType | Type of registration marks. Possible values are:
 | Value | Meaning
 | RGS_T | [0x0000] T-shape registration mark.
 | Currently, only one registration mark is defined (T-shape).
uWidth and uHeight | The width and height (in pixels) of the registration marks.
uMinScale and uMaxScale | The minimum and maximum scale percentages (percentage, where 100 = 100%).
rcRect | The search region.
uMarkSearchCount | The number of expected marks in each search region.
pMarkDetectedCount | An array large enough to contain uMarkSearchCount POINT structures. The function will store the registration mark positions in this array.

The function will update each member of the pSearchMarks array with information about the detected registration marks:

The uMarkDetectedCount member will be updated with number of detected marks in that area.

The pMarkDetectedPoints member will be updated with the position of the detected marks.

You can call L_GetTransformationParameters to get the transformation parameters, which can be applied to this bitmap to make it match the reference image.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

If you simply want to automatically straighten a bitmap, use the L_DeskewBitmap function.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_RotateBitmap, L_SizeBitmap, L_ResizeBitmap, L_IsRegMarkBitmap, L_GetTransformationParameters, L_GetMarksCenterMassBitmap.
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to L_GetTransformationParameters.


L_SegmentBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SegmentBitmap(pBitmap, uThreshold, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to bitmap */
L_UINT uThreshold; | /* threshold value */
L_UINT uFlags; | /* flag */

Divides the bitmap into segments where each segment’s pixels have approximately the same color (homogenous color). This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
uThreshold | 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.
uFlags | Flag that indicates the color space used in the segmentation. Possible values are:
 | Value | Meaning
 | SGM_RGB | [0x00001] Comparison done on red, green and blue difference.
 | SGM_Y | [0x00002] Comparison done on Y channel difference of YUV space.
 | SGM_U | [0x00003] Comparison done on U channel difference of YUV space.
 | SGM_V | [0x00004] Comparison done on V channel difference of YUV space.
 | SGM_UV | [0x00005] Comparison done on U and V channels difference of YUV space.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 function may be performed on the RGB and YUV color spaces.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_SharpenBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_PosterizeBitmap, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_HighPassFilterBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Modifying Intensity Values

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Example

/* This example loads a bitmap and segmentation function. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* segment the bitmap */
L_SegmentBitmap (&LeadBitmap, 20, SGM_RGB);


L_SelectBitmapData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SelectBitmapData (pDstBitmap, pSrcBitmap, crColor, uSrcLowBit, uSrcHighBit, uThreshold, bCombine)

pBITMAPHANDLE pDstBitmap; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
COLORREF crColor; | /* color value that will be used for coloration */
L_UINT uSrcLowBit; | /* position of the starting bit of the mask */
L_UINT uSrcHighBit; | /* position of the ending bit of the mask */
L_UINT uThreshold; | /* threshold value */
L_BOOL bCombine; | /* flag */

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 function is available in the Medical toolkits.

Parameter | Description
pDstBitmap | Pointer to the destination bitmap that will contain the result of the function. This bitmap will be updated as a 24-bit RGB. The bitmap is assumed to be uninitialized, so you should free the bitmap before passing it to the function.
pSrcBitmap | Pointer to the bitmap handle referencing the 8, 12 or 16-bit grayscale bitmap. pSrcBitmap will not be affected.
crColor | Color that will be used for showing the variances in the bitmap.
uSrcLowBit | Position of the start bit that will construct the mask. The position is a zero based number.
uSrcHighBit | Position of the end bit that will construct the mask. This is inclusive (it is part of the mask). The value should not be less than uSrcLowBit. You can also pass –1, which is interpreted as "highest bit" (pSrcBitmap->BitsPerPixel – 1).
uThreshold | 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. See bCombine for more details.
bCombine | A flag which tells how to color the output pixels:
 | - Pixels with values greater than or equal to the threshold value are:
 | set to crColor (if bCombine is set to FALSE) or
 | AND-ed with crColor (if bCombine is TRUE). In this case, the source pixel is first converted to grayscale 24-bit and then AND-ed with crColor.
 | - Pixels with values less than the threshold value are:
 | set to black (if bCombine is set to FALSE) or
 | The RGB pixel value will be the same as the high byte source pixel value (if bCombine is TRUE). That is R = G = B = High byte values of the source pixel.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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.

The pDstBitmap should not be allocated when calling this function. That is, you should free the allocated bitmap before calling this function. When the function returns successfully the pDstBitmap will be a 24-bit RGB bitmap.

For 8, 12 and 16-bit grayscale bitmap, the uSrcLowBit can range from 0 to 7, 11, and 15 respectively. However if this value exceeded the range then the function will not return an error, and the pDstBitmap will be a pure black bitmap.

For 8, 12 and 16-bit grayscale bitmap, the uSrcHighBit can range from uSrcLowBit to 7, 11, and 15 respectively. No error will be returned if uSrcHighBit is greater than 7, 11 or 15. The function will return an invalid parameter error if uSrcHighBit < uSrcLowBit.

The function will first construct a mask from bits uSrcLowBit through uSrcHighBit. 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 uSrcLowBit. 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.

The following example shows you how to treat a 16-bit grayscale bitmap:

In a16-bit grayscale bitmap, the bits are ordered as b15 b14 b13 ... b2 b1 b0.

For uSrcLowBit = 3, uSrcHighBit = 8, uThreshold = 16 and crColor = RGB(0, 255, 0):

In Source bitmap (pSrcBitmap)

-------------------

b15 b14 b13 b12 b11 b10 b9 |b8 b7 b6 b5 b4 b3| b2 b1 b0

-------------------

0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1

In our case, the mask is 010011 in base 2 (19 in decimal). Since 19 >= 16, the destination pixel will be colored using rcColor. The output pixel will be:

if bCombine = FALSE: crColor = RGB(0,255,0)

if bCombine = TRUE: we take the high byte of the source pixel, which is 01101110 in base 2 (0x6E), and then the value is AND-ed with each component of the crColor. So the output pixel will be RGB(0x00 & 0x6E, 0xFF & 0x6E, 0x00 & 0x6E) which is RGB(0x00, 0x6E, 0x00).

Let us consider another case: the source pixel is 0110111000011101 the mask value is 000011 in base 2(3 in decimal). Since 3 < 16, the destination pixel will be:

if bCombine = FALSE: RGB(0,0,0)

if bCombine = TRUE: The high byte of source pixel will bet set for the RGB, that is RGB(0x6E, 0x6E, 0x6E).

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowLevel, L_WindowLevelBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_ShiftBitmapData, L_ColorizeGrayBitmap, L_SelectiveColorBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and applies Selecting. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
BITMAPHANDLE DstBitmap; /* Bitmap handle to hold the result. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);

// Call the function
L_SelectBitmapData (&DstBitmap,
&LeadBitmap,
RGB(233, 10, 77),
2 /* uSrcLowBit */,
6 /* uSrcHighBit */,
25 /* uThreshold */,
TRUE);

L_FreeBitmap (&LeadBitmap);

// Now we have the resulted image in DstBitmap


L_SelectiveColorBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SelectiveColorBitmap(pBitmap, pSelClr)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pSELCLR pSelClr; | /* pointer to a SELCLR structure that contains the selected color’s definition */

Changes the color of a bitmap by altering the definitions of one or more colors used by the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle.
pSelClr | Pointer to a SELCLR structure that contains the selected colors along with the CMYK values for each.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before you call the L_SelectiveColorBitmap function, you need to initialize the size and all remaining fields of the SELCLR structure.

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 selClrs member of the SELCLR structure. The SELCLRINF structure used in selClrs has four members, cCyan, cMagenta, cYellow and cBlack. Each takes a value from -100 to 100. Negative values for any of these members decreases the percentage of that color, whereas positive values increases the percentage of that color. If cCyan = -100 it means no cyan will be used, whereas if cCyan = 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.

Pixel colors are changed based on HSV color space. For example, if you alter the values for selClrs[SELCLR_RED], then if a pixel value is within the RED range of the Hue scale, it is considered red and is changed using the settings in selClrs[SELCLR_RED].

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports 48- and 64-bit color images. It does not support grayscale images. Support for 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgColor , L_WindowLevel, L_ColorLevelBitmap, L_AutoColorLevelBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and applies selective color to the image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
SELCLR selClr; /* Variable to be used in the function */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

// Initialize selClr to zeros.
memset (&selClr, 0, sizeof(SELCLR));

/* Manipulate values */
selClr.uStructSize = sizeof (SELCLR);
selClr.selClrs[SELCLR_RED].cCyan = -100; // Change the "Red selected color"
selClr.selClrs[SELCLR_YELLOW].cCyan = 34; // Change the "Yellow selected color"
selClr.selClrs[SELCLR_YELLOW].cMagenta = 100;
selClr.selClrs[SELCLR_YELLOW].cYellow = 40;
selClr.selClrs[SELCLR_GREEN].cBlack = 100; // Change the "Green selected color"
selClr.selClrs[SELCLR_NEUTRAL].cCyan = -65; // Change the "neutral selected color"
selClr.selClrs[SELCLR_NEUTRAL].cMagenta = -39;
selClr.selClrs[SELCLR_NEUTRAL].cYellow = 63;

// Call the function
L_SelectiveColorBitmap (&LeadBitmap, &selClr);


L_SetAutoCADFilesColorScheme

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetAutoCADFilesColorScheme(dwFlags)

L_UINT32 dwFlags;

/* AutoCAD color scheme flags */

Sets the current color scheme that LEADTOOLS uses when loading AutoCAD (DXF and DWG) files.

Parameter | Description
dwFlags | Value that represents the AutoCAD color scheme to set. Possible values are:
 | Value | Meaning
 | AUTOCADFILES_COLORSCHEME_BLACKONWHITE | [0] Use Black as the default and White as the background color.
 | AUTOCADFILES_COLORSCHEME_WHITEONBLACK | [1] Use White as the default and Black as the background color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

More options are available in the LOADFILEOPTION structure.

AutoCAD (DXF and DWG) files can be loaded with either black or white background. This function lets you decide on what color scheme to use. Black on White or White on Black.

Note that this function only effects colors number 0 and 7 in the standard AutoCAD color profile. Other colors will not be effected.

This function may be used with the following vector file formats: DXF and DWG. For more information on these file formats and their availability, refer to Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetAutoCADFilesColorScheme, L_2DSetViewMode, L_2DGetViewMode, L_2DGetViewport, L_2DSetViewport
Topics: | Raster Image Functions: Loading Files
 | Vector Images

Example

/* This example will set current AutoCAD color scheme to black on white then loads a DXF file */

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */

void TestLoad(L_TCHAR L_FAR *pszDXFFileName)
{
L_UINT32 dwFlags;

/* If the current AutoCAD color scheme is not black on white, change it */
L_GetAutoCADFilesColorScheme(&dwFlags);
if(dwFlags != AUTOCADFILES_COLORSCHEME_BLACKONWHITE)
L_SetAutoCADFilesColorScheme(AUTOCADFILES_COLORSCHEME_BLACKONWHITE);

/* Load the DXF file */
L_LoadBitmap(pszDXFFileName, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
}


L_SetBitmapAlpha

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapAlpha(pBitmap, pAlpha)

pBITMAPHANDLE pBitmap; | /* points to the destination bitmap handle */
pBITMAPHANDLE pAlpha; | /* points to the source bitmap handle */

Replaces existing alpha channel data or creates new alpha channel data in the destination bitmap.

Parameter | Description
pBitmap | Points to the destination bitmap handle, which references the bitmap where the alpha channel data will be updated or added.
pAlpha | Points to the source bitmap handle, which references the bitmap that is used to create or replace the alpha channel data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Typically, an alpha channel contains a mask that is used for transparency. This function, together with L_GetBitmapAlpha and the LEADTOOLS region processing functions, lets you use the alpha channel to implement transparency.

Only 16-, 32- and 64-bit images can have an alpha channel. If pBitmap references a bitmap of any other color resolution, this function converts the pBitmap bitmap to 32-bit before it replaces the alpha channel. (If you want 16-bit, you should change it using L_ColorResBitmap, if necessary, before calling this function.)

For 64-bit bitmaps, pAlpha is converted to 16 bit grayscale before replacing the alpha channel. If pBitmap is 48-bit, it will be converted to 64-bit and then have the alpha information added to it.

The pAlpha bitmap does not have to be grayscale. This function converts the data from the pAlpha bitmap to the necessary grayscale or 1-bit format as it replaces the alpha channel in pBitmap. (The pAlpha bitmap, itself, remains unchanged.)

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapAlpha, L_CreateMaskFromBitmapRgn, L_SetBitmapRgnFromMask
Topics: | Defining and Using a Bitmap Region
 | Implementing Transparency
 | Saving a Region

Example

/* This example shows how to create, save, and use a mask for transparency.
We assume that the window has already been created and sized to fit the aspect
ratio of the image specified in pszFilename. */
void TestFunction(HWND hWnd, L_TCHAR* szFilename)
{
BITMAPHANDLE MainBitmap; /* Main bitmap */
BITMAPHANDLE AlphaBitmap; /* Alpha channel bitmap */
RGNXFORM XFormToBitmap; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the current region */
HPALETTE hSavedPalette = NULL; /* Temporary copy of the current system palette */
HPALETTE hOurPalette = NULL; /* The palette that we will use to paint */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap at 16 bits per pixel */
L_LoadBitmap(szFilename, &MainBitmap, sizeof(BITMAPHANDLE), 16, ORDER_BGR, NULL, NULL);
/* Set XFormToBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormToBitmap.uViewPerspective = TOP_LEFT;
XFormToBitmap.nXScalarNum = BITMAPWIDTH(&MainBitmap);
XFormToBitmap.nXScalarDen = rClientArea.right;
XFormToBitmap.nYScalarNum = BITMAPHEIGHT(&MainBitmap);
XFormToBitmap.nYScalarDen = rClientArea.bottom;
XFormToBitmap.nXOffset = 0;
XFormToBitmap.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create an elliptical region in the AlphaBitmap */
L_SetBitmapRgnEllipse(&MainBitmap, &XFormToBitmap, &rRgnRect, L_RGN_SET);
/* Create a mask bitmap from the region */
L_CreateMaskFromBitmapRgn ( &MainBitmap, &AlphaBitmap, sizeof(BITMAPHANDLE) );
/* Update the alpha channel in the main bitmap */
L_SetBitmapAlpha(&MainBitmap, &AlphaBitmap);
/* Save the bitmap at 16 bits per pixel to keep the alpha channel */
L_SaveBitmap(TEXT("TEST.TIF"), &MainBitmap, FILE_TIF, 16, 0, NULL);
/* Free the bitmaps */
L_FreeBitmap(&MainBitmap);
L_FreeBitmap(&AlphaBitmap);
/* Load the bitmap that we just saved and get its alpha channel */
L_LoadBitmap(TEXT("TEST.TIF"), &MainBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_GetBitmapAlpha(&MainBitmap, &AlphaBitmap, sizeof(BITMAPHANDLE));
/* Use the AlphaBitmap as a mask to set the region in the MainBitmap */
L_SetBitmapRgnFromMask ( &MainBitmap, NULL, &AlphaBitmap, L_RGN_SET );
/* Create the palette that we will use to paint */
hOurPalette = L_CreatePaintPalette(hWindowDC, &MainBitmap);
/* Select our palette and save the old one */
hSavedPalette = SelectPalette (hWindowDC, hOurPalette, FALSE);
/* Realize our palette */
RealizePalette (hWindowDC);
/* Paint the region */
L_PaintRgnDC(hWindowDC, /* Device context */
&MainBitmap,/* Bitmap handle */
NULL, /* Default source rectangle */
NULL, /* Default source clip area */
&rClientArea, /* Destination rectangle */
NULL, /* Default destination clipping rectangle */
SRCCOPY); /* ROP3 code for a Normal Paint */
/* Restore the old palette */
SelectPalette (hWindowDC, hSavedPalette, FALSE);
/* Release the device context */
ReleaseDC(hWnd, hWindowDC);
/* Free the AlphaBitmap */
L_FreeBitmap(&AlphaBitmap);
return;
}


L_SetBitmapDataPointer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapDataPointer(pBitmap, pData, dwSize)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_HUGE *pData; | /* data pointer */
L_UINT32 dwSize; | /* size of the data buffer pointed to by pData */

Sets the data pointer for the specified bitmap to the specified data pointer pData.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap whose data pointer will be set.
pData | Data pointer used to set the specified bitmap’s data pointer.
dwSize | Size of the data buffer pointed to by pData.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can be used to change the data pointer of a bitmap that was created by L_CreateBitmap, or allocated by L_AllocateBitmap, with memory type TYPE_USER. The data pointer to of the bitmap is set to the data pointer passed in through pData.

You are responsible for managing the image data. L_FreeBitmap will not free pData.

The memory buffer pointed to by pData must be valid when the bitmap is being used. If you free a memory buffer that is referenced by a bitmap, you will get access violations when you try to use that bitmap.

If you pass NULL for pData, the bitmap has no bitmap data. You should not try to use a bitmap that has no data pointer.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AllocateBitmap, L_CreateBitmap
Topics: | Raster Image Functions: Creating and Deleting Images

Example

Please note that you need to free the memory allocated for the bitmap and the bitmap data using the following:

L_FreeBitmap(pBitmap);
GlobalFreePtr(pBuffer);

#include "windowsx.h"

L_INT TestDataPointer(pBITMAPHANDLE pBitmap)
{
// allocate a buffer large enough to hold two copies of the image
L_UCHAR L_HUGE*pBuffer = (L_UCHAR L_FAR *)GlobalAllocPtr(GMEM_MOVEABLE, pBitmap->Size * 2);
L_INT i;
L_INT nRet;

// loop and get the flipped and normal versions of the image into pBuffer
for(i = 0; i < pBitmap->Height; i++)
{
L_GetBitmapRow(pBitmap,
pBuffer + i * pBitmap->BytesPerLine,
pBitmap->ViewPerspective == TOP_LEFT ? pBitmap->Height - i - 1 : i,
pBitmap->BytesPerLine);
memcpy( pBuffer + pBitmap->Size + (pBitmap->Height - i - 1) * pBitmap->BytesPerLine,
pBuffer + i * pBitmap->BytesPerLine,
pBitmap->BytesPerLine);
}

// free the original image. Note that it is assumed that the image was 24 bit
// for simplicity, so that it is not necessary to pass an array of palette entries to L_CreateBitmap
// For color images, you would have to get the palette entries and pass them instead of NULL
L_FreeBitmap(pBitmap);

// this sets the image to be the flipped version
if((nRet = L_CreateBitmap(pBitmap, sizeof(BITMAPHANDLE),
TYPE_USER,
pBitmap->Width, pBitmap->Height, pBitmap->BitsPerPixel,
pBitmap->Order, NULL,
TOP_LEFT,
pBuffer, pBitmap->Size)) == SUCCESS)
{
MessageBox( NULL, TEXT("The image is flipped"), TEXT(""), MB_OK);
// this sets the image to be the non-flipped version
return L_SetBitmapDataPointer(pBitmap, pBuffer + pBitmap->Size, pBitmap->Size);
}
return nRet;
}


L_SetBitmapListItem

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapListItem(hList, uIndex, pBitmap)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT uIndex; | /* index of the bitmap to overwrite */
pBITMAPHANDLE pBitmap; | /* pointer to the source bitmap handle */

Overwrites the internal bitmap handle of a bitmap in a list. Use this function with L_GetBitmapListItem to manipulate a bitmap in a list.

Parameter | Description
hList | Handle to the list of bitmaps.
uIndex | Position of the bitmap in the list. Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.
pBitmap | Pointer to the bitmap handle that will overwrite the internal bitmap handle in the list.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When a bitmap is in a list, you do not have direct access to the bitmap handle. Therefore, to do any image processing, you must first use L_GetBitmapListItem to get a copy of the internal handle, then do the image processing, then update the internal handle using L_SetBitmapListItem.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_RemoveBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For a short example, refer to L_GetBitmapListItem. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_SetBitmapMemoryInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapMemoryInfo(pBitmap, uMemory, uTileSize, uTotalTiles, uConvTiles, uMaxTileViews, uTileViews, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uMemory; | /* memory type to set */
L_UINT uTileSize; | /* tile size to set */
L_UINT uTotalTiles; | /* number of tiles to set */
L_UINT uConvTiles; | /* number of conventional tiles to set */
L_UINT uMaxTileViews; | /* maximum number of disk tile views to set */
L_UINT uTileViews; | /* number of actual disk tile views to set */
L_UINT uFlags; | /* flags that indicate which parameters are valid */

Sets the bitmap allocation parameters.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap for which to set the allocation parameters. It cannot be NULL and it must be allocated.
uMemory | Value that represents the new memory type for the bitmap. This parameter is used only if SETMEM_MEMORY is set in uFlags.
uTileSize | Value that represents the new size for the tile. This parameter is used only if SETMEM_TILESIZE is set in uFlags.
uTotalTiles | Value that represents the new number of tiles. This parameter is used only if SETMEM_TOTALTILES is set in uFlags.
uConvTiles | Value that represents the new number of conventional tiles. This parameter is used only if SETMEM_CONVTILES is set in uFlags.
uMaxTileViews | Value that represents the new maximum number of swap buffers for the disk tiles. This parameter is used only if SETMEM_MAXTILEVIEWS is set in uFlags.
uTileViews | Value that represents the new number of swap buffers for the disk tiles. This parameter is used only if SETMEM_TILEVIEWS is set in uFlags.
uFlags | Flags that indicate which parameters should be considered valid. Possible values are one or an OR-ed combination of the following:
 | Value | Meaning
 | SETMEM_MEMORY | [0x0001] uMemory is valid
 | SETMEM_TILESIZE | [0x0002] uTileSize is valid
 | SETMEM_TOTALTILES | [0x0004] uTotalTiles is valid
 | SETMEM_CONVTILES | [0x0008] uConvTiles is valid
 | SETMEM_MAXTILEVIEWS | [0x0010] uMaxTileViews is valid
 | SETMEM_TILEVIEWS | [0x0020] uTileViews is valid

Comment

If uMemory is valid and is not TYPE_TILED, then the other parameters are ignored. If uMemory is not valid and the bitmap is not tiled, then the other parameters are ignored. This overrides the uFlags parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetMemoryThresholds, L_GetMemoryThresholds, L_GetBitmapMemoryInfo, L_SetTempDirectory, L_GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

// change the tiled bitmap so is can use as many cache buffers as possible:
BITMAPHANDLE Bitmap;
L_SetBitmapMemoryInfo(
&Bitmap,
0, // uMemory
0, // uTileSize
0, // uTotalTiles
0, // uConvTiles
(L_UINT)-1, // uMaxTileViews,
(L_UINT)-1, // uTileViews,
SETMEM_MAXTILEVIEWS | SETMEM_TILEVIEWS
);


L_SetBitmapPalette

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapPalette(pBitmap, hPalette)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
HPALETTE hPalette; | /* handle to a Windows GDI palette */

Replaces the specified bitmap’s palette.

Parameter | Description
pBitmap | Pointer to the bitmap whose palette is to be changed.
hPalette | Handle to the Windows GDI palette that will replace the existing bitmap palette.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The bitmap must be 8-bit or less in order to have a valid palette. The hPalette will be duplicated. The copy of hPalette that is made by this function will be destroyed when the bitmap is freed. You must destroy the original hPalette using the Windows API DeleteObject when it is no longer needed.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetFixedPalette, L_ColorResBitmap, L_CreatePaintPalette, L_GetBitmapColors, L_PutBitmapColors, L_DupPalette, L_DupBitmapPalette
Topics: | Raster Image Functions: Displaying Images Handling Palette Changes

Example

#pragma pack(1)
typedef struct tagLOG256PALETTE
{
L_UINT16 palVersion;
L_UINT16 palNumEntries;
PALETTEENTRY palPalEntry[256];
} LOG256PALETTE;
#pragma pack()

L_VOID SetBitmapPalette()

{

/* This example loads a bitmap, and changes its palette */

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the final image */

HPALETTE hPalette=NULL;

LOG256PALETTE pal;

L_UINT u;

/* Load the bitmap at 8 bits per pixel so that we can demonstrate
how to handle its palette. */
L_LoadBitmap (TEXT("d:\\temp\\golf.jpg"), &LeadBitmap, sizeof(BITMAPHANDLE), 8, ORDER_BGR, NULL, NULL);

/* create a grayscale palette */
pal.palVersion = 0x300;
pal.palNumEntries = 256;
for(u=0; u<256; u++)
{
pal.palPalEntry[u].peRed = u;
pal.palPalEntry[u].peGreen = u;
pal.palPalEntry[u].peBlue = u;
pal.palPalEntry[u].peFlags = 0;
}
hPalette = CreatePalette((LPLOGPALETTE) &pal);

/* update the palette */
L_SetBitmapPalette(&LeadBitmap, hPalette);

/* save the image */
L_SaveBitmap(TEXT("d:\\temp\\PALETTE.BMP"), &LeadBitmap, FILE_BMP, 0, 0, NULL);

/* Free the resized bitmap */
L_FreeBitmap(&LeadBitmap);
/* Delete the Palette */
DeleteObject(hPalette);

}


L_SetBitmapRgnBorder

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnBorder(pBitmap, x, y, crBorderColor, crLowerTolerance, crUpperTolerance, uCombineMode);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT x; | /* x coordinate */
L_INT y; | /* y coordinate */
COLORREF crBorderColor; | /* border color */
COLORREF crLowerTolerance; | /* upper tolerance values */
COLORREF crUpperTolerance; | /* upper tolerance values */
L_UINT uCombineMode; | /* action to take regarding the existing region */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
x | X coordinate of a point. The color of the specified point will be used to set the region.
y | Y coordinate of a point. The color of the specified point will be used to set the region.
crBorderColor | Border color.
crLowerTolerance | Lower tolerance values that set the lower stopping point for the region.
crUpperTolerance | Upper tolerance values that set the upper stopping point for the region.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 descriptions of the possibilities, refer to Creating a Bitmap Region.

This function 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 function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnMagicWand
Topics: | Raster Image Functions: Creating and Using a Region
 | Creating a Bitmap Region
 | Using Color Values in LEADTOOLS
 | Saving a Region

Example

L_VOID SetRgn(pBITMAPHANDLE pBitmap, HWND hWnd, L_INT x, L_INT y, COLORREF crBorder)
{
L_INT nRet;
RGNXFORM XForm;

L_PointToBitmap(pBitmap, TOP_LEFT, &x, &y);
if(L_BitmapHasRgn(pBitmap))
nRet = L_SetBitmapRgnBorder(pBitmap, x, y,crBorder, (20,30,15),(15,30,10), L_RGN_OR);
else
nRet = L_SetBitmapRgnBorder(pBitmap, x, y,crBorder, (20,30,15),(15,30,10), L_RGN_SET);

if(nRet == SUCCESS)
{
if(L_BitmapHasRgn(pBitmap))
{
HDC hDC=GetDC(hWnd);
XForm.uViewPerspective=TOP_LEFT;
XForm.nXScalarNum=1;
XForm.nXScalarDen=1;
XForm.nYScalarNum=1;
XForm.nYScalarDen=1;
XForm.nXOffset=0;
XForm.nYOffset=0;

L_FrameBitmapRgn(hDC, pBitmap, &XForm, 3);
ReleaseDC(hWnd, hDC);
}
else
MessageBox(hWnd, TEXT("no rgn"), TEXT("error"), MB_OK);
}
return;
}


L_SetBitmapRgnColor

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnColor(pBitmap, crColor, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF crColor; | /* color to use for the region */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a region that consists of all the pixels of a specified color.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
crColor | The COLORREF value that specifies the color to use for the region. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You specify the color using a COLORREF value, which is a Windows-defined data type. You can assign the value using the Windows RGB macro.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

You can use this function to simulate the use of a transparent color as follows:

1. | Call the L_SetBitmapRgnColor function, with the transparent color in the crColor parameter and L_RGN_SETNOT in the uCombineMode parameter.
2. | Call the L_PaintRgnDC function to paint the resulting region, which includes everything in the bitmap, except the transparent color.

This function 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 function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Using Color Values in LEADTOOLS
 | Saving a Region

Example

For complete sample code, refer to the FEATURE3 example.

/* This example creates a region that includes all pixels of a specified color.
It then fills the region with blue. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction ( HWND hWnd )
{
COLORREF RgnColor; /* Color to use when defining the region */
L_INT XOffset, YOffset; /* Pixel coordinates for getting a color from the bitmap */
/* Load the bitmap, at its own bits per pixel */
L_LoadBitmap (TEXT("image3.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Posterize the bitmap to decrease the number of colors */
L_PosterizeBitmap(&LeadBitmap,16);
/* Specify a pixel in the upper left of the displayed image */
XOffset = BITMAPWIDTH(&LeadBitmap) / 8;
YOffset = BITMAPHEIGHT(&LeadBitmap) / 8;
/* Adjust the YOffset in case the view perspective is not TOP_LEFT */
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &XOffset, &YOffset );
/* Get the color of the specified pixel */
RgnColor = L_GetPixelColor(&LeadBitmap, YOffset, XOffset);
/* Create a region that includes all pixels of that color */
L_SetBitmapRgnColor(&LeadBitmap, RgnColor, L_RGN_SET);
/* Fill the region with blue */
L_FillBitmap(&LeadBitmap,RGB(0, 0, 255) );
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
return;
}


L_SetBitmapRgnColorHSVRange

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnColorHSVRange(pBitmap, hsvLower, hsvUpper, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
HSVREF hsvLower; | /* minimum HSV color value */
HSVREF hsvUpper; | /* maximum HSV color value */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a region that consists of all the pixels that fall in the range hsvLower ... hsvUpper, inclusively.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
hsvLower | Structure that contains the minimum (inclusive) H,S, and V values. A pixel must have H,S, and V all greater than or equal to hsvLower and less than or equal to hsvUpper to be included in the region.
hsvUpper | Structure that contains the maximum (inclusive) H,S, and V values. A pixel must have H,S, and V all greater than or equal to hsvLower and less than or equal to hsvUpper to be included in the region.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function uses the HSV color model to set a region based on a color range.

It is useful for identifying all shades of a certain color. For example, L_SetBitmapRgnColorHSVRange 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)

To be added to the region a color must fall in the range hsvLower..hsvUpper. If you want to set a region for all red (and colors near red), you could specify hsvLower and hsvUpper as follows:

hsvLower(250,1,1)

hsvUpper(5,255,255)

Note that hue for hsvLower is 250 and hue for hsvUpper 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, specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

This function 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 function.

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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RemapBitmapHue, L_SetBitmapRgnColorRGBRange, L_RGBtoHSV, L_HSVtoRGB, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Creating a Bitmap Region
 | Working with the Existing Bitmap Region
 | Saving a Region

Example

//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

L_INT ExampleSetHSVRgn(pBITMAPHANDLE pBitmap)
{
HSVREF hsvLo, hsvHi;
L_INT nRet;

hsvLo.uH = 75;
hsvLo.uS = 40;
hsvLo.uV = 40;

hsvHi.uH = 95;
hsvHi.uS = 255;
hsvHi.uV = 255;

nRet = L_SetBitmapRgnColorHSVRange(
pBitmap,
hsvLo,
hsvHi,
L_RGN_SET);
return nRet;
}


L_SetBitmapRgnColorRGBRange

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnColorRGBRange(pBitmap, crLower, crUpper, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COLORREF crLower; | /* minimum RGB color value */
COLORREF crUpper; | /* maximum RGB color value */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a region that consists of all the pixels that fall in the range crLower ... crUpper, inclusively.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
crLower | COLORREF 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 | COLORREF 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.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_SetBitmapRgnColorHSVRange.

To update an existing region, specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

This function 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 function.

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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RemapBitmapHue, L_SetBitmapRgnColorHSVRange, L_RGBtoHSV, L_HSVtoRGB, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Creating a Bitmap Region
 | Working with the Existing Bitmap Region
 | Using Color Values in LEADTOOLS
 | Saving a Region

Example

//This example sets a region corresponding to all colors that
//have an rgb that includes red but no green and no blue

L_INT ExampleSetRGBRgn(pBITMAPHANDLE pBitmap)
{
COLORREF rgbLo, rgbHi;
L_INT nRet;

rgbLo = RGB(1,0,0);
rgbHi = RGB(255,0,0);

nRet = L_SetBitmapRgnColorRGBRange(
pBitmap,
rgbLo,
rgbHi,
L_RGN_SET);
return nRet;
}


L_SetBitmapRgnCurve

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnCurve(pBitmap, pXForm, pCurve, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
pCURVE pCurve; | /* pointer to a structure */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a curved region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pCurve | Pointer to the CURVE structure that specifies the curve region. You specify the structure using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
uCombineMode | Flag that indicates the action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, specify how the new region is to be combined with the existing one, in the uCombineMode parameter. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect, L_SetBitmapRgnColorHSVRange, L_SetBitmapRgnColorRGBRange
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Creating a Bitmap Region
 | Working with the Existing Bitmap Region
 | Saving a Region

Example

//This sample creates a smooth region that goes through five points, and inverts the region
L_INT SampleSetBitmapRgnCurve(pBITMAPHANDLE pBitmap)
{
L_INT nRet;
CURVE Curve;
POINT points[5];

//Define the points of the curve
points[0].x = 30;
points[0].y = 30;

points[1].x = 30;
points[1].y = 200;

points[2].x = 130;
points[2].y = 130;

points[3].x = 75;
points[3].y = 75;

points[4].x = 130;
points[4].y = 30;

Curve.uStructSize = sizeof(CURVE);
Curve.nType = CURVE_STANDARD;
Curve.nPointCount = 5;
Curve.pPoints = points;
Curve.uFillMode = L_POLY_WINDING;
Curve.dTension = 0.5;
Curve.nClose = CURVE_CLOSE;
Curve.nReserved = 0;

nRet = L_SetBitmapRgnCurve(pBitmap, NULL, &Curve, L_RGN_SET);

//Do something with the region
L_InvertBitmap(pBitmap);

//When finished, free the region
L_FreeBitmapRgn(pBitmap);

return nRet;
}


L_SetBitmapRgnEllipse

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnEllipse(pBitmap, pXForm, pRect, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
RECT L_FAR * pRect; | /* pointer to the bounding rectangle of the region */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding an elliptical region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pRect | Pointer to the windows RECT structure that specifies the bounding rectangle of the elliptical region. You specify the structure using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example creates an elliptical region and lightens the part of the bitmap
that is in the region */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RGNXFORM XForm; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the region */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set RGNXFORM fields, assuming that the display rectangle is the same
as the client area of the current window */
XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = BITMAPWIDTH(&LeadBitmap);
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BITMAPHEIGHT(&LeadBitmap);
XForm.nYScalarDen = rClientArea.bottom;
XForm.nXOffset = 0;
XForm.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create an elliptical region */
L_SetBitmapRgnEllipse(&LeadBitmap, &XForm, &rRgnRect, L_RGN_SET);
/* Lighten the region so that we will see it */
L_ChangeBitmapIntensity(&LeadBitmap,500);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
return;
}


L_SetBitmapRgnFromMask

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnFromMask(pBitmap, pXForm, pMask, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
pBITMAPHANDLE pMask; | /* pointer to the mask bitmap handle */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a region that consists of all the white pixels in a 1-bit mask image.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the target bitmap's view perspective.
pMask | The 1-bit black-and-white image used as a mask.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapAlpha, L_SetBitmapAlpha, L_CreateMaskFromBitmapRgn
Topics: | Defining and Using a Bitmap Region
 | Saving a Region

Example

/* This example sets a region into a bitmap using a 1-bit black-and-white mask image. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
BITMAPHANDLE MaskBitmap; /* Bitmap handle that holds the mask bitmap */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL );
L_LoadBitmap (TEXT("MASK.TIF"), &MaskBitmap, sizeof(BITMAPHANDLE), 1, ORDER_BGR, NULL, NULL );
L_SetBitmapRgnFromMask ( &LeadBitmap, NULL, &MaskBitmap, L_RGN_SET );


L_SetBitmapRgnHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnHandle(pBitmap, pXForm, hRgn, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
HRGN hRgn; | /* handle to the Windows region */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a region that is specified by a Windows region handle.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | You should create this structure when the Windows region is created. Otherwise the device context values may not be available when you are ready to add the Windows region to the bitmap region.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
hRgn | Handle to the Windows region.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

The device coordinates are the ones that were in effect at the time the Windows region was created.

If you want to assign a region from one bitmap to another, you must use the L_GetBitmapRgnHandle function to get region from the first bitmap; then use the L_SetBitmapRgnHandle function to assign the region to the second bitmap.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetBitmapRgnHandle
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

For complete sample code, refer to the DRAW example.

/* This example creates and saves one elliptical region. It then creates a second
elliptical region and adds the saved region to it. Finally, it lightens the part of
the bitmap that is in the resulting region. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RGNXFORM XFormToBitmap; /* Structure for transforming display coordinates */
RGNXFORM XFormFromBitmap; /* Structure for transforming bitmap coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the region */
HRGN SavedRegion; /* Windows region handle used to save a region */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set XFormToBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormToBitmap.uViewPerspective = TOP_LEFT;
XFormToBitmap.nXScalarNum = BITMAPWIDTH(&LeadBitmap);
XFormToBitmap.nXScalarDen = rClientArea.right;
XFormToBitmap.nYScalarNum = BITMAPHEIGHT(&LeadBitmap);
XFormToBitmap.nYScalarDen = rClientArea.bottom;
XFormToBitmap.nXOffset = 0;
XFormToBitmap.nYOffset = 0;
/* Set XFormFromBitmap fields, assuming that the display rectangle is the same
as the client area of the current window */
XFormFromBitmap.uViewPerspective = TOP_LEFT;
XFormFromBitmap.nXScalarNum = rClientArea.right;
XFormFromBitmap.nXScalarDen = BITMAPWIDTH(&LeadBitmap);
XFormFromBitmap.nYScalarNum = rClientArea.bottom;
XFormFromBitmap.nYScalarDen = BITMAPHEIGHT(&LeadBitmap);
XFormFromBitmap.nXOffset = 0;
XFormFromBitmap.nYOffset = 0;
/* Specify a rectangle to define the first elliptical region */
SetRect(&rRgnRect, 0, rClientArea.bottom/8,
rClientArea.right/4, rClientArea.bottom/2);
/* Create the first elliptical region */
L_SetBitmapRgnEllipse(&LeadBitmap, &XFormToBitmap, &rRgnRect, L_RGN_SET);
/* Save the first elliptical region */
L_GetBitmapRgnHandle(&LeadBitmap, &XFormFromBitmap, &SavedRegion);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
/* Specify a rectangle to define the second elliptical region */
SetRect(&rRgnRect, rClientArea.right/4, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create the second elliptical region */
L_SetBitmapRgnEllipse(&LeadBitmap, &XFormToBitmap, &rRgnRect, L_RGN_SET);
/* Add the saved region to the new one, resulting in side-by-side elliptical shapes */
L_SetBitmapRgnHandle(&LeadBitmap, &XFormToBitmap, SavedRegion, L_RGN_OR);
/* Lighten the region so that we will see it */
L_ChangeBitmapIntensity(&LeadBitmap,500);
/* Delete the HRGN object */
DeleteObject(SavedRegion);
return;
}


L_SetBitmapRgnMagicWand

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnMagicWand(pBitmap, x, y, crLowerTolerance, crUpperTolerance, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT x; | /* x coordinate */
L_INT y; | /* y coordinate */
COLORREF crLowerTolerance; | /* upper tolerance values */
COLORREF crUpperTolerance; | /* upper tolerance values */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Sets a region based on the color found at point x, y in the bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap.
x | X coordinate of a point. The color of the specified point will be used to set the region.
y | Y coordinate of a point. The color of the specified point will be used to set the region.
crLowerTolerance | Lower tolerance values that set the lower stopping point for the region.
crUpperTolerance | Upper tolerance values that set the upper stopping point for the region.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap 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 function 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 function.

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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_HolesRemovalBitmapRgn, L_SetBitmapRgnBorder
Topics: | Raster Image Functions: Creating and Using a Region
 | Defining and Using a Bitmap Region
 | Using Color Values in LEADTOOLS
 | Saving a Region

Example

L_VOID SetRgn(pBITMAPHANDLE pBitmap, HWND hWnd, L_INT x, L_INT y)
{
L_INT nRet;
RGNXFORM XForm;

L_PointToBitmap(pBitmap, TOP_LEFT, &x, &y);
if(L_BitmapHasRgn(pBitmap))
nRet = L_SetBitmapRgnMagicWand(pBitmap, x, y, (20,30,15),(15,30,10), L_RGN_OR);
else
nRet = L_SetBitmapRgnMagicWand(pBitmap, x, y, (20,30,15),(15,30,10), L_RGN_SET);
if(nRet == SUCCESS)
{
if(L_BitmapHasRgn(pBitmap))
{
HDC hDC=GetDC(hWnd);
XForm.uViewPerspective=TOP_LEFT;
XForm.nXScalarNum=1;
XForm.nXScalarDen=1;
XForm.nYScalarNum=1;
XForm.nYScalarDen=1;

XForm.nXOffset=0;
XForm.nYOffset=0;
L_FrameBitmapRgn(hDC, pBitmap, &XForm, 3);
ReleaseDC(hWnd, hDC);
}
else
MessageBox(hWnd, TEXT("no rgn"), TEXT("error"), MB_OK);
}
return;
}


L_SetBitmapRgnPolygon

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnPolygon(pBitmap, pXForm, pPoints, uPoints, uFillMode, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
POINT L_FAR * pPoints; | /* pointer to an array of POINT structures */
L_UINT uPoints; | /* number of points in the array */
L_UINT uFillMode; | /* indicates how to handle complex crossing lines */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a polygonal region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pPoints | Pointer to an array of POINT structures. The points in the array must be in the order in which the vertices of the polygon are connected. To create the line that closes the polygon, the last point in the array is connected to the first point of the array.
uPoints | The number of points in the array specified by the pPoints parameter.
uFillMode | 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.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnEllipse, L_SetBitmapRgnRect, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example creates a polygonal region and, using the alternate fill mode,
lightens the part of the bitmap that is in the region */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RGNXFORM XForm; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
POINT PolyPt[5]; /* Array of points that defines the polygon */
POINT L_FAR * pPolyPt = PolyPt; /* Pointer to the array of points */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Specify the vertices of the polygon (a 5-pointed star) */
pPolyPt[0].x = 0;
pPolyPt[0].y = 0;
pPolyPt[1].x = rClientArea.right / 3;
pPolyPt[1].y = rClientArea.bottom / 2;
pPolyPt[2].x = rClientArea.right / 3;
pPolyPt[2].y = 0;
pPolyPt[3].x = 0;
pPolyPt[3].y = rClientArea.bottom / 3;
pPolyPt[4].x = rClientArea.right / 2;
pPolyPt[4].y = rClientArea.bottom / 3;
/* Load a bitmap */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set RGNXFORM fields, assuming that the display rectangle is the same
as the client area of the current window */
XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = BITMAPWIDTH(&LeadBitmap);
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BITMAPHEIGHT(&LeadBitmap);
XForm.nYScalarDen = rClientArea.bottom;
XForm.nXOffset = 0;
XForm.nYOffset = 0;
/* Create a polygonal region */
L_SetBitmapRgnPolygon(&LeadBitmap, &XForm, pPolyPt, 5, L_POLY_ALTERNATE, L_RGN_SET);
/* Lighten the region so that we will see it */
L_ChangeBitmapIntensity(&LeadBitmap,500);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
return;
}


L_SetBitmapRgnRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnRect(pBitmap, pXForm, pRect, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
RECT L_FAR * pRect; | /* pointer to the rectangular region */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a rectangular region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pRect | Pointer to the windows RECT structure that specifies the rectangular region. You specify the structure using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example creates a rectangular region and lightens the part of the bitmap
that is in the region */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RGNXFORM XForm; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the region */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set RGNXFORM fields, assuming that the display rectangle is the same
as the client area of the current window */
XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = BITMAPWIDTH(&LeadBitmap);
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BITMAPHEIGHT(&LeadBitmap);
XForm.nYScalarDen = rClientArea.bottom;
XForm.nXOffset = 0;
XForm.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create a rectangular region */
L_SetBitmapRgnRect(&LeadBitmap, &XForm, &rRgnRect, L_RGN_SET);
/* Lighten the region so that we will see it */
L_ChangeBitmapIntensity(&LeadBitmap,500);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
return;
}


L_SetBitmapRgnRoundRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetBitmapRgnRoundRect(pBitmap, pXForm, pRect, nWidthEllipse, nHeightEllipse, uCombineMode)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pRGNXFORM pXForm; | /* pointer to a coordinate-translation structure */
RECT L_FAR * pRect; | /* pointer to the bounding rectangle of the region */
L_INT nWidthEllipse; | /* width of the ellipse used for rounded corners */
L_INT nHeightEllipse; | /* height of the ellipse used for rounded corners */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Creates or updates the bitmap region by adding a rounded rectangular region.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
pXForm | Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
 | If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
pRect | Pointer to the windows RECT structure that specifies the bounding rectangle of the region. You specify the structure using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
nWidthEllipse | The width of the ellipse that describes the arc of the rounded corners. You specify the measurement in device context pixels, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
nHeightEllipse | The height of the ellipse that describes the arc of the rounded corners. You specify the measurement in device context pixels, and LEADTOOLS translates the coordinates using the values specified in the pXForm parameter.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.

To update an existing region, you specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

The following illustration shows how you describe the rounded corners by specifying the width and height of an ellipse:

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example creates a rounded rectangular region and lightens
the part of the bitmap that is in the region */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RGNXFORM XForm; /* Structure for transforming display coordinates */
HDC hWindowDC; /* Device context of the current window */
RECT rClientArea; /* Client area of the current window */
RECT rRgnRect; /* Rectangle that defines the region */
/* Get the device context of the current window */
hWindowDC = GetDC (hWnd);
/* Get the client area of the current window */
GetClientRect(hWnd,&rClientArea);
/* Load a bitmap */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Set RGNXFORM fields, assuming that the display rectangle is the same
as the client area of the current window */
XForm.uViewPerspective = TOP_LEFT;
XForm.nXScalarNum = BITMAPWIDTH(&LeadBitmap);
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BITMAPHEIGHT(&LeadBitmap);
XForm.nYScalarDen = rClientArea.bottom;
XForm.nXOffset = 0;
XForm.nYOffset = 0;
/* Specify a rectangle to define the region */
SetRect(&rRgnRect, rClientArea.right/8, rClientArea.bottom/8,
rClientArea.right/2, rClientArea.bottom/2);
/* Create a rounded rectangular region */
L_SetBitmapRgnRoundRect(&LeadBitmap, &XForm, &rRgnRect,
rClientArea.right/16, /* Width of the ellipse that defines the corners */
rClientArea.right/16, /* Height of the ellipse that defines the corners */
L_RGN_SET);
/* Lighten the region so that we will see it */
L_ChangeBitmapIntensity(&LeadBitmap,500);
/* Free the region */
L_FreeBitmapRgn(&LeadBitmap);
return;
}


L_SetComment

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetComment(uType, pComment, uLength)

L_UINT uType; | /* type of comment */
L_UCHAR, L_FAR * pComment; | /* pointer to the buffer for the comment field */
L_UINT uLength; | /* size of the buffer that contains the comment field */

Specifies a field to be saved as a comment in a file.

Parameter | Description
uType | The type of comment. Valid values are:
 | Value | Meaning
 | JPEG and LEAD FileComments |
 | Tiff FileComments |
 | Exif FileComments |
 | Gif FileComments |
 | Dicom FileComments |
 | FlashPix FileComments |
 | CMNT_LAST | Last defined number for comments. To clear all fields, you can use the type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.
pComment | Pointer to the buffer containing the comment field that you want to set. You can pass NULL to clear the current field.
uLength | The size of your buffer that contains the comment field. (If the buffer is actually a single string, this is the string length + 1.)

Returns

>=0 | Length of the comment field.
< 0 | An error occurred. Refer to Return Codes.

Comments

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.

This function works with related functions. For example, consider the following possible sequence:

1. | Use the L_SetComment function to specify any of the comments that you want to save in a file header.
2. | Use the L_GetComment function to let the user review the comments before they are saved.
3. | Save one or more files that you want to include the currently specified comments. You can use any LEADTOOLS function that saves a file. The file format can be any that includes a TIFF header, such as CCITT or TIFF (but not JTIF).
4. | Use the L_SetComment function with a NULL buffer and 0 length to clear each of the comment fields. You must call the this function once for each specified field. To clear all fields, you can use the type constant as a loop counter. The first constant (specified in the uType parameter) is 0 and the last is CMNT_LAST.
5. | Use the L_ReadFileComment function to let the user review the comments that have been saved in a file.

Note:

More options are available in the SAVEFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_ReadFileCommentMemory, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_ReadFileCommentOffset
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

/* This example demonstrates all of the functions related to comments for TIFF files.
It clears all comments, sets a new comment, gets the comment from memory,
saves a file with the comment, then gets the comment from the file. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
void TestSaveFunction(void)
{
L_INT i; /* Loop counter */
L_UCHAR TextToSet[80]; /* Comment string that we will set */
L_CHAR L_FAR * pTextToSet = (L_CHAR L_FAR *)TextToSet;
L_TCHAR szMessage[80]; /* MessageBox string */
L_CHAR L_FAR * pTextToGet; /* Comment string that we will get */
HGLOBAL hTextToGet; /* Handle for memory management */
L_INT CommentLength; /* Length of the comment string that we will get */
/* Clear the current comments */
for(i = 0 ; i < CMNT_LAST ; i++ )
{
L_SetComment(i, NULL, 0);
}
/* Set the comment that we will save */
pTextToSet = "Susie, the artist";
L_SetComment(CMNT_SZARTIST, (L_UCHAR *)pTextToSet, strlen(pTextToSet) + 1);
/* Use the return value to get the length of a comment */
CommentLength = L_GetComment(CMNT_SZARTIST, NULL, 0);
/* Allocate and lock a zero-filled buffer for the comment */
hTextToGet = GlobalAlloc(GPTR, CommentLength);
pTextToGet = (L_CHAR L_FAR *)GlobalLock( hTextToGet );
/* Get the actual comment */
L_GetComment(CMNT_SZARTIST, (L_UCHAR L_FAR *)pTextToGet, CommentLength);
/* Show the comment that will be saved */
wsprintf (szMessage,TEXT("Saving this comment:\nArtist: %hs"), pTextToGet);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
/* Free memory */
GlobalFree(hTextToGet);
/* Save the image as an 8-bit TIF file */
L_SaveBitmap(TEXT("TEST.TIF"), &LeadBitmap, FILE_TIF, 8, 0, NULL);
/* Use the return value to get the length of a comment in the file */
CommentLength = L_ReadFileComment(TEXT("TEST.TIF"), CMNT_SZARTIST, NULL, 0, NULL);
/* Allocate and lock a zero-filled buffer for the comment */
hTextToGet = GlobalAlloc(GPTR, CommentLength);
pTextToGet = (L_CHAR L_FAR *)GlobalLock( hTextToGet );
/* Get the actual comment from the file */
L_ReadFileComment(TEXT("TEST.TIF"), CMNT_SZARTIST, (L_UCHAR L_FAR *)pTextToGet,
CommentLength, NULL);
/* Show the comment that was saved in the file */
wsprintf (szMessage, TEXT("File now has this comment:\nArtist: %hs"), pTextToGet);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
/* Free memory */
GlobalFree(hTextToGet);
return;
}


L_SetDisplayMode

#include "l_bitmap.h"

L_UINT32 EXT_FUNCTION L_SetDisplayMode(uFlagPos, uFlagSet)

L_UINT32 uFlagPos; | /* flag or flags to be changed */
L_UINT32 uFlagSet; | /* flags (of those in uFlagPos) to be turned on */

Sets flags that control the speed, quality, and style of painting operations.

Parameter | Description
uFlagPos | The flag or flags to be changed. You can use a bitwise OR ( | ) to specify more than one flag. You can use DISPLAYMODE_RESETPOSITIONS to indicate all flags.
 | Refer to Flags for the L_SetDisplayMode Function for descriptions of the flags.
uFlagSet | The flags (of those specified in the uFlagPos parameter) to be turned on. You can use a bitwise OR ( | ) to include more than one flag. You can use 0 to turn off all the flags specified in the uFlagPos parameter.
 | Refer to Flags for the L_SetDisplayMode Function for descriptions of the flags.

Returns

The unsigned integer containing the painting control flags as they were set before calling this function.

Comments

The first parameter specifies which flags are affected, and the second specifies which of those to turn on. The other affected flags are turned off.

Therefore:

To turn a flag on, specify it in the first parameter and the second.

To turn a flag off, specify it in the first parameter, but not the second.

For example, the following statement turns on fast painting, turns off dithered painting, and leaves all other flags as they were:

L_SetDisplayMode

(DISPLAYMODE_FASTPAINT | DISPLAYMODE_DITHEREDPAINT, DISPLAYMODE_FASTPAINT );

For the fastest paint, neither DISPLAYMODE_BICUBIC nor DISPLAYMODE_RESAMPLE should be set.

DISPLAYMODE_RESAMPLE and DISPLAYMODE_BICUBIC cannot be combined.

When painting 1BPP images, DISPLAYMODE_FAVORBLACK and DISPLAYMODE_SCALETOGRAY take precedence over DISPLAYMODE_RESAMPLE and DISPLAYMODE_BICUBIC.

DISPLAYMODE_RESAMPLE is faster than DISPLAYMODE_BICUBIC, but DISPLAYMODE_BICUBIC produces better results when zooming in on images. When zooming out, DISPLAYMODE_BICUBIC and DISPLAYMODE_RESAMPLE produce the same effect.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetDisplayMode
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For complete sample code, refer to the LOADSAVE example.

/* This example sets the display to use scale-to-gray, then repaints with a
grayscale palette. It checks for the current setting and Document/Medical capabilities
before changing the display mode. This affects only 1-bit images. */

void TestFunction(HWND hWnd)
{
if (L_GetDisplayMode() == DISPLAYMODE_SCALETOGRAY)
{
MessageBox (NULL, TEXT("Already using scale-to-gray"), TEXT("Notice"), MB_OK);
}
else if (L_IsSupportLocked(L_SUPPORT_DOCUMENT))
{
MessageBox (NULL, TEXT("No scale to gray - You need to unlock Document/Medical capabilities"), TEXT("Notice"), MB_OK);
}
else
{
/* Set the display mode to scale-to-gray */
L_SetDisplayMode(DISPLAYMODE_SCALETOGRAY, DISPLAYMODE_SCALETOGRAY);

/* Get a new palette as the paint palette because we are now using grayscale, instead of 1-bit */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
}
return;
}


L_SetDJVOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetDJVOptions (pOptions);

pFILEDJVOPTIONS pOptions;

/* pointer to a structure */

Sets the current options used by LEADTOOLS when loading DjVu files.

Parameter | Description
pOptions | Pointer to a structure that contains the current DjVu options to set. These options will be used when loading a DjVu file.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILEDJVOPTIONS structure must be set before calling this function. If a DjVu file is loaded without first calling this function, the following default value is used:

FILEDJVOPTIONS member | Default Value
nResolution | 96

The values set by this function are valid for this thread. To change the values used by the current thread, call this function again, with the new values set in the FILEDJVOPTIONS structure pointed to by the pOptions parameter.

To get the current options used when loading a DjVu file, call L_GetDJVOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetDJVOptions
Topics: | Loading and Saving Images
 | Raster Image Functions: Loading Files

Example

/* This example loads a DJV file, with a resolution
defined by the user */

void LoadDJVFile(L_TCHAR *pszDJVFileName, pBITMAPHANDLE pBitmap, L_INT nDisplayDepth)
{
FILEDJVOPTIONS DjvOptions;

/* Get the current DJV option */
L_GetDJVOptions(&DjvOptions,sizeof(FILEDJVOPTIONS));

/*Change Resolution */
DjvOptions. nResolution = 120;

/* Set new DJV option */
L_SetDJVOptions(&DjvOptions);

/* Now load the DJV file */
L_LoadBitmap(pszDJVFileName, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);
}


L_SetExtFileOption

This function has been removed. Now, the load/save functions take a new, optional parameter for the extended load/save options.

The following functions now take an optional pLOADFILEOPTION argument:

L_AnnLoad

L_AnnLoadOffset

L_AnnLoadMemory

L_DecompressBitmapMemory

L_DecompressMemory

L_ReadLoadResolutions

L_ReadFileTransforms

L_FileInfo

L_FileInfoMemory

L_GetCompressFileStamp

L_GetLoadResolution

L_GetFileCommentSize

L_LoadBitmap

L_LoadBitmapList

L_LoadBitmapMemory

L_LoadFile

L_LoadFileTile

L_LoadFileOffset

L_LoadMemory

L_ReadFileComment

L_ReadFileCommentExt

L_ReadFileCommentMemory

L_ReadFileTag

L_ReadFileTagMemory

L_ReadFileStamp

L_StartFeedLoad

L_FileConvert

The following functions now take an optional pSAVEFILEOPTION argument:

L_FileConvert

L_CompressBitmapWithStamp

L_DeletePage

L_WriteFileTransforms

L_SaveBitmap

L_SaveBitmapList

L_SaveBitmapMemory

L_SaveFile

L_SaveFileMemory

L_SaveFileTile

L_SaveFileOffset

L_StartCompressBuffer

L_WriteFileCommentExt

L_WriteFileStamp

See Also

Functions:

L_GetDefaultLoadFileOption, L_GetDefaultSaveFileOption


L_SetGeoKey

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetGeoKey (uTag, uType, uCount, pData);

L_UINT16 uTag; | /* GeoKey ID */
L_UINT uType; | /* GeoKey type */
L_UINT uCount; | /* number of GeoKey values */
L_VOID L_FAR *pData; | /* pointer to GeoKey data */

Sets the GeoKey data to be saved in a file.

Parameter | Description
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
uType | The type of GeoKey to set. This indicates whether the data pointed to by pData is SHORT, DOUBLE or ASCII. Possible values are:
 | Value | Meaning
 | TAG_ASCII | [2] The data pointed to by pData is an array of ASCII bytes.
 | TAG_SHORT | [3] The data pointed to by pData is an array of SHORT values (2 bytes each).
 | TAG_DOUBLE | [12] The data pointed to by pData is an array of floating points in DOUBLE format (8 bytes each).
uCount | The number of items in the pData buffer. Note that this doesn't describe the number of bytes. The number of bytes is uCount * number of bytes per value (1 for ASCII, 2 for SHORT, 8 for DOUBLE).
pData | Pointer to a buffer that contains the GeoKey data. If the pData passed as NULL, the GeoKey data associated with uTag will be cleared; and the uType and uCount parameters will be ignored.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function copies the data pointed to by pData into an internal list of buffers maintained by LTFIL. The user is responsible for freeing the buffer pointed to by pData after calling this function.

Any GeoTIFF file that you save will include the GeoKey data set until you clear the GeoKey data. To save this data to a file, save FILE_GEOTIFF files.

To clear a particular GeoKey, call L_SetGeoKey(uTag, 0, 0, NULL).

To clear all the GeoKeys, call L_SetGeoKey(0, 0, 0, NULL).

The data set will be saved in the files into 3 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.

L_SetGeoKey will overwrite any values saved for these tags previously using L_SetTag.

For more information on the various GeoKey values and for links to the GeoTIFF specification, refer to Implementing GeoKeys (GeoTIFF tags).

You can get the last value set with L_SetGeoKey by using L_GetGeoKey.

To write the GeoKey data directly to an existing file, call L_WriteFileGeoKey.

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.

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetGeoKey, L_WriteFileGeoKey, L_ReadFileGeoKey, L_EnumFileGeoKeys, L_SaveFile, L_SaveBitmap
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

/* This example sets the GTModelTypeGeoKey key to the Project Coordination System value */
L_UINT16 uProjectCoordinationSystem = 1;

L_SetGeoKey(1024, TAG_SHORT, 1, &uProjectCoordinationSystem);
/* Every GeoTIFF file I save from now on will contain this GeoKey */


L_SetICCCMMType

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCCMMType(pICCProfile, nCMMType)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccSignature nCMMType; | /* CMM type value */

Sets the Color Management Module (CMM) type of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the CMM type.
nCMMType | Integer value that represents the CMM type to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets the preferred Color Management Module (CMM) type. If this field is used, it must match a CMM type signature registered in the ICC registry. The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The CMM type is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the CMM type and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCColorSpace

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCColorSpace(pICCProfile, uColorSpace)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCCOLORSPACE uColorSpace; | /* color space value */

Sets the color space signature of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the color space.
uColorSpace | A value that represents the color space to set for the ICC profile. For a list of possible values, refer to ICCCOLORSPACE.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The color space signature is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the color space signature and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCConnectionSpace

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCConnectionSpace(pICCProfile, uPCS)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCCOLORSPACE uPCS; | /* connection space value */

Sets the color space of the profile connection space for the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the profile connection space.
uPCS | A value that represents the color space to set for the profile connection space. For a list of possible values, refer to ICCCOLORSPACE.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For all profile classes, other than the device link profile, the profile connection space (PCS) is either xyz or lab color space, and the signature is defined in ICCCOLORSPACE. When the device class is a device link profile, the value of the PCS is the appropriate color space from ICCCOLORSPACE.

The color space of the profile connection space is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the color space of the profile connection space and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCCreator

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCCreator(pICCProfile, nCreator)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccInt32Number nCreator; | /* profile creator value */

Sets the creator of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the creator value.
nCreator | A value that identifies the creator of the ICC profile.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets the creator field of the ICC profile. If this field is used, it must match the signature contained in the device manufacturer section of the ICC signature registry found at (www.color.org). If not used this field shall be set to zero.

The creator is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the creator and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDateTime

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCDateTime(pICCProfile, Time)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pICC_DATE_TIME_NUMBER Time; | /* pointer to a structure */

Sets the date and time at which the ICC profile was created.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the creator value.
Time | Pointer to an ICC_DATE_TIME_NUMBER structure that contains the date and time at which the ICC profile was created.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The date and time values are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the date and time and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDeviceAttributes

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCDeviceAttributes(pICCProfile, uAttributes)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt64Number uAttributes; | /* profile attributes value */

Sets the device attributes for the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the device attributes.
uAttributes | Flags that identify attributes unique to a particular device. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate the transparency of the media:
 | Value | Meaning
 | ICC_REFLECTIVE | [0x0000000000000000] Reflective media
 | ICC_TRANSPARENCY | [0x0000000000000001] Transparent media
 | The following flags indicate if the media is glossy or matte:
 | Value | Meaning
 | ICC_GLOSSY | [0x0000000000000000] Glossy media
 | ICC_MATTE | [0x0000000000000002] Matte media

The following flags indicate media polarity:
Value | Meaning
ICC_MEDIA_POLARITY_POSITIVE | [0x0000000000000000] Positive media polarity
ICC_MEDIA_POLARITY_NEGATIVE | [0x0000000000000004] Negative media polarity
The following flags indicate if the media is colored:
Value | Meaning
ICC_COLOR_MEDIA | [0x0000000000000000] Color media
ICC_BLACK_AND_WHITE | [0x0000000000000008] Black and white media

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The device attributes are unique to a particular device setup.

Note that these attributes describe the media itself, not the data in the ICC profile. For example, a profile for a color scanner that has been loaded with black and white film will have the attribute ICC_BLACK_AND_WHITE, regardless of the value in the data color space field.

The device attributes are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device attributes and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDeviceClass

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCDeviceClass(pICCProfile, uDevClassSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCPROFILECLASS uDevClassSig; | /* device class value */

Sets the device class of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the device class.
uDevClassSig | A value that represents the device class to set in the ICC profile. For a list of possible values, refer to ICCPROFILECLASS.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

There are three basic classes of device profiles: Input, Display and Output profiles. In addition to the three basic device profile classes, four additional color processing profiles are defined. These profiles provide a standard implementation for use by the CMM in general color processing, or for the convenience of CMMs, which may use these types to store calculated transforms. These four additional profile classes are DeviceLink, ColorSpace Conversion, Abstract, and Named color profiles.

The Device class is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the Device class and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDevManufacturer

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCDevManufacturer(pICCProfile, nDevManufacturer)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccInt32Number nDevManufacturer; | /* device manufacturer value */

Sets the device manufacturer value of the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the device manufacturer value.
nDevManufacturer | Integer value that represents the device manufacturer to set for the ICC profile.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets the device manufacturer field of the ICC profile. If this field is used, it must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used this field is set to zero.

The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The device manufacturer is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device manufacturer and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDevModel

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCDevModel(pICCProfile, uDevModel)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt32Number uDevModel; | /* device model value */

Sets the device model for the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the device model value.
uDevModel | Value that represents the device model to set for the ICC profile.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets the device model field of the ICC profile. If this field is used, it must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used this field is set to zero.

The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The device model is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device model and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCFlags

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCFlags(pICCProfile, uFlags)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt32Number uFlags; | /* flags value */

Sets the flags of the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the flags.
uFlags | Flags that indicate if the ICC profile is embedded, and if the ICC profile can be used independently from the embedded color data. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate if the ICC profile is embedded:
 | Value | Meaning
 | ICC_EMBEDDED_PROFILE_FALSE | [0x00000000] ICC profile is not embedded
 | ICC_EMBEDDED_PROFILE_TRUE | [0x00000001] ICC profile is embedded
 | The following flags indicate if the ICC profile can be used independently from the embedded color data:
 | Value | Meaning
 | ICC_USE_ANYWHERE | [0x00000000] ICC profile can be used independently
 | ICC_USE_WITH_EMBEDDED_DATA_ONLY | [0x00000002] ICC profile cannot be used independently

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The profile flags also determine how the CMM handles other factors such as distributed processing and caching options.

The flags are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the flags and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCPrimaryPlatform

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCPrimaryPlatform(pICCProfile, uPrimPlatform)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCPLATFORMSIGNATURE uPrimPlatform; | /* primary platform value */

Sets the primary platform for the ICC Profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the primary platform.
uPrimPlatform | A value that represents the primary platform to set for the ICC profile. For a list of possible values, refer to ICCPLATFORMSIGNATURE.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sets the primary platform/operating system framework for which the profile was created. If there is no primary platform identified, this field is set to NOPLATFORM.

The primary platform is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the primary platform and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCRenderingIntent

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCRenderingIntent(pICCProfile, uRenderingIntent)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCRENDERINGINTENT uRenderingIntent; | /* rendering intent value */

Sets the rendering intent of an ICC profile.

Parameter | Description
pICCProfile | Pointer to ICCPROFILEEXT structure whose rendering intent value will be set.
uRenderingIntent | A value that indicates the rendering intent. For a list of possible values, refer to ICCRENDERINGINTENT.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The value set using this function specifies the rendering intent used when this profile combines with another profile. In a sequence of more than two profiles, it applies to the combination of this profile and the next profile in the sequence and not to the entire sequence. Typically, the user or application will set the rendering intent dynamically at runtime or embedding time. Therefore, this flag may not have any meaning until the profile is used in some context, e.g. in a device link or an embedded source profile.

The rendering intent is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the rendering intent and the other header information to the default values.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile, L_InitICCProfile, L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCTagData

#include "ltkrn.h"
#include "ltclr.h"

L_INT EXT_FUNCTION L_SetICCTagData(pICCProfile, pTagData, uTagSig, uTagTypeSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR L_FAR * pTagData; | /* pointer to a buffer containing data */
L_UINT32 uTagSig; | /* a value that indicates the tag signature */
L_UINT32 uTagTypeSig; | /* a value that indicates the tag type signature */

Sets a tag inside the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure in which to set the tag.
pTagData | Pointer to a buffer that contains the tag data.
uTagSig | A value that indicates the signature of the tag to be created. Possible values include private tags and the values listed in ICCTAGSIGNATURE. Signatures of private tags must be registered with the ICC.
uTagTypeSig | A value that indicates the signature of the tag type used for creating the tag. Possible values include private tag type signatures and the values listed in ICCTAGTYPESIGNATURE. Signatures of private tag types must be registered with the ICC.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The pTagData pointer should be a pointer to a structure that contains all the data required for the tag to be created. This structure should be of the same type as the ICC tag type required for the tag to be created. In case of a private tag type, the pTagData must point to a structure of type ICCTAG_UNKNOWN_TYPE.

If only the tag is private, this function returns ERROR_ICC_UNKNOWN_TAG. If only the tag type is private, this function returns ERROR_ICC_UNKNOWN_TYPE. If both the tag and the type are private, this function returns ERROR_ICC_UNKNOWN_TAG_AND_TYPE. In all three of these cases however, the tag is set correctly in the ICC profile.

To add multiple tags to a profile, call this function repeatedly. Each subsequent tag added is appended to the list of tags pointed to by the pTagData member of the ICC profile structure.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FreeICCProfile , L_InitICCProfile , L_LoadICCProfile , L_InitICCProfileExt , L_FreeICCProfileExt , L_SaveICCProfile , L_LoadICCProfileExt , L_FillICCProfileStructure , L_FillICCProfileFromICCFile , L_InitICCHeader , L_SetICCCMMType , L_SetICCDeviceClass , L_SetICCColorSpace , L_SetICCConnectionSpace , L_SetICCPrimaryPlatform , L_SetICCFlags , L_SetICCDevManufacturer , L_SetICCDevModel , L_SetICCDeviceAttributes , L_SetICCRenderingIntent , L_SetICCCreator , L_SetICCDateTime , L_2bFixed2bNumberToDouble , L_DoubleTo2bFixed2bNumber , L_GetICCTagData , L_CreateICCTagData , L_DeleteICCTag , L_GenerateICCFile , L_GenerateICCPointer , L_GetICCTagTypeSig , L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

/* This example will create an ICC profile, and then create a tag, and then set it into the ICC profile, finally, it will free the profile */
ICCPROFILEEXT iccProfile;
SYSTEMTIME systemTime;
ICCTAG_DATE_TIME_TYPE iccDateTimeType;
// initializing the ICC profile
L_InitICCProfileExt (&iccProfile, sizeof(ICCPROFILEEXT));
// preparing the structure
GetSystemDate(&systemTime);
IccDateTimeType.DateTime.uYear = SystemTime.wYear;
IccDateTimeType.DateTime.uMonth = SystemTime.wMonth;
IccDateTimeType.DateTime.uDay = SystemTime.wDay;
IccDateTimeType.DateTime.uHours = SystemTime.wHour;
IccDateTimeType.DateTime.uMinutes = SystemTime.wMinute;
IccDateTimeType.DateTime.uSeconds = SystemTime.wSecond;
// setting the tag inside the ICC profile
L_SetICCTagData(&iccProfile, (L_UCHAR L_FAR *) &iccDateTimeType, CALIBRATIONDATETIMETAG, DATETIMETYPESIG);
// free the ICC profile
L_FreeICCProfileExt (&iccProfile);


L_SetJ2KOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetJ2KOptions(pOptions)

pFILEJ2KOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when saving J2K or JP2 files.

Parameter | Description
pOptions | Pointer to a structure that contains the options to use when loading J2K or JP2 files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The nSize member of the FILEJ2KOPTIONS structure must be set before calling this function.

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetJ2KOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing JPEG 2000 Plug in Features

Example

// This example will make it so the next time you save
// a JPEG2000 or enhanced CMP file, it will be
// saved with a 100:1 compression ratio

FILEJ2KOPTIONS J2KOptions;

// get the current values. I only want to change the
// compression ratio
L_GetJ2KOptions( &J2KOptions, sizeof(FILEJ2KOPTIONS));

// set the compression control to make sure we will be
// using the compression control
J2KOptions.uCompressionControl = J2K_COMPRESSION_RATIO;

// set the compression ratio to 100
J2KOptions.fCompressionRatio = 100.0f;

// set the compression options. The next time I save a
// JPEG2000 file, it will be saved with 100:1 compression ratio
L_SetJ2KOptions(&J2KOptions);


L_SetJBIG2Options

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetJBIG2Options(pOptions)

pFILEJBIG2OPTIONS pOptions;

/* pointer to a FILEJBIG2OPTIONS structure */

Sets the file options used by LEADTOOLS for saving JBIG2 files.

Parameter | Description
pOptions | Pointer to the FILEJBIG2OPTIONS structure that contains the options to be used for saving JBIG2 files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILEJBIG2OPTIONS structure must be set before calling this function.

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

LTFIL

File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetJBIG2Options
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

// This example will make it so the next time you save
// a JBIG2 file, it will be saved with Template #3

FILEJBIG2OPTIONS JBIG2Options;

// get the current values. I only want to change the
// template
L_GetJBIG2Options( &JBIG2Options, sizeof(FILEJBIG2OPTIONS));

// set the template value to 3
JBIG2Options. ucTemplateType = 3;

// set the compression options. The next time I save a
// JBIG2 file, it will be saved with template # 3
L_SetJBIG2Options(&JBIG2Options);


L_SetKaufmannRgnBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetKaufmannRgnBitmap(pBitmap, pKaufmannProcBitmap, nRadius, nMinInput, nMaxInput, nRgnThreshold, ptRgnStart, bRemoveHoles, puPixelsCount, uCombineMode);

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
pBITMAPHANDLE pKaufmannProcBitmap; | /* pointer to the processed bitmap handle */
L_INT nRadius; | /* blur radius */
L_INT nMinInput; | /* minimum leveling input */
L_INT nMaxInput; | /* maximum leveling input */
L_INT nRgnThreshold; | /* region threshold */
POINT ptRgnStart; | /* region starting point */
L_BOOL bRemoveHoles; | /* flag that indicates whether to remove holes */
L_UINT32 L_FAR * puPixelsCount; | /* pointer to a variable to be updated */
L_UINT uCombineMode; | /* action to take regarding the existing region */

Sets a Kaufmann region based on the color value at the specified point. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap.
pKaufmannProcBitmap | Pointer to a bitmap handle to be updated with the bitmap resulting from this function. This bitmap handle must be empty when this function is called. If this bitmap handle is not empty when this function is called, the function will return an error.
nRadius | Value that indicates the size of the neighborhood used for blurring each pixel of the bitmap. Blurring is performed internally to enhance the resulting image.
nMinInput | Value that specifies the image’s shadows to be mapped. This value is used internally to enhance the image prior to growing the region. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.
nMaxInput | Value that specifies the image’s highlights to be mapped. This value is used internally to enhance the image prior to growing the region. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.
nRgnThreshold | Value that specifies the stopping point for the region. Valid values range from 0 to 255 for 8-bit, 0 to 4095 for 12-bit and 0 to 65535 for 16-bit images.
ptRgnStart | A POINT structure that contains the starting point used to set the region. This function determines the color value of the pixel at this point in the bitmap referenced by pBitmap. Using this color as a starting point and the value specified in nRgnThreshold as a stopping point, the function "grows" a region.
bRemoveHoles | A flag that indicates whether to remove any holes present in the region that’s created internally. These holes are located inside the region, but are not included in the region. Possible values are:
 | Value | Meaning
 | TRUE | Remove the region holes.
 | FALSE | Don’t remove the region holes.
puPixelsCount | Pointer to a variable to be updated with the number of pixels in the region created by this function.
uCombineMode | The action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function gets the color value of the point, specified in ptRgnStart, in the bitmap referenced in pBitmap. Using this color value as a starting point and the value specified in nRgnThreshold as an ending point, this function grows a region. Since noise affects the region growing process, enhancement procedures, such as Gaussian blur, are performed prior to obtaining the color from the specified point and growing the region, to improve the process. When this function returns, the pKaufmannProcBitmap contains the data from pBitmap, enhanced using the internal enhancing procedures, and the resulting region. This region is drawn on the image in pBitmap, but pBitmap itself is not changed. The area of the resulting region can be used to calculate the Kaufmann ratio (size of the corpus callosum / size of the brain sphere).

To calculate the Kaufmann ratio do the following:

1. | Call this function to create the first region, based on the appropriate area of the image. You will have to manipulate the parameters of the function to get the exact region you want. Save the puPixelCount value for this first region.
2. | Call the function once more to create a region for the second area. Save the puPixelCount value for this second region.
3. | Now calculate the ratio of the sizes of the two regions.

For more information on how to calculate the brain ratio refer to the example below.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetBitmapRgnColor, L_SetBitmapRgnEllipse, L_SetBitmapRgnPolygon, L_SetBitmapRgnRoundRect, L_SetBitmapRgnMagicWand, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_WindowLevel, L_HistoContrastBitmap, L_ColorLevelBitmap, L_GaussianFilterBitmap, L_HolesRemovalBitmapRgn
Topics: | Creating a Bitmap Region Raster Image Functions: Creating and Using a Region Raster Image Functions: Modifying Intensity Values

Example

L_VOID KaufmannVolumeAnalysis(HWND hWnd)
{
POINT pt;
L_UINT uFirstPixelCount;
L_UINT uSecondPixelCount;
L_UCHAR szText[20] = "\0";
BITMAPHANDLE Bitmap;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap("Image3.dic", &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);

pt.x = BITMAPWIDTH(&Bitmap) >> 1;
pt.y = BITMAPHEIGHT(&Bitmap) >> 1;

// Converting the bitmap into 8 bit gray scale bitmap
L_GrayScaleBitmap(&Bitmap, 8);

// apply the function in order to get the pixels count of the first region.
L_SetKaufmannRgnBitmap(&Bitmap, NULL, 21, 54, 110, 13, pt, FALSE, &uFirstPixelCount, L_RGN_SET);

// apply the function once more.
L_SetKaufmannRgnBitmap(&Bitmap, NULL, 29, 51, 229, 207, pt, TRUE, &uSecondPixelCount, L_RGN_SET);

// print the ratio between the first and the second region.
_gcvt(uFirstPixelCount * 1.0 / uSecondPixelCount, 3, szText);
MessageBox(hWnd, szText, "Ratio", MB_OK);
}


L_SetLoadInfoCallback

#include "l_bitmap.h"

LOADINFOCALLBACK EXT_FUNCTION L_SetLoadInfoCallback(pfnCallback, pUserData)

LOADINFOCALLBACK pfnCallback; | /* your callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Specifies a callback function for handling input data that is in an undetermined format. This function can be used for loading raw FAX data (CCITT Group 3 or Group 4), raw run-length-encoded data (4-bit or 8-bit), raw Bitfield compressed data, raw PackBits compressed data or raw uncompressed data.

Parameter | Description
pfnCallback | Your callback function that supplies the information that LEADTOOLS needs when loading an image from a file. The callback function must adhere to the syntax specified in LOADINFOCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

Pointer to the previous function used to supply information about the file. You can assign this return value to a variable, then use the variable to restore the normal behavior.

Comments

To load a raw fax file, you must provide a LOADINFOCALLBACK by calling L_SetLoadInfoCallback. If you recognize the file and you know the height and width of the file, set LOADINFO.Width and LOADINFO.Height to a positive value. To automatically detect the width and height of the fax file, set LOADINFO.Width and LOADINFO.Height to -1.

To load raw uncompressed data, you must provide a LOADINFOCALLBACK by calling L_SetLoadInfoCallback. Set the LOADINFO.Format field to FILE_RAW. Valid values must also be set for the following LOADINFO fields: Width, Height, BitsPerPixel, Offset (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 LOADINFO.Flags field. Include an orientation flag in the LOADINFO.Flags field to load 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 (2BitsPerPixel) entries of the rgbQuad field.

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.

To supply the needed information, refer to the LOADINFO structure description.

Note:

More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment, L_GetLoadInfoCallbackData
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For complete sample code, refer to the UTIL.C module of the DEMO example.

typedef struct _MYDATA
{
L_INT nWidth;
L_INT nHeight;
}MYDATA;

BITMAPHANDLE LEADBitmap; /* Bitmap handle to hold the loaded image */

/* This LOADINFOCALLBACK function provides information for a raw fax
file. This example uses hard-coded and saved information. Your application
probably would get the information in some other way. */
/****************************************************************************************/
L_INT L_EXPORT EXT_CALLBACK LoadInfoCallBack( L_INT fd, pLOADINFO pInfo, L_VOID L_FAR *pUserData )
{
MYDATA L_FAR *pData = (MYDATA L_FAR*)pUserData;
UNREFERENCED_PARAMETER(fd);

/* Set the LOADINFO structure's fields */
pInfo->BitsPerPixel = 1;
pInfo->Flags = LOADINFO_TOPLEFT;
pInfo->Format = FILE_FAX_G3_2D;
pInfo->Height = pData->nHeight; /* Value set before we created the file */
pInfo->Width = pData->nWidth; /* Value set before we created the file */
pInfo->Offset = 0;
return SUCCESS;
}

/****************************************************************************************/
void TestFunction(HWND hWnd)
{
LOADINFOCALLBACK pfnSavedCallback; /* Temporary copy of the current callback */
L_VOID L_FAR *pSavedUserData; /* Temporary copy of the current user data */
MYDATA MyData;

MyData.nWidth = LEADBitmap.Width;
MyData.nHeight = LEADBitmap.Height;

/* Set the callback function for loading unknown files.*/
pSavedUserData = L_GetLoadInfoCallbackData(); /* get the current user data */
pfnSavedCallback = L_SetLoadInfoCallback(LoadInfoCallBack, (L_VOID L_FAR*)&MyData);

/* Make the current image look OK as a 1-bit image */
L_HalfToneBitmap(&LEADBitmap, HT_VIEW, 45, 0, NULL);
/* Save the image as raw FAX. */
L_SaveBitmap(TEXT("d:\\temp\\TMP.TIF"), &LEADBitmap, FILE_FAX_G3_2D, 1, 0, NULL);
/* Free the bitmap */
L_FreeBitmap(&LEADBitmap);

/* Load the bitmap that we just saved.
Format information will be supplied by the LOADINFOCALLBACK function. */
L_LoadBitmap (TEXT("d:\\temp\\TMP.TIF"), &LEADBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Return the LOADINFOCALLBACK function to its saved value */
L_SetLoadInfoCallback(pfnSavedCallback, pSavedUserData);
/* Get a new palette as the paint palette because we are now using 1-bit */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return;
}


L_SetLoadResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetLoadResolution(nFormat, nWidth, nHeight)

L_INT nFormat; | /* file format */
L_UINT32 nWidth; | /* width of the bitmap to load */
L_UINT32 nHeight; | /* height of the bitmap to load */

Specifies the physical resolution (width and height) of the FlashPix, PhotoCD, or JBIG file to load.

Parameter

Description

nFormat

File format. The following are possible values:

Value

Meaning

FILE_PCD

[57] Kodak PhotoCD

FILE_FPX

[80] Kodak FlashPix

FILE_JBIG

[115] JBIG

FILE_JP2

[163] JPEG 2000. This file format contains image data and extra information about the contents and organization of the file.

FILE_J2K

[164] JPEG 2000. This file format contains only a stream of image data.

FILE_CMW

[165] Wavelet CMP.

nWidth

Width of the bitmap to load. You can pass 0 to get the default.

nHeight

Height of the bitmap to load. You can pass 0 to get the default.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 L_ReadLoadResolutions function.

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 L_ReadLoadResolutions function.

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 L_ReadLoadResolutions function.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadLoadResolutions, L_GetLoadResolution, L_2DGetViewMode L_2dGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing PhotoCD and FlashPix Features
 | Implementing JBIG Features

Example

For an example, refer to L_ReadLoadResolutions.


L_SetMagGlassOwnerDrawCallback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMagGlassOwnerDrawCallback (hWnd, pfnCallback, pUserData)

HWND hWnd; | /* handle to a window */
MAGGLASSOWNERDRAWCALLBACK pfnCallback; | /* callback function to set */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Sets a callback function, which lets the user provide custom magnifying glass rendering.

Parameter | Description
hWnd | Handle of the window to which the magnifying glass is attached.
pfnCallback | Callback function which be called every time the Magnifying Glass needs to be repainted.
 | The callback function must adhere to the function prototype described in MAGGLASSOWNERDRAWCALLBACK function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If a user-defined callback function is set by calling L_SetMagGlassOwnerDrawCallback, then after L_StartMagGlass 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 user-defined callback function. This allows the user to provide custom rendering of the Magnifying Glass. 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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_UpdateMagGlassShape, L_UpdateMagGlass, MAGGLASSOWNERDRAWCALLBACK, L_SetMagGlassPaintOptions, L_ShowMagGlass, L_SetMagGlassPos, L_UpdateMagGlassBitmap, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

/* NOTE, this is NOT a complete example!
This is an excerpt from the ANNOTATION Demo program.
For the complete code, refer to ANNOTATE.C. */

typedef struct _CHILDDATA
{
int cxClient; /* width of client area */
int cyClient; /* height of client area */
int nHScrollPos; /* x scroll position */
int nVScrollPos; /* y scroll position */
int nHScrollMax; /* maximum x scroll position */
int nVScrollMax; /* maximum y scroll postion */
int nHScrollStep; /* x scroll step value */
int nVScrollStep; /* y scroll step value */
BOOL bThumbTrack;
BOOL fFitImage;
int nZoom;
RECT rcView;
RECT rcClient;
RECT rcWindow;
BITMAPHANDLE Bitmap;
HPALETTE hPalette;
HANNOBJECT hContainer;
HANNOBJECT hAutomation;
BOOL fInScroll;
BOOL fShowLock;
HANNOBJECT hRect;
HANNOBJECT hEllipse;
BOOL fCapture;
BOOL fLeftButtonDown;
POINT pt0;
BOOL bMagGlass;
L_INT nMagWidth;
L_INT nMagHeight;
L_INT nMagZoom;
L_BOOL bDoubleBuffer;
L_HANDLE hDoubleBuffer;
} CHILDDATA, FAR *LPCHILDDATA;

static void MyStartMagGlass(HWND hwnd, LPCHILDDATA pData)
{
MAGGLASSOPTIONS Options;

L_AnnSetActiveState(pData->hAutomation, ANNACTIVE_DISABLED);

pData->nMagWidth = 200;
pData->nMagHeight = 200;
pData->nMagZoom = 200;

Options.uStructSize = sizeof(MAGGLASSOPTIONS);
Options.nWidth = pData->nMagWidth;
Options.nHeight = pData->nMagHeight;
Options.nZoom = pData->nMagZoom;
Options.clrPen = RGB(0,0,0);
Options.hMagCursor = NULL;
Options.clrBack = RGB(128,128,128);
Options.bEllipse = FALSE;
Options.nBorderSize = 1;
Options.b3D = FALSE;
Options.uPaintFlags = 0;
Options.pMask = NULL;
Options.uMaskCount = 0;
Options.uMagGlassFlags = CROSSHAIR_FINE;
Options.nCrosshair = 1;
Options.bIgnoreRgn = TRUE;
Options.bCenter = TRUE;

L_StartMagGlass(
hwnd,
&pData->Bitmap,
&pData->rcView,
&Options,
NULL,
pData);

L_SetMagGlassOwnerDrawCallback(hwnd, MagGlassOwnerDrawCallback, pData);

pData->bMagGlass = TRUE;
}

L_INT L_EXPORT L_FAR MagGlassOwnerDrawCallback(HWND hWnd,
HDC hMemDC,
L_INT32 nXPos,
L_INT32 nYPos,
LPRECT pMagGlass,
L_VOID L_FAR *pUserData)
{
LPCHILDDATA pData = (LPCHILDDATA) pUserData;
L_DOUBLE OffsetXOld, OffsetYOld;
L_DOUBLE OffsetX, OffsetY;
L_DOUBLE ScalarXOld, ScalarYOld;
L_DOUBLE ScalarX, ScalarY;
L_DOUBLE MagCenterX, MagCenterY;
L_DOUBLE BitmapX, BitmapY;
L_DOUBLE MagDestX, MagDestY;
RECT rc;

L_AnnPushFixedState(pData->hContainer, ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);

L_AnnGetOffsetX(pData->hContainer, &OffsetXOld);
L_AnnGetOffsetY(pData->hContainer, &OffsetYOld);
L_AnnGetScalarX(pData->hContainer, &ScalarXOld);
L_AnnGetScalarY(pData->hContainer, &ScalarYOld);

MagCenterX = nXPos;
MagCenterY = nYPos;

BitmapX = (L_DOUBLE)(MagCenterX-pData->rcView.left)/((L_DOUBLE)RECTWIDTH(&pData->rcView) /(L_DOUBLE)BITMAPWIDTH(&pData->Bitmap));
BitmapY = (L_DOUBLE)(MagCenterY-pData->rcView.top) /((L_DOUBLE)RECTHEIGHT(&pData->rcView)/(L_DOUBLE)BITMAPHEIGHT(&pData->Bitmap));

MagDestX = BitmapX * ((L_DOUBLE)RECTWIDTH(&pData->rcView) /(L_DOUBLE)BITMAPWIDTH(&pData->Bitmap)) * ((L_DOUBLE)pData->nMagZoom/100.0f);
MagDestY = BitmapY * ((L_DOUBLE)RECTHEIGHT(&pData->rcView)/(L_DOUBLE)BITMAPHEIGHT(&pData->Bitmap)) * ((L_DOUBLE)pData->nMagZoom/100.0f);

OffsetX = ((L_DOUBLE)RECTWIDTH(pMagGlass) /2.0f) - MagDestX;
OffsetY = ((L_DOUBLE)RECTHEIGHT(pMagGlass)/2.0f) - MagDestY;

ScalarX = (L_DOUBLE)RECTWIDTH(&pData->rcView) / (L_DOUBLE)BITMAPWIDTH(&pData->Bitmap) * ((L_DOUBLE)pData->nMagZoom/100.0f);
ScalarY = (L_DOUBLE)RECTHEIGHT(&pData->rcView) / (L_DOUBLE)BITMAPHEIGHT(&pData->Bitmap) * ((L_DOUBLE)pData->nMagZoom/100.0f);

L_AnnSetOffsetX(pData->hContainer, OffsetX, ANNFLAG_NOINVALIDATE);
L_AnnSetOffsetY(pData->hContainer, OffsetY, ANNFLAG_NOINVALIDATE);
L_AnnSetScalarX(pData->hContainer, ScalarX, ANNFLAG_NOINVALIDATE);
L_AnnSetScalarY(pData->hContainer, ScalarY, ANNFLAG_NOINVALIDATE);

SetRect(&rc, 0, 0, pData->nMagWidth, pData->nMagHeight);
L_AnnDraw(hMemDC, &rc, pData->hContainer);

L_AnnSetOffsetX(pData->hContainer, OffsetXOld, ANNFLAG_NOINVALIDATE);
L_AnnSetOffsetY(pData->hContainer, OffsetYOld, ANNFLAG_NOINVALIDATE);
L_AnnSetScalarX(pData->hContainer, ScalarXOld, ANNFLAG_NOINVALIDATE);
L_AnnSetScalarY(pData->hContainer, ScalarYOld, ANNFLAG_NOINVALIDATE);

L_AnnPopFixedState(pData->hContainer, ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);

return SUCCESS;
}


L_SetMagGlassPaintOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMagGlassPaintOptions(hWnd, pMagGlassPaintOptions)

HWND hWnd; | /* handle to a window */
pMAGGLASSPAINTOPTIONS pMagGlassPaintOptions; | /* pointer to a structure */

Sets the Magnifying Glass paint options.

Parameter | Description
hWnd | Handle of the window to which the magnifying glass is attached.
pMagGlassPaintOptions | Pointer to a structure that contains the new magnifying glass paint options to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function is used to set the magnifying glass paint options (Intensity, Contrast and Gamma). Those paint options will be used when the magnifying glass paints the zoomed area, so you will see this area with some extra contrast or intensity.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StartMagGlass, L_StopMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

/* This example starts the Magnifying Glass then calls L_SetMagGlassPaintOptions function to set the Magnifying Glass paint options. */
L_VOID StartMagnifyingGlass(HWND hWnd, pBITMAPHANDLE pBitmap, RECT* prcView)
{
L_INT nRet;
L_TCHAR szMsg[256]=TEXT("");
MAGGLASSPAINTOPTIONS MagGlassPntOptions;
MAGGLASSOPTIONS MagGlassOpt;

// Starting the Magnifying Glass
memset(&MagGlassOpt, 0, sizeof(MAGGLASSOPTIONS));
MagGlassOpt.uStructSize = sizeof (MAGGLASSOPTIONS);
MagGlassOpt.nWidth = 100;
MagGlassOpt.nHeight = 100;
MagGlassOpt.nZoom = 400;
MagGlassOpt.clrPen = RGB(255,0,0);
MagGlassOpt.hMagCursor = NULL;
MagGlassOpt.clrBack = RGB(128,128,128);
MagGlassOpt.bEllipse = FALSE;
MagGlassOpt.nBorderSize = 1;
MagGlassOpt.b3D = TRUE;
MagGlassOpt.uPaintFlags = 0;
MagGlassOpt.pMask = NULL;
MagGlassOpt.uMaskCount = 0;
MagGlassOpt.nCrosshair = CROSSHAIR_FINE;
MagGlassOpt.bIgnoreRgn = TRUE;
MagGlassOpt.bCenter = TRUE;

nRet = L_StartMagGlass(hWnd, pBitmap, prcView, &MagGlassOpt, NULL, NULL);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Starting the Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
return;
}

// Setting the Magnifying Glass Paint contrast, gamma and intensity
MagGlassPntOptions.uStructSize = sizeof(MAGGLASSPAINTOPTIONS);
MagGlassPntOptions.nContrast = 100;
MagGlassPntOptions.nGamma = 100;
MagGlassPntOptions.nIntensity = 100;

nRet = L_SetMagGlassPaintOptions(hWnd, &MagGlassPntOptions);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Setting the Magnifying Glass painting options, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
}
}


L_SetMagGlassPos

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMagGlassPos(hWnd, nXPos, nYPos)

HWND hWnd; | /* handle to a window */
L_INT nXPos; | /* the new x position of the Magnifying Glass */
L_INT nYPos; | /* the new y position of the Magnifying Glass */

Moves the magnifying glass to the specified position on the screen.

Parameter | Description
hWnd | Handle of the window to which the magnifying glass is attached.
nXPos | The x-coordinate of the new position of the magnifying glass.
nYPos | The y-coordinate of the new position of the magnifying glass.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function is used to move the magnifying glass to the position, specified by (x,y), on the screen. Since the user is responsible for displaying the magnifying glass and moving it on the screen in a manual update, this function is used in conjunction with the L_ShowMagGlass function.

If the magnifying glass is displayed, this function will move the magnifying glass to the specified (x,y) position and it will be displayed there. Iif the magnifying glass was hidden, this function will move the magnifying glass to the specified position without displaying it.

This function can be called in the MouseMove message to control the position of the magnifying glass.

Note:

This function can be used only if the MAGGLASS_MANUAL_UPDATE flag was set when calling L_StartMagGlass function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_ShowMagGlass, L_UpdateMagGlassBitmap, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_ShowMagGlass.


L_SetMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMarkers(hMarkers, uFlags)

HANDLE hMarkers; | /* marker handle */
L_UINT uFlags; | /* flags that determine function behavior */

Sets the metadata markers to be used in the current thread.

Parameter | Description
hMarkers | Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function. This handle can reference Exif and/or GPS comments, a small Exif stamp, a bigger wireless stamp, audio data and whatever else was in the original file.
 | The markers referenced by this handle will replace the markers previously set using L_SetMarkers.
 | Pass NULL to clear any markers previously set by L_SetMarkers.
uFlags | Reserved for future use. Pass 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

All save operations performed in this thread will use these markers until L_SetMarkers is called again.

A copy of these markers will be used, so you can delete hMarkers when L_SetMarkers returns.

Comments set with L_SetComment will take precedence over any comments contained in the markers.

Tags set with L_SetTag will take precedence over any user-defined tags contained in the markers.

If the L_SaveXXX function 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.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CreateMarkers, L_LoadMarkers, L_SaveBitmap, L_SaveBitmapBuffer, L_SaveBitmapList, L_SaveBitmapMemory, L_SaveBitmapWithLayers, L_SaveFile, L_SaveFileBuffer, L_SaveFileMemory, L_SaveFileOffset, L_SaveFileTile
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

This example lets you modify a file and preserve all its metadata, comments and audio. Keep in mind this will not save any stamp. If you want to save a stamp, modify the L_SaveBitmap call and tell it to save a stamp. That will make L_SaveBitmap regenerate a new stamp so it matches the modified image.

L_VOID SetMarkers( L_TCHAR L_FAR* pszFile )

{

HANDLE hMetadata;

BITMAPHANDLE Bitmap;

// load metadata info
L_LoadMarkers (pszFile, &hMetadata, 0);

// load the bitmap
L_LoadBitmap(pszFile, &Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);

// modify the bitmap. In this case, flip it
L_FlipBitmap (&Bitmap);

// set the metadata markers so they are used in the next save
L_SetMarkers(hMetadata, 0);

// save the file
L_SaveBitmap (TEXT("FlippedFile.jpg"), &Bitmap, FILE_EXIF_JPEG, 0, 50, NULL);

// reset the markers so they are not used for the next save
L_SetMarkers(NULL, 0);

// free memory containing the metadata
L_FreeMarkers (hMetadata);

}


L_SetMemoryThresholds

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMemoryThresholds(nTiledThreshold, nMaxConvSize, nTileSize, nConvTiles, nConvBuffers, uFlags);

L_INT nTiledThreshold; | /* minimum free memory for allocating conventional memory bitmaps */
L_INT nMaxConvSize; | /* maximum size for conventional bitmaps */
L_INT nTileSize; | /* size of the tile for tiled bitmaps */
L_INT nConvTiles; | /* maximum number of tiles which will reside in memory at one time */
L_INT nConvBuffers; | /* number of buffers in conventional memory that will cache the disk tiles */
L_UINT uFlags; | /* flags indicating which parameters are valid */

Sets the memory restrictions for allocating bitmaps.

Parameter | Description
nTiledThreshold | 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 parameter is > 0, it represents the required number of free bytes.
 | If the parameter 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 parameter 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 nTiledThreshold. When the amount of memory falls below nTiledThreshold, 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 parameter 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.
 | This parameter is ignored if uFlags does not contain MEM_TILEDTHRESHOLD.
nMaxConvSize | Maximum size for a conventional bitmap (default is 0x7FFFFFFF). Any bitmaps with a size bigger than this will be allocated as tiled.
 | If this parameter is >0, then it represents the maximum size in bytes.
 | If the parameter 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 uFlags does not contain MEM_MAXCONVSIZE.
nTileSize | The size of the tile for tiled bitmaps (default 0). Pass a value smaller than nMaxConvSize.
 | All bitmaps with a size smaller than nTileSize will be allocated as conventional. (A tiled bitmap of a size smaller than nTileSize would consist of only small tile, which is the equivalent of the conventional bitmap).
 | If nTileSize 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 parameter is ignored if uFlags does not contain MEM_TILESIZE.
nConvTiles | This 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 parameter 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 parameter represents the percentage of tiles that will reside in memory.
 | Values less than -100 are not allowed.
 | This parameter is ignored if uFlags does not contain MEM_CONVTILES.
nConvBuffers | This is used when working with tiled images which have disk tiles. It represents the number of buffers in conventional memory that will cache the 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 parameter specifies how many buffers should be used:
 | >0, nConvBuffers indicates the number of swap buffers
 | <0, -nConvBuffers 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.
uFlags | A combination of flags that indicates which of the threshold parameters are valid. The flags can be or-ed together to change only some of the flags, or you can pass MEM_ALL to change all flags. Possible values are:
 | Value | Meaning
 | MEM_TILEDTHRESHOLD | [0x0001] – nTiledThreshold is valid.
 | MEM_MAXCONVSIZE | [0x0002] – nMaxConvSize is valid
 | MEM_TILESIZE | [0x0004] – nTileSize is valid
 | MEM_CONVTILES | [0x0008] - nConvTiles is valid
 | MEM_CONVBUFFERS | [0x0010] – nConvBuffers is valid.
 | MEM_ALL | [0x001F] – all parameters are valid. You do not need to ‘or’ this with the other flags

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

These are global settings and apply to the current thread. They will apply to bitmaps created in this thread after this function is called.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetMemoryThresholds, L_GetBitmapMemoryInfo, L_SetBitmapMemoryInfo, L_SetTempDirectory, L_GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

/* Allocate tiled bitmaps when more than 75% of the computer memory is used, or for bitmaps larger than 100MB. */
L_SetMemoryThresholds(-25, 100 *1024 * 1024, 0, 0, 0, MEM_TILEDTHRESHOLD | MEM_MAXCONVSIZE);


L_SetOverlayAttributes

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetOverlayAttributes (pBitmap, nIndex, pOverlayAttributes, uFlags);

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_INT nIndex; | /* the overlay index */
pOVERLAYATTRIBUTES pOverlayAttributes; | /* pointer to the overlay attributes structure */
L_UINT uFlags; | /* flags that determine which attributes should be set */

Sets the overlay attributes for the overlay at the specified index. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay for which the attributes are being set. This index is zero-based.
pOverlayAttributes | Structure containing the overlay attributes to set.
uFlags | Flags that determine which overlay attributes to set. You can ‘or’ these flags. Possible values are:
 | Value | Meaning
 | OVERLAYATTRIBUTES_ORIGIN | [0x0001] The top-left position should be changed. pOverlayAttributes->ptOrigin contains the new top-left offset
 | OVERLAYATTRIBUTES_COLOR | [0x0002] Indicates the color should be changed. pOverlayAttributes->crColor contains the new color
 | OVERLAYATTRIBUTES_FLAGS | [0x0004] Indicates the flags should be changed. pOverlayAttributes->uFlags contains the new flags
 | OVERLAYATTRIBUTES_BITINDEX | [0x0008] Indicates the corresponding bitplane position should be changed. pOverlayAttributes->uBitPosition contains the new bitplane index.
 | OVERLAYATTRIBUTES_DICOM | [0x0010] Indicates that the DICOM-related attributes should be changed, this includes:
 |  | pOverlayAttributes->uRows,
 |  | pOverlayAttributes->uColumns,
 |  | pOverlayAttributes->szType,
 |  | pOverlayAttributes->uBitsAllocated,
 |  | pOverlayAttributes->szDescription,
 |  | pOverlayAttributes->szSubtype,
 |  | pOverlayAttributes->szLabel,
 |  | pOverlayAttributes->nROIArea,
 |  | pOverlayAttributes->fROIMean,
 |  | pOverlayAttributes->fROIStandardDeviation,
 |  | pOverlayAttributes->nNumFramesInOverlay,
 |  | pOverlayAttributes->uImageFrameOrigin,
 |  | pOverlayAttributes->szActivationLayer

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can be used to set some or all the overlay attributes. Before calling this function, initialize pOverlayAttributes->uStructSize to be sizeof(OVERLAYATTRIBUTES) and initialize all the attributes to be set or changed. You do not need to initialize the structure variables that you are not setting or changing. For example, if OVERLAYATTRIBUTES_ORIGIN is not set in uFlags, you do not need to initialize pOverlayAttributes-> ptOrigin.

There are several attributes in uFlags 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.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_GetOverlayBitmap, L_GetOverlayAttributes, L_UpdateBitmapOverlayBits, L_GetOverlayCount, OVERLAYATTRIBUTES, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview

Example

/* You can also see the example for L_SetOverlayBitmap */
/* This example will change only one of the flag attributes for all the overlays */
/* Note that OverlayAttributes.uStructSize is not initialized directly. L_GetOverlayAttributes is initializing OverlayAttributes.uStructSize */
L_VOID ShowOverlays(HWND hWnd, pBITMAPHANDLE pBitmap, L_BOOL bShow)
{
L_INT i;
OVERLAYATTRIBUTES OverlayAttributes;

for(i = 0; i <= MAX_OVERLAYS; i++)
{
L_GetOverlayAttributes(pBitmap, i, &OverlayAttributes, sizeof(OverlayAttributes), OVERLAYATTRIBUTES_FLAGS);
if(bShow)
OverlayAttributes.uFlags |= OVERLAY_AUTOPAINT;
else
OverlayAttributes.uFlags &= ~OVERLAY_AUTOPAINT;
L_SetOverlayAttributes(pBitmap, i, &OverlayAttributes, OVERLAYATTRIBUTES_FLAGS);
}

InvalidateRect(hWnd, NULL, FALSE);
}


L_SetOverlayBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetOverlayBitmap(pBitmap, nIndex, pOverlayBitmap, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_INT nIndex; | /* the overlay index */
pBITMAPHANDLE pOverlayBitmap; | /* pointer to the overlay bitmap handle */
L_UINT uFlags; | /* flags that determine how to set the bitmap */

Sets the overlay bitmap for a certain index. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay for which to set the bitmap This index is zero-based.
pOverlayBitmap | Pointer to the overlay bitmap handle which contains the new overlay bitmap. This can be NULL, in which case the corresponding overlay bitmap will be freed.
uFlags | Flags that determine how to set the bitmap for the overlay. You cannot combine these flags. Possible values are:
 | Value | Meaning
 | OVERLAY_COPY | [0x0000] A copy of the overlay bitmap is inserted in the overlay list. pOverlayBitmap will not be affected.
 | OVERLAY_NOCOPY | [0x0001] pOverlayBitmap 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.
 | OVERLAY_MOVE | [0x0003] pOverlayBitmap is moved into the overlay list. It will also be reset, so you cannot make changes to it. This is recommended over OVERLAY_NOCOPY.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Calling this function with a valid bitmap handle set in pOverlayBitmap frees the old overlay bitmap at the specified index and sets the overlay bitmap at the index to the new bitmap referenced by pOverlayBitmap. If pOverlayBitmap is NULL, the old overlay bitmap is freed and the size is reset to:

OverlayWidth = BITMAPWIDTH(pBitmap) – pOverlayBitmap.ptOrigin.x
OverlayHeight = BITMAPHEIGHT(pBitmap) – pOverlayBitmap.ptOrigin.y

where

BITMAPWIDTH is a macro which determines the display bitmap width, taking the view perspective into account.

BITMAPHEIGHT is a macro which determines the display bitmap height, taking the view perspective into account.

If uFlags is OVERLAY_NOCOPY and the overlay bitmap is allocated, all the members from the pOverlayBitmap structure are copied into the overlay array. This means whenever you update the data from pOverlayBitmap, the overlay bitmap is changed too. Great care should be taken when using this flag because you can invalidate the overlay bitmap handle stored in the array. For example, if you free the overlay bitmap, the data pointed to by the overlay bitmap from the internal array is also freed, but the array does not know that this has happened and thinks the data pointer is still valid. If the overlay bitmap is accessed in some way, a crash will occur. A safer way of quickly setting the data is to use OVERLAY_MOVE.

If uFlags is OVERLAY_MOVE, the data from the pOverlayBitmap is copied into the overlay array and then the pOverlayBitmap structure is erased. This means that you can do anything with the pOverlayBitmap structure and the overlay bitmap stored in the array will be unaffected. This is the most efficient way of setting the overlay bitmap, because no copy will take place.

You can change the size of the overlay bitmap by calling L_SetOverlayBitmap. Note that you can call L_SetOverlayBitmap with an unallocated bitmap. In that case, only the width and height are used from the overlay bitmap.

If pOverlayBitmap references a bitmap that is not 1-bit, this function will return an error indicating that the bitmap has the wrong bits per pixel.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_GetOverlayBitmap, L_SetOverlayAttributes, L_GetOverlayAttributes, L_UpdateBitmapOverlayBits, L_GetOverlayCount, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview
 | Using Color Values in LEADTOOLS

Example

/* This example will load an overlay bitmap and sets its color and a few attributes */
L_INT LoadAndSetOverlay(pBITMAPHANDLE pBitmap,LPTSTR pszName,L_INT nIndex,COLORREF crColor)
{
L_INT nRet;
BITMAPHANDLE OverlayBitmap;
OVERLAYATTRIBUTES OverlayAttributes;

// load and then set the overlay bitmap
nRet = L_LoadBitmap( pszName, &OverlayBitmap,sizeof(BITMAPHANDLE),1,ORDER_RGB,NULL,NULL);
if(nRet == SUCCESS)
nRet = L_SetOverlayBitmap( pBitmap, nIndex, &OverlayBitmap,OVERLAY_MOVE);

if(nRet == SUCCESS)
{
OverlayAttributes.uStructSize = sizeof(OVERLAYATTRIBUTES);
OverlayAttributes.crColor = crColor;
OverlayAttributes.uFlags = OVERLAY_AUTOPAINT;
if(nIndex != 3) // auto-process all overlays except index 3
OverlayAttributes.uFlags |= OVERLAY_AUTOPROCESS;
OverlayAttributes.ptOrigin.x = nIndex * 30;
OverlayAttributes.ptOrigin.y = nIndex * 10;
OverlayAttributes.uBitPosition = pBitmap->BitsPerPixel - nIndex - 1;
nRet = L_SetOverlayAttributes(pBitmap,
nIndex,
&OverlayAttributes,
OVERLAYATTRIBUTES_COLOR |
OVERLAYATTRIBUTES_FLAGS |
OVERLAYATTRIBUTES_ORIGIN |
OVERLAYATTRIBUTES_BITINDEX);
}
return nRet;
}


L_SetOverlayCallback

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetOverlayCallback(pfnCallback, pUserData, uFlags)

OVERLAYCALLBACK pfnCallback; | /* your callback function */
L_VOID L_FAR * ppUserData; | /* pointer to more parameters for the callback */
L_UINT uFlags; | /* procedure flag */

Specifies how to load the overlay bitmap and optionally sets a callback function.

Parameter | Description
pfnCallback | Your callback function that asks the user for the overlay bitmap, when loading a file containing an overlay. The callback function must adhere to the syntax specified in OVERLAYCALLBACK. Pass NULL If there is no overlay callback function. If a callback function is set, the callback function will be used only if OVERLAY_LOADONLY is not set in uFlags.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
uFlags | Flags that indicate the method(s) to use when loading an overlay bitmap and the order in which to perform those methods. Possible values are:
 | Value | Meaning
 | OVERLAY_LOADCALL | [0x0001] First, try loading the overlay bitmap from disk. If the load fails, the overlay callback will be asked to provide the overlay bitmap.
 | OVERLAY_CALLLOAD | [0x0002] First, call the overlay callback. If the callback did not supply an overlay bitmap, try loading the overlay bitmap from disk.
 | OVERLAY_CALLONLY | [0x003] Call the overlay callback. If there is no callback function set, there is no overlay bitmap.
 | OVERLAY_LOADONLY | [0x0004] Try to load the overlay bitmap from disk. If the load fails, there is no overlay.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The overlay callback set using L_SetOverlayCallback becomes the current callback. To get the current overlay callback, call L_GetOverlayCallback.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetOverlayCallback, OVERLAYCALLBACK
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to the OVERLAYCALLBACK function.


L_SetPaintContrast

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPaintContrast(pBitmap, nValue)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* amount of contrast change */

Sets the contrast value for the specified bitmap. This value can be retrieved using the L_GetPaintContrast function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected. This cannot be NULL.
nValue | Amount of contrast change. Valid values are -1000 to +1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When applying contrast, gamma, and intensity changes to a bitmap, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPaintContrast, L_GetPaintGamma, L_SetPaintGamma, L_GetPaintIntensity, L_SetPaintIntensity
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

/* This example sets the increases the current paint settings */
/* by 100 and then forces a repaint */
L_INT nContrast;
L_UINT uGamma;
L_INT nIntensity;
BITMAPHANDLE LeadBitmap; /* you must load the bitmap before using the following code */

/* Get the values */
nContrast = L_GetPaintContrast (&LeadBitmap);
uGamma = L_GetPaintGamma (&LeadBitmap);
nIntensity = L_GetPaintIntensity (&LeadBitmap);
/* Set the new values */
L_SetPaintContrast (&LeadBitmap, nContrast + 100);
L_SetPaintGamma (&LeadBitmap, uGamma + 100);
L_SetPaintIntensity (&LeadBitmap, nIntensity + 100);


L_SetPaintGamma

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPaintGamma(pBitmap, uValue)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uValue; | /* gamma value */

Sets the current gamma correction value for the specified bitmap. This value can be retrieved using the L_GetPaintGamma function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uValue | Unsigned integer that represents the gamma value. It can be any number greater than 0. The default value is 100.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

When applying contrast, gamma, and intensity changes to a bitmap, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPaintContrast, L_SetPaintContrast, L_GetPaintGamma, L_GetPaintIntensity, L_SetPaintIntensity, L_DlgGammaAdjustment
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to L_SetPaintContrast.


L_SetPaintIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPaintIntensity(pBitmap, nValue)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* amount to change the intensity */

Sets the current intensity value for the specified bitmap. This value can be retrieved using the L_GetPaintIntensity function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected. This cannot be NULL.
nValue | Amount to change the intensity. Valid values are -1000 to +1000. A positive value increases (or lightens) the brightness of the display. A negative values decreases (or darkens) the brightness of the display.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

When applying contrast, gamma, and intensity changes to a bitmap, LEAD applies the changes in the following order:

Contrast

Intensity

Gamma

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetPaintContrast, L_SetPaintContrast, L_GetPaintGamma, L_SetPaintGamma, L_GetPaintIntensity
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to L_SetPaintContrast.


L_SetPCDResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPCDResolution(nResolution)

L_INT nResolution;

/* resolution for loading or to use in conversion */

Sets the resolution to be used for loading or converting a PhotoCD file.

Parameter | Description
nResolution | Integer indicating the resolution to load or use in conversion. Valid values for nResolution are:
 | Value | Meaning
 | L_PCD_BASE_OVER_64 | [0] Resolution 64 x 96
 | L_PCD_BASE_OVER_16 | [1] Resolution 128 x 192
 | L_PCD_BASE_OVER_4 | [2] Resolution 256 x 384
 | L_PCD_BASE | [3] Resolution 512 x 768
 | L_PCD_4BASE | [4] Resolution 1024 x 1536
 | L_PCD_16BASE | [5] Resolution 2048 x 3072

Returns

SUCCESS | The function was successful.
-13 (ERROR_INV_PARAMETER) | nResolution was not a valid value.

Comments

Use this function after L_GetPCDResolution (which determines valid resolutions of the file) and prior to loading or converting a PhotoCD file. If this function is not used, the default resolution of 512 x 768 will be used.

Note: | If this function is used at any time, the resolution selected will be used until this function is called to select a new resolution, or to reset the resolution to a default value.
Note: | More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_GetWMFResolution, L_SetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment, L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetViewPort
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

For an example, refer to L_GetPCDResolution.


L_SetPDFInitDir

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPDFInitDir(pszInitDir)

L_TCHAR L_FAR * pszInitDir;

/* path of the initialization directory */

Overrides the default path of PDF initialization directories.

Parameter | Description
pszInitDir | Character string containing the new path of the initialization directory.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The user calls this function to override the default path of the PDF initialization directories. This allows the user to choose which PDF runtime library his or her application loads at runtime.

The default PDF initialization directories path is stored in the system registry key: "HKEY_LOCAL_MACHINE\SOFTWARE\LEAD Technologies, Inc.\Pdf\GS_LIB"

If you call this function with an empty string (length = 0), then the engine will look for the PDF initialization files in the default PDF initialization directories path (specified by the registry key).

The new path must both exist prior to calling the function and contain the Lib, Font, and Resource directories for the PDF Filter. If either of the above is not true, the engine fails and returns an error when the user attempts to load a PDF file.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetPDFInitDir
Topics: | Implementing PDF Plug in Features
 | Raster Image Functions: Input/Output File Filters

Example

/*This example will show how to get the path of PDF initialization directories*/
L_CHAR *pszInitDir;
pszInitDir = FARALLOC(L_MAX_PATH, sizeof(L_CHAR));
nRet = L_GetPDFInitDir(pszInitDir, L_MAX_PATH);
if(SUCCESS == nRet)
L_SetPDFInitDir(pszInitDir);


L_SetPDFOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPDFOptions(pOptions)

pFILEPDFOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when loading PDF, PS or EPS files.

Parameter | Description
pOptions | Pointer to a structure that contains the options to use when loading PDF, PS or EPS files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The nSize member of the FILEPDFOPTIONS structure must be set before calling this function. If a PDF, PS or EPS file is loaded without first calling this function, the following default values will be used:

FILEPDFOPTIONS Member: | Default value:
bUseLibFonts | TRUE
nXResolution | 96
nYResolution | 96
nDisplayDepth | 24
nTextAlpha | 4
nGraphicsAlpha | 1

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Both font and graphics anti-aliasing slow down the drawing of the resulting bitmap.

Font and graphics anti-aliasing can only be used if nDisplayDepth is 8 or greater.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetPDFOptions
Topics: | Raster Image Functions: Loading Files
 | Implementing PDF Plug in Features

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a PDF file, with a display depth
defined by the user and without using font anti-aliasing */
void LoadPDFFile
(
L_TCHAR *pszPDFFileName,
pBITMAPHANDLE pBitmap,
L_INT nDisplayDepth
)
{
FILEPDFOPTIONS PdfOptions;

/* Get the current PDF options */
L_GetPDFOptions(&PdfOptions,sizeof(FILEPDFOPTIONS));

/*Change display depth */
switch(nDisplayDepth)
{
/*We only accept 1,4,8 or 24*/
case 1 :
case 4 :
case 8 :
case 24 :
PdfOptions.nDisplayDepth = nDisplayDepth;
break;
default :
MessageBox (NULL, TEXT("Invalid Display Depth"), TEXT("Notice"), MB_OK);
/* current value is used instead of value passed by the user */
}
/* No font anti-aliasing*/
PdfOptions.nTextAlpha = 1;

/* Set new PDF options */
L_SetPDFOptions(&PdfOptions);

/* Now load the PDF file */
L_LoadBitmap( pszPDFFileName,
pBitmap,
sizeof(BITMAPHANDLE),
0,
ORDER_RGB,
NULL,
NULL );
}


L_SetPDFSaveOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPDFSaveOptions(pSaveOptions)

const pFILEPDFSAVEOPTIONS pSaveOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when saving PDF files.

Parameter | Description
pSaveOptions | Pointer to a structure which contains the new PDF save options to set

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetPDFSaveOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing PDF Plug in Features

Example

L_VOID EnablePrintingRight()
{
FILEPDFSAVEOPTIONS pdfSaveOptions;

L_GetPDFSaveOptions( &pdfSaveOptions, sizeof( pdfSaveOptions ) );
if(strlen( pdfSaveOptions.szOwnerPassword ) > 0 ||
strlen( pdfSaveOptions.szUserPassword ) > 0 )
{
/* protection enabled ...so change the access right */
pdfSaveOptions.uStructSize = sizeof( pdfSaveOptions );
pdfSaveOptions.dwEncryptFlags |= PDF_SECURITYFLAGS_REV2_PRINTDOCUMENT;
if( pdfSaveOptions.b128bit )
{
/* faithful printing for revision 3 method */
pdfSaveOptions.dwEncryptFlags |= PDF_SECURITYFLAGS_REV3_PRINTFAITHFUL;
}

L_SetPDFSaveOptions( &pdfSaveOptions );
}
}


L_SetPlaybackIndex

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPlaybackIndex(hPlayback, nIndex)

HPLAYBACK hPlayback; | /* playback handle */
L_INT nIndex; | /* bitmap list index */

Sets the list index of the current bitmap during animation playback.

Parameter | Description
hPlayback | Handle that references the animation playback.
nIndex | The bitmap list index to set.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ProcessPlayback, L_ClearPlaybackUpdateRect, L_GetPlaybackIndex, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_AppendPlayback, L_ValidatePlaybackLines
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_GetPlaybackIndex. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_SetPLTOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPLTOptions(pOptions)

pFILEPLTOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when loading HPGL files.

Parameter | Description
pOptions | Pointer to a structure that contains the options to use when loading HPGL files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The nSize member of the FILEPLTOPTIONS structure must be set before calling this function. If an HPGL file is loaded without first calling this function, the following default values will be used:

FILEPLTOPTIONS Member: | Default value:
PenWidth[0] | 1
PenWidth[1] | 1
PenWidth[2] | 1
PenWidth[3] | 1
PenWidth[4] | 1
PenWidth[5] | 1
PenWidth[6] | 1
PenWidth[7] | 1
PenColor[0] | 0x00FFFFFF
PenColor[1] | 0x00000000
PenColor[2] | 0x000000FF
PenColor[3] | 0x0000FF00
PenColor[4] | 0x0000FFFF
PenColor[5] | 0x00FF0000
PenColor[6] | 0x00FF00FF
PenColor[7] | 0x00FFFF00

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetPLTOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images
 | Using Color Values in LEADTOOLS

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a PLT file, with a pen widths and pen colors
defined by the user */
void LoadPLTFile
(
L_TCHAR *pszPLTFileName,
pBITMAPHANDLE pBitmap,
L_INT *pPenWidths,
COLORREF *pPenColors
)
{
FILEPLTOPTIONS PltOptions;
L_INT nPen;

/* Get the current PLT options */
L_GetPLTOptions(&PltOptions, sizeof(FILEPLTOPTIONS));

for ( nPen = 0; nPen < 8; nPen++ )
{
/*Change pen width */
PltOptions.PenWidth[nPen] = pPenWidths[nPen];

/* Change pen color*/
PltOptions.PenColor[nPen] = pPenColors[nPen];
}

/* Set new PLT options */
L_SetPLTOptions(&PltOptions);

/* Now load the PLT file */
L_LoadBitmap(pszPLTFileName,
pBitmap,
sizeof(FILEPLTOPTIONS),
0,
ORDER_RGB,
NULL,
NULL );
}


L_SetPTKOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPTKOptions(pOptions);

pFILEPTKOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when loading PTOCA and AFP:PTOCA files.

Parameter | Description
pOptions | Pointer to a structure that contains the options to use when loading PTOCA and AFP:PTOCA files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILEPTKOPTIONS structure must be set before calling this function. If a PTOCA and AFP:PTOCA file is loaded without first calling this function, the following default values will be used:

FILEPTKOPTIONS Member: | Default value:
nPTKResolution | 96

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetPTKOptions
Topics: | Loading and Saving Images
 | Raster Image Functions: Loading Files

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a PTK file, with a resolution
defined by the user */

void LoadPTKFile(L_TCHAR *pszPTKFileName, pBITMAPHANDLE pBitmap, L_INT nDisplayDepth)
{
FILEPTKOPTIONS PtkOptions;

/* Get the current PTK option */
L_GetPTKOptions(&PtkOptions,sizeof(FILEPTKOPTIONS));

/*Change Resolution */
PtkOptions. nPTKResolution = 120;

/* Set new PTK option */
L_SetPTKOptions(&PtkOptions);

/* Now load the PTK file */
L_LoadBitmap(pszPTKFileName, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);
}


L_SetRTFOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetRTFOptions(pOptions)

pFILERTFOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when loading RTF files.

Parameter | Description
pOptions | Pointer to a structure that contains the options to use when loading RTF files.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILERTFOPTIONS structure must be set before calling this function. If an RTF file is loaded without first calling this function, the following default values will be used:

FILERTFOPTIONS Member: | Default value:
dTopMarg | 1 inch
dBottomMarg | 1 inch
dRightMarg | 1.25 inches
dLeftMarg | 1.25 inches
dPaperWidth | 8.27 inches
dPaperHeight | 11.69 inches

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetRTFOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a RTF file, with a top margin, bottom margin, left margin, right margin defined by the user */
void LoadRTFFile
(
L_TCHAR *pszRTFFileName,
pBITMAPHANDLE pBitmap,
L_DOUBLE dTopMarg,
L_DOUBLE dBottomMarg,
L_DOUBLE dLeftMarg,
L_DOUBLE dRightMarg
)
{
FILERTFOPTIONS RtfOptions;

/* Get the current RTF options */
L_GetRTFOptions(&RtfOptions,sizeof(FILERTFOPTIONS));

/*Change margin values */
RtfOptions.dTopMarg = dTopMarg;
RtfOptions.dBottomMarg = dBottomMarg;
RtfOptions.dLeftMarg = dLeftMarg;
RtfOptions.dRightMarg = dRightMarg;

/* Set new RTF options */
L_SetRTFOptions(&RtfOptions);

/* Now load the RTF file */
L_LoadBitmap(pszRTFFileName,
pBitmap,
sizeof(BITMAPHANDLE),
0,
ORDER_RGB,
NULL,
NULL );
}


L_SetSaveResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetSaveResolution(uCount, pResolutions)

L_UINT uCount; | /* number of resolutions to be saved in a file */
pDIMENSION pResolutions; | /* pointer to the array which holds the resolutions to be saved */

Sets resolutions for the next save operation.

Parameter | Description
uCount | Specifies the number of resolutions to be saved in a file. Or, specify 0 to save only the actual size of the image as a single dimension in the file.
pResolutions | Pointer to the array of DIMENSION structures which hold the resolutions to be saved.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Currently, this function only works with the JBIG format.

A JBIG, FlashPix or PhotoCD file can contain more than one copy of the same image, each at a different physical resolution (width and height in pixels).

For JBIG files, uCount refers to the number of resolution layers to be saved in the file. The maximum number of resolutions that can be saved is 29.

For a JBIG file, the values of different resolutions are implied because the dimensions of each resolution layer are half the dimensions of the one directly above it.

pResolutions[0] is used to determine the highest resolution layer which will be saved in a file. You can fill pResolutions[0] with an actual width and height, or you can fill either the width or height with a valid value, and specify 0 for the other dimension to allow LEADTOOLS to calculate that dimension based on the image's aspect ratio during the next save operation. Note that for JBIG, all the values set in pResolutions are stored, but only pResolutions[0] is used during an actual file save process.

Ex.

uCount = 3
pResolution[0].nWidth = 800
pResolution[0].nHeight = 0

If you then save an image that is 1600 x 1200, the resolutions that are stored in the file would be:

800 x 600

400 x 300

200 x 150

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetSaveResolution, L_ReadLoadResolutions, L_SetLoadResolution, L_GetLoadResolution For Vector files: L_2DGetViewMode, L_2DSetViewMode, L_2DGetViewPort, L_2DSetViewPort
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing JBIG Features

Example

/* This example saves the same image in three different
resolutions and in three different files*/
void TestSave(L_TCHAR L_FAR * pszFilename,pBITMAPHANDLE pLeadBitmap)
{
DIMENSION Resolutions;/* Dimension structure */
L_TCHAR szName[256];/*File Name sting*/

/*default case,save only one resolution layer.*/
L_SetSaveResolution (0, &Resolutions);
wsprintf(szName, TEXT("1_%s"),pszFilename);
L_SaveBitmap(szName,pLeadBitmap,FILE_JBIG,1,0, NULL);
/*save 2 resolution layers,the highest resolution
layer holds the image at full dimensions because
Resolutions.nWidth is equal to the FULL WIDTH
of the original image*/
Resolutions.nWidth= BITMAPWIDTH(pLeadBitmap);
Resolutions.nHeight=0;
wsprintf(szName, TEXT("2_%s"),pszFilename);
L_SetSaveResolution (2, &Resolutions);
L_SaveBitmap(szName,pLeadBitmap,FILE_JBIG,1,0, NULL);
/*save 3 resolution layers,the highest
resolution layer holds the image at half
the full image dimensions becuase Resolutions.nHeight
is equal to HALF THE FULL HEIGHT of the original image.*/
Resolutions.nWidth= 0;
Resolutions.nHeight=BITMAPHEIGHT(pLeadBitmap)/2;
wsprintf(szName, TEXT("3_%s"),pszFilename);
L_SetSaveResolution (3, &Resolutions);
L_SaveBitmap(szName,pLeadBitmap,FILE_JBIG,1,0, NULL);
}


L_SetStatusCallBack

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_SetStatusCallBack(pfnCallback, pUserData)

STATUSCALLBACK pfnCallback; | /* pointer to your callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
STATUSCALLBACK L_FAR * pfnOldCallback; | /* pointer to old callback function */
L_VOID L_FAR * L_FAR * ppOldUserData; | /* pointer to more parameters for the old callback */

Sets the new status callback function and gets the old status callback.

Parameter | Description
pfnCallback | Pointer to your callback function. The callback function must adhere to the function syntax specified in STATUSCALLBACK Function.
 | This callback function must return SUCCESS if the operation was successfully done, or any error if the function call was a failure. If the callback function returns a failure, the current function will terminate and return the same error that the callback returned.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pfnOldCallback | Pointer to a variable which will be updated with the old status callback function
ppOldUserData | Pointer to a variable which will be updated with the user data for the old status callback function

Returns

None.

Comments

The status callback is returned through a parameter. You used to have to call L_GetStatusCallBack to get the user data prior to calling L_SetStatusCallback. Now you can get the old callback and set the new callback in one function call.

You can use this function to specify a callback for any of the following functions:

L_AddBitmapNoise
L_AverageFilterBitmap
L_BinaryFilterBitmap
L_ChangeBitmapContrast
L_ChangeBitmapHue
L_ChangeBitmapIntensity
L_ChangeBitmapSaturation
L_ClearBitmap
L_ColorMergeBitmap
L_ColorSeparateBitmap
L_CombineBitmap
L_DeskewBitmap
L_DespeckleBitmap
L_EmbossBitmap
L_FillBitmap
L_FlipBitmap
L_GammaCorrectBitmap
L_GetBitmapHistogram
L_GrayScaleBitmap
L_HalfToneBitmap
L_HistoEqualizeBitmap
L_IntensityDetectBitmap
L_InvertBitmap
L_MedianFilterBitmap
L_MMConvertFromBitmapList(Video Module only)
L_MMSaveFile(Video Module only)
L_MosaicBitmap
L_PaintDCEffect
L_PosterizeBitmap
L_PrintBitmap
L_RemapBitmapIntensity
L_ResampleBitmap
L_ResizeBitmap
L_ReverseBitmap
L_RotateBitmap
L_RotateBitmapFine
L_SharpenBitmap
L_ShearBitmap
L_SizeBitmap
L_SpatialFilterBitmap
L_StretchBitmapIntensity
L_UnderlayBitmap

Both the old status callback function and the user data required for the old status callback function are updated in the pfnOldCallbaclk and ppOldUserData parameters, respectively.

1. | Call the L_SetStatusCallBack function, assigning its return value to a STATUSCALLBACK variable, and passing the pointer to your callback as the new value.
2. | Call the function that uses the callback (for example L_AverageFilterBitmap).
3. | Call the L_SetStatusCallBack function again, restoring the original value by passing the variable that you saved in Step 1.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | STATUSCALLBACK, L_GetStatusCallBack
Topics: | Using Callback Functions

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/**************** Global declarations
***********************************************/
HINSTANCE hInst; /* Current instance of the application, set by the
InitInstance function */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the loaded image */
L_BOOL KillProgress; /* Boolean flag to test for a user interrupt */
L_BOOL InterruptActive; /* Boolean flag to enable use of an interrupt key
*/

/* Prototype for the STATUSCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK StatusCallBack (L_INT nPercent, L_VOID L_FAR*
pUserData);

/* This function uses L_SetStatusCallBack to implement the STATUSCALLBACK
function when applying a median filter. */
void TestFunction(HWND hWnd)
{
STATUSCALLBACK lpfnOldStatusCB; /* Pointer to the previous
STATUSCALLBACK function */
L_VOID L_FAR* pOldData; /* Pointer to the user data for the previous status callback function */
/* Set the STATUSCALLBACK function, saving the pointer to the previous
one */
L_SetStatusCallBack(StatusCallBack, NULL, &lpfnOldStatusCB, &pOldData );
/* Initialize global variables for detecting a user interrupt */
InterruptActive = TRUE;
KillProgress = FALSE;
/* Apply an intentionally slow median filter with a neighborhood of 7x7
pixels */
L_MedianFilterBitmap(&LeadBitmap, 7 );
/* Disable the user interrupt key */
InterruptActive = FALSE;

/* Restore the previous STATUSCALLBACK function */
L_SetStatusCallBack (lpfnOldStatusCB, pOldData, NULL, NULL);
/* Force a repaint */
InvalidateRect(hWnd,NULL,FALSE);
return;
}

/* This is the STATUSCALLBACK function, which stops the process
if the user has pressed the interrupt key. */
L_INT L_EXPORT EXT_CALLBACK StatusCallBack (L_INT nPercent, L_VOID L_FAR
*pUserData)
{
HWND hWnd=NULL;
L_TCHAR achMsg[80]; /* MessageBox string */
MSG msg;

hWnd = (HWND)pUserData;

/* Let the application detect a WM_KEYDOWN event */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}

/* Check the global variable and return an error if necessary */
if (KillProgress)
{
wsprintf (achMsg, TEXT("Interrupted by the user with %d percent finished"),
nPercent);
MessageBox (hWnd, achMsg, TEXT("Notice"), MB_OK);
return (ERROR_USER_ABORT);
}
return SUCCESS;
}

/* This is the main window processing function, where the interrupt key is
detected */

L_INT32 EXT_FUNCTION MainWndProc (HWND hWnd, L_UINT Message, WPARAM wParam,

LPARAM lParam)

{

switch (Message)

{

case WM_KEYDOWN:

/* Use the Esc key as the user interrupt key */

if (((int) wParam == VK_ESCAPE) && (InterruptActive == TRUE))

KillProgress = TRUE;

/* Use the Insert key to run the test function */

if ((int) wParam == VK_INSERT)

TestFunction (hWnd);

}

return (0);

}


L_SetTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetTag(uTag, uType, uCount, pData)

L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16 uType; | /* tagged data type */
L_UINT32 uCount; | /* count of data items */
L_VOID L_FAR * pData; | /* pointer to the buffer containing the data */

Specifies a private tag and the tagged data to be saved in a TIFF file.

Parameter | Description
uTag | 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:
 | 0x80A4 | Annotation TIFF tag defined as ANNTAG_TIFF.
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.
uCount | Count 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.
pData | Pointer to a buffer containing the data to be saved using the tag.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function copies the data from your buffer to an internally-allocated buffer. You should free your own buffer after calling this function. Any TIFF file that you save will include the tagged data until you clear the tag. LEADTOOLS keeps a list of tags in memory. The list contains all the tags set directly (by calling L_SetTag) or indirectly (by calling L_AnnSaveTag). All these tags will be saved unless you clear them. The way to clear a tag and remove it from the list is by calling L_SetTag(uTag, 0, 0, NULL). L_SetTag(0,0,0,NULL) will remove ALL the tags from the tag list.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetTag, L_ReadFileTag, L_ReadFileTagMemory, L_AnnSaveTag, L_DeleteTag
Topics: | Implementing TIFF Comments and Tags

Example

/* This example specifies a tag for recording the position of a company logo on the image.
It sets the tag with L_SetTag; tests the tag with L_GetTag; then saves a TIFF file with the new tag.
For an example that reads this same tag from the file, refer to L_ReadFileTag. */
void TestSaveTag(pBITMAPHANDLE pBitmap)
{
L_TCHAR msgbuf[80]; /* buffer for the message string */
L_UINT16 LogoPosition = 0x8001; /* my private tag */
L_UINT16 TagType = TAG_SSHORT; /* tagged data type */
L_UINT32 TagCount = 4; /* count of data items */
L_INT TagData[] = {5, 5, 24, 37};
L_VOID L_FAR * pTagData = &TagData; /* pointer to the buffer containing the data */
/* Set the tag data to be saved */
L_SetTag(LogoPosition, TagType, TagCount, pTagData);
/* Clear the variables so that we can validate the data */
TagType = 0;
TagCount = 0;
TagData[0] = 0;
TagData[1] = 0;
TagData[2] = 0;
TagData[3] = 0;
/* Get the tag data that is ready to be saved */
L_GetTag(LogoPosition, &TagType, &TagCount, pTagData);
/* Display a message showing the data */
if ((TagType == TAG_SSHORT) && (TagCount == 4))
{
wsprintf(msgbuf, TEXT("X = %d\nY= %d\nWidth = %d\nHeight = %d"),
((L_INT L_FAR *)pTagData)[0],
((L_INT L_FAR *)pTagData)[1],
((L_INT L_FAR *)pTagData)[2],
((L_INT L_FAR *)pTagData)[3]);
MessageBox (NULL, msgbuf, TEXT("Logo Position"), MB_OK);
}
/* Save the file with the tag */
L_SaveBitmap(TEXT("TEST.TIF"), pBitmap, FILE_TIF, pBitmap->BitsPerPixel, 0, NULL);
/* Clear the tag from memory */
L_SetTag(0, 0, 0, NULL);
return;
}


L_SetTempDirectory

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetTempDirectory(pszTempDir)

L_TCHAR L_FAR * pszTempDir;

/* temporary directory */

Sets the directory in which LEADTOOLS will create temporary files.

Parameter | Description
pszTempDir | Character string that contains the temporary directory name. This should be a valid directory name and the directory should exist. It cannot be NULL.

Comments

Files used to store bitmaps of type TYPE_DISK will be created here. Also, disk tiles for TYPE_TILED bitmaps will be created here.

This function 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.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetMemoryThresholds, L_GetMemoryThresholds, L_GetBitmapMemoryInfo, L_SetBitmapMemoryInfo, L_GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Raster Image Functions: Creating and Deleting Images

Example

/* Set the current directry to c:\temp */
L_SetTempDirectory(TEXT("c:\\temp"));


L_SetTXTOptions

#include "Ltfil.h"

L_INT EXT_FUNCTION L_SetTXTOptions(pOptions)

pFILETXTOPTIONS pOptions;

/* pointer to FILETXTOPTIONS structure */

Sets the file options used by LEADTOOLS when loading TXT files.

Parameter | Description
pOptions | Pointer to the FILETXTOPTIONS structure that contains the options to use when loading TXT.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILETXTOPTIONS structure must be set before calling this function. If a TXT file is loaded without first setting the options using this function, the following default values will be used for the FILETXTOPTIONS members:

Parameter | Value
bEnabled | FALSE
dTopMarg | 1 inch
dBottomMarg | 1 inch
dRightMarg | 1.25 inch
dLeftMarg | 1.25 inch
dPaperWidth | 8.27 inch
dPaperHeight | 11.69 inch
crFontColor | RGB( 0, 0, 0)
crHighlight | RGB( 0xFF, 0xFF, 0xFF)
nFontSize | 12
pFaceName | "Courier New"
bBold | FALSE
bItalic | FALSE
bUnderLine | FALSE
bStrikeThrough | FALSE

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetTXTOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

/* 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 */
void LoadTXTFile(L_TCHAR *pszTXTFileName, pBITMAPHANDLE pBitmap, L_DOUBLE dTopMarg, L_DOUBLE dBottomMarg, L_DOUBLE dLeftMarg, L_DOUBLE dRightMarg)
{
FILETXTOPTIONS TxtOptions;

/* Get the current TXT options */
L_GetTXTOptions(&TxtOptions,sizeof(FILETXTOPTIONS));

/*Change margin values */
TxtOptions.dTopMarg = dTopMarg;
TxtOptions.dBottomMarg = dBottomMarg;
TxtOptions.dLeftMarg = dLeftMarg;
TxtOptions.dRightMarg = dRightMarg;
TxtOptions.crFontColor = RGB( 0xFF, 0x00 , 0x00);
TxtOptions.nFontSize = 12;
TxtOptions.bBold = TRUE;

/* Set new TXT options */
L_SetTXTOptions(&TxtOptions);

/* Now load the TXT file */
L_LoadBitmap (pszTXTFileName, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);}


L_SetUserMatchTable

#include "l_bitmap.h"

L_UINT L_FAR * EXT_FUNCTION L_SetUserMatchTable(pTable)

L_UINT, L_FAR * pTable;

/* pointer to the table */

Selects a table that speeds conversion when using a palette that you create.

Parameter | Description
pTable | The pointer to the table.

Returns

The pointer to the previous table.

Comments

This function is used with other functions in the following sequence:

1. | Call L_CreateUserMatchTable to create the table.
2. | Call L_SetUserMatchTable to make this the current table. (Having this as a separate function allows you to save tables in files and get the one you need, without creating it again.)
3. | Call L_ColorResBitmap with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call L_FreeUserMatchTable when the table is no longer needed.

The completed table occupies 64K bytes of memory. Creation of the table is a slow, memory-intensive process that is useful only if you are using your own palette more than once. For example, you may want to create the table once, save it to a file, and ship that file with your application.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ColorResBitmap, L_DefaultDithering, L_CreateUserMatchTable, L_FreeUserMatchTable
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes

Example

For an example, refer to L_CreateUserMatchTable.


L_SetWMFResolution

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetWMFResolution(nXResolution, nYResolution)

L_INT nXResolution; | /* horizontal resolution value */
L_INT nYResolution; | /* vertical resolution value */

Sets the DPI (dots per inch) value that LEADTOOLS uses when loading WMF/EMF files. By default, the value is 0.

Parameter | Description
nXResolution | The horizontal resolution value that LEADTOOLS is to use when loading images from WMF files. Possible values are:
 | Value | Meaning
 | 0 | Load the file at the resolution present in the file.
 | Any positive value | Load the file at the corresponding DPI. For example, if this value is 150, load the image at 150 DPI.
nYResolution | The vertical resolution value that LEADTOOLS is to use when loading images from WMF files. Possible values are:
 | Value | Meaning
 | 0 | Load the file at the resolution present in the file.
 | Any positive value | Load the file at the corresponding DPI. For example, if this value is 150, load the image at 150 DPI.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The values that this function sets are valid for the current thread, and you can change the values in the thread only by calling this function again.

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/EMF 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 smaller 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 L_GetWMFResolution and L_SetWMFResolution, along with the L_FileInfo or L_FileInfoMemory function, to manage these image size issues. The following are examples of how you can use these functions:

To load an image at its saved resolution, you can do the following:

1. | Call L_SetWMFResolution with nXResolution and nYResolution set to 0.
2. | Call L_LoadBitmap 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. | Call L_SetWMFResolution with nXResolution and nYResolution set to 0.
2. | Call L_FileInfo, and in the FILEINFO structure, check the XResolution and Width values 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 FILEINFO.XResolution is B, the desired width is C, and the value of the FILEINFO.Width field is D, the calculation is as follows: A = B * C / D.
4. | Call L_SetWMFResolution to set the desired resolution.
5. | Call L_LoadBitmap to load the file.

Some WMF/EMF 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 L_SetWMFResolution has no effect.

Note: | When saving WMF/EMF files, LEADTOOLS saves the current resolution value in the file.
Note: | More options are available in the LOADFILEOPTION structure.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_FileInfo, L_FileInfoMemory, L_ReadFileComment, L_GetPCDResolution, L_SetPCDResolution, L_GetWMFResolution, L_SetLoadInfoCallback, L_GetExtFileOption, L_SetExtFileOption, L_GetComment, L_SetComment, L_2DGetViewMode, L_2DGetViewPort, L_2DSetViewMode, L_2DSetView Port
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a WMF image at the resolution needed to fit the
width of the current window */

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction(HWND hWnd)
{
RECT rClientSize; /* RECT for the current window's client area */
L_INT nWMFResolution; /* WMF resolution */
FILEINFO FileInfo; /* File info structure */
/* Get the RECT for the current window's client area */
GetClientRect(hWnd,&rClientSize);
/* Get the current WMF resolution */
L_GetWMFResolution(&nWMFResolution, &nWMFResolution);
/* Update the FILEINFO structure */
FileInfo.uStructSize = sizeof(FileInfo);
L_FileInfo(TEXT("TEST.WMF"),&FileInfo, sizeof(FILEINFO), 0, NULL);
/* Calculate the desired resolution to fit the client width */
nWMFResolution = min((L_INT) ((L_INT32) nWMFResolution * (rClientSize.right - rClientSize.left) / INFOWIDTH(&FileInfo)),
(L_INT) ((L_INT32) nWMFResolution * (rClientSize.bottom - rClientSize.top) / INFOHEIGHT(&FileInfo)) );
/* Set the desired resolution */
L_SetWMFResolution(nWMFResolution, nWMFResolution);
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("TEST.WMF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
return;
}


L_SharpenBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SharpenBitmap(pBitmap, nSharpness)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nSharpness; | /* amount to change the sharpness */

Increases or decreases the sharpness of the image in the specified bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
nSharpness | The amount to change the sharpness. Valid values range from -1000 to +1000.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Negative values decrease the sharpness of the image. Specify -1000 for minimum sharpness. Positive values increase the sharpness. Specify +1000 for maximum sharpness.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgSharpen , L_WindowLevel, L_SkeletonBitmap, L_CorrelationBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap
Topics: | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and increases its sharpness. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Increase the sharpness by 25 percent of the possible range */
L_SharpenBitmap(&LeadBitmap, 250 );


L_ShearBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ShearBitmap(pBitmap, nAngle, fHorizontal, crFill)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* angle of slant */
L_BOOL fHorizontal; | /* TRUE for horizontal, FALSE for vertical */
COLORREF crFill; | /* COLORREF value for the fill color */

Moves the corners of a bitmap in the fashion of a parallelogram.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to shear.
nAngle | 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).
fHorizontal | TRUE for horizontal shear, or FALSE for vertical shear.
crFill | The COLORREF value that specifies the fill color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You specify an angle of slant, horizontal or vertical shear, and the fill color for the created space. The following is a horizontal example:

The angle is expressed in hundredths of degrees, with a limit of 4500 (45 degrees).

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RotateBitmap, L_RotateBitmapFine, L_FlipBitmap, L_ReverseBitmap, L_DlgShear
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Using Color Values in LEADTOOLS

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Shear the bitmap 15 degrees vertically, filling extra space with blue */
L_ShearBitmap(&LeadBitmap, -1500, FALSE, RGB(0, 0, 255) );


L_ShiftBitmapData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ShiftBitmapData (pDstBitmap, pSrcBitmap, uSrcLowBit, uSrcHighBit, uDstLowBit, uDstBitsPerPixel)

pBITMAPHANDLE pDstBitmap; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
L_UINT uSrcLowBit; | /* position of the starting bit of the mask */
L_UINT uSrcHighBit; | /* length of the mask */
L_UINT uDstLowBit; | /* placement of the mask in pDstBitmap */
L_UINT uDstBitsPerPixel; | /* bits per pixel for the destination bitmap */

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 function is available in the Medical toolkits.

Parameter | Description
pDstBitmap | Pointer to the destination bitmap that will contain the result of the function. The user should free the bitmap before passing it to the function.
pSrcBitmap | Pointer to the source bitmap handle referencing the 8, 12 or 16-bit grayscale bitmap. pSrcBitmap will not be affected.
uSrcLowBit | Position of the start bit that will construct the mask. The position is a zero-based number.
uSrcHighBit | Position of the end bit. This is inclusive (it is part of the mask). The value should not be less than uSrcLowBit. You can also pass –1, which is interpreted as "highest bit" (pSrcBitmap->BitsPerPixel – 1).
uDstLowBit | The bit position where the selected mask will be copied into the pDstBitmap.
uDstBitsPerPixel | Bits per pixel for the destination bitmap. The allowed values are 8, 12, or 16

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function is used mainly as a visualization aid. You can select certain bits of the supported type bitmap and display them in another bitmap.

You can use this function 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 function twice and OR-ing the results.

The pDstBitmap should not be allocated when calling this function. You should free the allocated bitmap before calling this function. When the function returns successfully the pDstBitmap will be an 8, 12 or 16-bit grayscale.

For 8, 12 and 16-bit grayscale bitmaps, the uSrcLowBit can range from 0 to 7, 0 to 11, and 0 to 15 respectively. However if this value exceeded the range then the function will not return an error, and the pDstBitmap will be a pure black bitmap.

The uSrcHighBit must be greater than or equal to uSrcLowBit. The function will return an invalid parameter error if uSrcHighBit < uSrcLowBit.

The uDstLowBit can range from 0 to uDstBitsPerPixel – 1. If you pass greater values for uDstLowBit, the function will not return an error, but pDstBitmap will become a pure black bitmap.

The following example shows you how to treat a 16-bit grayscale bitmap:

In a16-bit grayscale bitmap, the bits are ordered as b15 b14 b13 ... b2 b1 b0. You can choose the bit from where to start moving the bits.

For example, if the mask starts at the fourth bit (b3), with a length equal to 6 bits, the destination starting position is 4 and we want to create an 8-bit destination bitmap:

uSrcLowBit = 3

uSrcHighBit = 8

uDstLowBit = 4

uDstBitsPerPixel = 8

Source bitmap (pSrcBitmap):

-------------------

b15 b14 b13 b12 b11 b10 b9 |b8 b7 b6 b5 b4 b3| b2 b1 b0

-------------------

0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1

Destination bitmap (pDstBitmap):

-------------

|b7 b6 b5 b4| b3 b2 b1 b0

-------------

0 0 1 1 0 0 0 0

You can notice that b7 and b8 of pSrcBitmap are truncated in the pDstBitmap since there is no space for them.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SelectBitmapData, L_ColorizeGrayBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftone and Halftone Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and applies Shifing. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
BITMAPHANDLE DstBitmap; /* Bitmap handle to hold the result. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);

/* Move 5 bits starting from bit 2 into the high bits of the destination bitmap */
L_ShiftBitmapData (&DstBitmap, &LeadBitmap,
2 /* uSrcLowBit */,
6 /* uSrcHighBit*/,
3 /* uDstLowBit */,
8 /* uDstBitsPerPixel */ );

L_FreeBitmap (&LeadBitmap);

// Now we have the resulting image in DstBitmap


L_ShiftMinimumToZero

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ShiftMinimumToZero(pBitmap, puShiftAmount)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT L_FAR * puShiftAmount; | /* pointer to the shifting amount */

Converts the signed bitmap to an unsigned bitmap by increasing/shifting the bitmap's intensity values, so the lowest intensity value (the most negative value) will be shifted to zero. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to convert.
puShiftAmount | Pointer to a variable to be updated with the value by which the intensity values were shifted.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is similar to L_ConvertBitmapSignedToUnsigned. However, L_ShiftMinimumToZero updates the puShiftAmount parameter with the value by which the intensity values were shifted.

The L_ShiftMinimumToZero and L_ShiftZeroToNegative are most often used in concert with one or more image processing or analysis functions. L_ShiftMinimumToZero converts signed data to unsigned data, in preparation for some image processing or analysis. (Most image processing functions work only on unsigned data.) After the image processing or analysis is performed, L_ShiftZeroToNegative converts the unsigned data back to signed data.

This function updates the pBitmap->Flags.Signed, MinVal and MaxVal members of the BITMAPHANDLE.

This function doesn’t support 8-bit images.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ClearNegativePixels, L_ConvertBitmapUnsignedToSigned, L_ConvertBitmapSignedToUnsigned, L_ShiftZeroToNegative
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

// This function will apply L_MultiScaleEnhancementBitmap on a signed image,
// but since L_MultiScaleEnhancementBitmap doesn’t support signed images,
// we will convert the image to unsigned image, apply the effect,
// and then convert it back to signed image.

L_INT nShiftAmount;
BITMAPHANDLE LeadBitmap;
L_INT nRet;
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
L_GetDefaultLoadFileOption (&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

// Convert the bitmap to unsigned bitmap by shifting the negative values to become positive.
nRet = L_ShiftMinimumToZero(&LeadBitmap, &nShiftAmount);

// Apply multiscale enhancement
L_MultiScaleEnhancementBitmap (&LeadBitmap, 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);

// Convert the bitmap back to signed by shifting the same amount in the negative side.
nRet = L_ShiftZeroToNegative(&LeadBitmap, nShiftAmount, -32767, 32766, 0, 65535);


L_ShiftZeroToNegative

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ShiftZeroToNegative(pBitmap, nShiftAmount, nMinInput, nMaxInput, nMinOutput, nMaxOutput)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nShiftAmount; | /* shifting amount */
L_INT nMinInput; | /* bitmap’s minimum value */
L_INT nMaxInput; | /* bitmap’s maximum value */
L_INT nMinOutput; | /* minimum allowed value */
L_INT nMaxOutput; | /* maximum allowed value */

Converts an unsigned bitmap to a signed bitmap by decreasing intensity values by a specific amount. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to convert.
nShiftAmount | The amount by which to decrease the bitmap's intensity values. The amount that is used to shift the bitmap data to the negative side.
nMinInput | The bitmap's minimum intensity value. This value can be obtained by calling the L_GetMinMaxVal function.
nMaxInput | The bitmap's maximum intensity value. This value can be obtained by calling the L_GetMinMaxVal function.
nMinOutput | The minimum intensity value allowed in the resulting image. If this function results in an intensity value less than this value, the intensity value in the resulting image will be set to this minimum value.
nMaxOutput | The maximum intensity value allowed in the resulting image. If this function results in an intensity value more than this value, the intensity value in the resulting image will be set to this maximum value.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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 –nShiftAmount.

This function is similar to L_ConvertBitmapUnsignedToSigned. However, L_ShiftZeroToNegative lets the user determine the value by which to shift the data, while in L_ConvertBitmapUnsignedToSigned, the shift is fixed always. (i.e. shift center to zero.)

This function is used usually after the function L_ShiftMinimumToZero.

The L_ShiftMinimumToZero and L_ShiftZeroToNegative are most often used in concert with one or more image processing or analysis functions. L_ShiftMinimumToZero converts signed data to unsigned data, in preparation for some image processing or analysis. (Most image processing functions work only on unsigned data.) After the image processing or analysis is performed, L_ShiftZeroToNegative converts the unsigned data back to signed data.

This function updates the pBitmap->Flags.Signed, MinVal and MaxVal members of the BITMAPHANDLE.

This function doesn’t support 8-bit images.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ClearNegativePixels, L_ConvertBitmapUnsignedToSigned, L_ConvertBitmapSignedToUnsigned, L_ShiftMinimumToZero
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

// This function will apply L_MultiScaleEnhancementBitmap on a signed image,
// but since L_MultiScaleEnhancementBitmap doesn’t support signed images,
// we will convert the image to unsigned image, apply the effect,
// and then convert it back to signed image.

L_INT nShiftAmount;
BITMAPHANDLE LeadBitmap;
L_INT nRet;
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
L_GetDefaultLoadFileOption (&LoadFileOption, sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.TIF"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

// Convert the bitmap to unsigned bitmap by shifting the negative values to become positive.
nRet = L_ShiftMinimumToZero (&LeadBitmap, &nShiftAmount);

// Apply multiscale enhancement
L_MultiScaleEnhancementBitmap (&LeadBitmap, 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);

// Convert the bitmap back to signed by shifting the same amount in the negative side.
nRet = L_ShiftZeroToNegative(&LeadBitmap, nShiftAmount, -32767, 32766, 0, 65535);


L_ShowMagGlass

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ShowMagGlass(hWnd, bShow)

HWND hWnd; | /* handle to a window */
L_BOOL bShow; | /* flag that indicates whether to show or hide the Magnifying Glass */

Shows or hides the magnifying glass on the screen.

Parameter | Description
hWnd | Handle of the window to which the magnifying glass is attached.
bShow | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function is used to control the display of the magnifying glass on the screen. Since the user is responsible for displaying the magnifying glass and moving it on the screen in a manual update, this function is used in conjunction with L_SetMagGlassPos function.

This function can be called with bShow set to TRUE when the left mouse button is pressed to show the magnifying glass. It can be called with bShow set to FALSE when the left mouse button is released to hide the magnifying glass.

Note:

This function can be used only if the MAGGLASS_MANUAL_UPDATE flag was set when calling L_StartMagGlass function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_SetMagGlassPos, L_UpdateMagGlassBitmap, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

/* This example starts the Magnifying Glass in the Manual Update mode, then calls the necessary functions such like L_SetMagGlassPos and L_ShowMagGlass to handle the painting of the Magnifying Glass. */

.
.
.
L_BOOL bLeftButton=FALSE;
HCURSOR hMagGlassCursor=NULL;
.
.
.

L_VOID StartMagnifyingGlass(HWND hWnd, pBITMAPHANDLE pBitmap, pBITMAPHANDLE pUpdateBitmap, RECT* prcView)
{
L_INT nRet;
L_TCHAR szMsg[256]= TEXT("");
MAGGLASSOPTIONS MagGlassOpt;

// Starting the Magnifying Glass
memset(&MagGlassOpt, 0, sizeof(MAGGLASSOPTIONS));
MagGlassOpt.uStructSize = sizeof(MAGGLASSOPTIONS);
MagGlassOpt.nWidth = 100;
MagGlassOpt.nHeight = 100;
MagGlassOpt.nZoom = 400;
MagGlassOpt.clrPen = RGB(255,0,0);
MagGlassOpt.hMagCursor = NULL;
MagGlassOpt.clrBack = RGB(128,128,128);
MagGlassOpt.bEllipse = FALSE;
MagGlassOpt.nBorderSize = 1;
MagGlassOpt.b3D = TRUE;
MagGlassOpt.uPaintFlags = 0;
MagGlassOpt.pMask = NULL;
MagGlassOpt.uMaskCount = 0;
MagGlassOpt.nCrosshair = CROSSHAIR_FINE;
MagGlassOpt.bIgnoreRgn = TRUE;
MagGlassOpt.bCenter = TRUE;
MagGlassOpt.uMagGlassFlags = MAGGLASS_MANUAL_UPDATE;

nRet = L_StartMagGlass (hWnd, pBitmap, prcView, &MagGlassOpt, NULL, NULL);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Starting the Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
return;
}

// Updating the Magnifying Glass bitmap with another bitmap that has the
// same width and height.
nRet = L_UpdateMagGlassBitmap(hWnd, pUpdateBitmap, TRUE);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Trying to update the Magnifying Glass bitmap, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
return;
}

hMagGlassCursor = LoadCursor(hInst, MAKEINTRESOURCE(IDC_MAGGLASS_CURSOR));
}

L_BOOL Child_OnSetCursor(HWND hWnd, HWND hWndCursor, L_UINT codeHitTest, L_UINT msg)
{
if (codeHitTest != HTCLIENT)
return (FORWARD_WM_SETCURSOR(hWnd, hWndCursor, codeHitTest, msg, DefMDIChildProc));

if (L_WindowHasMagGlass(hWnd) && !bLeftButton)
SetCursor(hMagGlassCursor);

return TRUE;
}

L_VOID Child_OnLButtonDown(HWND hWnd, L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
L_INT nRet;
L_TCHAR szMsg[256]=TEXT("");

if (!L_WindowHasMagGlass(hWnd))
return;

SetCapture(hWnd);
ShowCursor(FALSE);

nRet = L_SetMagGlassPos (hWnd, x, y);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Displaying Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
return;
}

nRet = L_ShowMagGlass(hWnd, TRUE);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Displaying Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
return;
}

bLeftButton = TRUE;
}

L_VOID Child_OnMouseMove(HWND hWnd, L_INT x, L_INT y, L_UINT keyFlags)
{
L_INT nRet;
L_TCHAR szMsg[256]=TEXT("");

if (!L_WindowHasMagGlass(hWnd) || !bLeftButton)
return;

nRet = L_SetMagGlassPos (hWnd, x, y);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Moving Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
}
}

L_VOID Child_OnLButtonUp(HWND hWnd, L_INT x, L_INT y, L_UINT keyFlags)
{
L_INT nRet;
L_TCHAR szMsg[256]=TEXT("");

if (!L_WindowHasMagGlass(hWnd) || !bLeftButton)
return;

ReleaseCapture();

nRet = L_ShowMagGlass(hWnd, FALSE);
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("Error Hiding Magnifying Glass, Error: %d"), nRet);
MessageBox(hWnd, szMsg, TEXT("Error"), MB_ICONEXCLAMATION | MB_OK);
}

ShowCursor(TRUE);

bLeftButton = FALSE;
}


L_SizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SizeBitmap(pBitmap, nWidth, nHeight, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nWidth; | /* new width in pixels */
L_INT nHeight; | /* new height in pixels */
L_UINT32 uFlags; | /* quality control flags */

Resizes a bitmap to a new width and height.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be resized.
nWidth | New width in pixels.
nHeight | New height in pixels.
uFlags | Flags that control the behavior when resizing the bitmap. Use one of the following:
 | Constant | Meaning
 | SIZE_NORMAL | [0x0000] Resize normally.
 | SIZE_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 bitwise OR ( | ) to combine this flag with another one. For example, SIZE_RESAMPLE | SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images.
 | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function keeps the same bitmap handle and resizes the bitmap that it references. If you want to keep the original-size bitmap along with the resized bitmap, use the L_ResizeBitmap function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ResampleBitmap, L_ResizeBitmap, L_StartResize, L_Resize, L_StopResize, L_DlgResize , L_ApplyTransformationParameters, L_GetMarksCenterMassBitmap, L_GetTransformationParameters, L_IsRegMarkBitmap, L_SearchRegMarksBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Processing an Image
 | Raster Image Functions: Document Imaging
 | Detecting Registration Marks
 | Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the FEATURE2 example.

/* This example changes a bitmap to half its previous size */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
/* Load the bitmap, at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Change the size of the bitmap */
L_SizeBitmap (&LeadBitmap, LeadBitmap.Width / 2, LeadBitmap.Height / 2, SIZE_NORMAL);


L_SkeletonBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SkeletonBitmap(pBitmap, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* threshold value */

Finds the skeleton of objects or regions in a bitmap. This function is available in the Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap for which to find the skeleton.
uThreshold | Threshold value used to binarize the bitmap before finding the skeleton. This parameter is ignored if the bitmap is a binary bitmap. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CombineBitmap, L_IntensityDetectBitmap, L_SharpenBitmap, L_SpatialFilterBitmap, L_EdgeDetectorBitmap, L_GlowFilterBitmap, L_CorrelationBitmap, L_DiffuseGlowBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap
Topics: | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Image Processing: Filtering Images
 | Color Halftone and Halftone Images
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and finds its edges using L_EdgeDetectorBitmap then produces the skeleton of these edges */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Find the edges in the bitmap*/
L_EdgeDetectorBitmap (&LeadBitmap,60, EDG_SOBEL_ALL);
L_SkeletonBitmap(&LeadBitmap, 128);


L_SliceBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SliceBitmap(pBitmap, pOptions, pnDeskewAngle, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
pSLICEBITMAPOPTIONS pOptions; | /* pointer to a structure */
L_INT32 L_FAR * pnDeskewAngle; | /* address of the deskew angle variable to be updated */
BITMAPSLICECALLBACK pfnCallback; | /* callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Extracts individual slices from radiographic scanned film. This function is available in the Raster Pro and above toolkits.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the bitmap to be sliced.

pOptions

Pointer to the SLICEBITMAPOPTIONS structure that LEADTOOLS uses to slice the bitmap.

pnDeskewAngle

NULL or the address of the variable to be updated with the amount that the function rotates the sliced bitmap. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. You can pass NULL if you do not need to check the amount of rotation. This field is updated only if SLC_DESKEW is selected from pSLICEBITMAPOPTIONS flag parameter.

pfnCallback

Pointer to a callback function used retrieve each slice's data and information.

This callback function must return a positive number or an error code (negative number). If it returns an error code, the slicing process will stop, and the code will be passed back as the return code.

The callback function must adhere to the function prototype described in the BITMAPSLICECALLBACK function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is designed to extract the individual slices from radiographic scanned film. The image below shows an example of these radiographic images before and after applying the L_SliceBitmap function where we use the output data to draw a white line around each separate slice.

Film Before Function Is Called

Film After Function Is Called

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | BITMAPSLICECALLBACK
Topics: | Processing an Image
 | Raster Image Functions: Creating and Maintaining Lists of Images
 | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Processing an Image

Example

/*The following example finds all the slices inside some radiographic scanned film and saves them to the selected folder:*/

typedef struct tagSLICEBITMAPUSERINFO
{
L_UCHAR SlicesFolder[L_MAX_PATH];
L_UINT SlicesCount;

}
SLICEBITMAPUSERINFO, L_FAR * pSLICEBITMAPUSERINFO;

L_INT L_EXPORT EXT_CALLBACK ExampleSliceCB
(
pBITMAPHANDLE pBitmap,
LPRECT lpSliceRect,
L_INT nAngle,
L_VOID L_FAR * pUserData
)
{
pSLICEBITMAPUSERINFO pSlicesUserInfo;
L_CHAR szDirectory[L_MAXPATH];
L_CHAR S[30];
L_INT nRet;

pSlicesUserInfo = (pSLICEBITMAPUSERINFO)pUserData;

lstrcpy(szDirectory, pSlicesUserInfo->SlicesFolder);
strcat(szDirectory, TEXT("\\"));
wsprintf(S,TEXT("%d.bmp"), (pSlicesUserInfo->SlicesCount));
strcat(szDirectory, S);

nRet = L_SaveFile(szDirectory, pBitmap, FILE_BMP, 24, 0, SAVEFILE_FIXEDPALETTE, NULL, NULL, NULL );
if(nRet == SUCCESS)
{
pSlicesUserInfo->SlicesCount++;
L_FreeBitmap(pBitmap);
GlobalFree(pBitmap);
}
return SUCCESS;
}
L_VOID ExampleSliceBitmap(HWND hWnd, pBITMAPHANDLE pBitmap, LPSTR SlicesFolder)
{
SLICEBITMAPOPTIONS Options;
SLICEBITMAPUSERINFO UserData;
L_INT nRet;
L_CHAR S[30] = TEXT("");
L_CHAR Message[512] = TEXT("");

Options.uStructSize = sizeof(SLICEBITMAPOPTIONS);
// Deskew the sliced image, the deskew angle is located between -5 and 5 degrees
Options.uFlags = SLC_DESKEW|SLC_DSKW_LINEAR|SLC_CUTSLICES;
Options.uMaxDeskewAngle = 500;
Options.crFill = RGB(0,0,0);

memcpy(UserData.SlicesFolder, SlicesFolder, L_MAXPATH);
UserData.SlicesCount = 0;

nRet = L_SliceBitmap(pBitmap, &Options, NULL, ExampleSliceCB, (L_VOID L_FAR *)(&UserData));
if(nRet == SUCCESS)
{
lstrcpy(Message, TEXT("The number of sliced image is"));
wsprintf(S, TEXT("%d"), (UserData.SlicesCount));
strcat(Message, S );
MessageBox(hWnd, Message, TEXT("SliceBitmap Example"), MB_OK);
}
}


L_SmoothBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SmoothBitmap(pBitmap, pSmooth, pfnCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPSMOOTH pSmooth; | /* pointer to a structure */
SMOOTHCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Smooths the bumps and fills in the nicks of a 1-bit black and white image.

This function is available in the Document/Medical Toolkits.``

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to smooth.
pSmooth | Pointer to the SMOOTH structure that LEADTOOLS uses to perform the smoothing operation
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in SMOOTHCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

(Document) This function smooths the text in scanned text documents. The behavior of this function can be modified by using its callback.

This function works only on 1-bit black and white images.

If a region is selected, only the selected region will be changed by this function. If no region is selected, the whole image will be processed.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | SMOOTHCALLBACK, L_LineRemoveBitmap, L_BorderRemoveBitmap, L_InvertedTextBitmap, L_DotRemoveBitmap, L_HolePunchRemoveBitmap, L_HolesRemovalBitmapRgn
Topics: | Cleaning Up 1-Bit Images

Example

//Smooth
//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 returned showing all the changes
//A callback is used to display information about bump or nick
//The callback does NOT return a region

L_INT L_EXPORT EXT_CALLBACK ExampleSmoothCB(
L_UINT32 uBumpOrNick,
L_INT32 iStartRow,
L_INT32 iStartCol,
L_INT32 iLength,
L_UINT32 uHorV,
L_VOID L_FAR *pUserData
)
{
L_TCHAR szMsg[200];
L_TCHAR L_FAR* pszBumpOrNick, *pszHorV;

switch (uBumpOrNick)
{
case SMOOTH_BUMP:
pszBumpOrNick = TEXT("Bump");
break;

case SMOOTH_NICK:
pszBumpOrNick = TEXT("Nick");
break;
}

if (uHorV == SMOOTH_HORIZONTAL_ELEMENT)
{
pszHorV = TEXT("Horizontal");
}
else
{
pszHorV = TEXT("Vertical");
}

//Note: no hRgn to delete because it was not requested
wsprintf(
szMsg,
TEXT("Type[%s]\tRow Col[%d, %d]\tLength[%d]\t[%s]\n"),
pszBumpOrNick,
iStartRow,
iStartCol,
iLength,
pszHorV);
OutputDebugString(szMsg);
return SUCCESS_REMOVE;
}

L_VOID ExampleSmooth(pBITMAPHANDLE pBitmap)
{
L_INT32 nRet;
BITMAPHANDLE BitmapRegion;
SMOOTH sm;

memset(&BitmapRegion, 0, sizeof(BITMAPHANDLE));

sm.uStructSize = sizeof(SMOOTH);
sm.iLength = 2;
sm.pBitmapRegion = &BitmapRegion;
sm.uFlags = SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION | SMOOTH_FAVOR_LONG;

nRet = L_SmoothBitmap(
pBitmap,
&sm,
(SMOOTHCALLBACK)(ExampleSmoothCB),
NULL
);

if (nRet == SUCCESS)
{
RECT rectRgn;

//Delete the existing region
L_FreeBitmapRgn(pBitmap);

L_GetBitmapRgnBounds(sm.pBitmapRegion, NULL, &rectRgn);
if (!IsRectEmpty(&rectRgn))
{
L_CopyBitmapHandle(pBitmap, sm.pBitmapRegion, sizeof(BITMAPHANDLE));
}
}

}


L_SmoothEdgesBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SmoothEdgesBitmap(pBitmap, uAmount, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmount; | /* blur size */
L_UINT uThreshold; | /* threshold value */

Smoothes the rough edges in the image.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmount | This is a percentage value that indicates blur size. 0 means no blurring and 100 means total blurring.
uThreshold | 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 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 through 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function performs edge detection, then smoothes those edges that are found. The other points of the image are unchanged.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_SolarizeBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_FragmentBitmap, L_HighPassFilterBitmap, L_UnsharpMaskBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply the Smooth Edge effect to the image*/
L_SmoothEdgesBitmap(&LeadBitmap, 75, 0);


L_SolarizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SolarizeBitmap(pBitmap, uThreshold)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uThreshold; | /* intensity threshold */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
uThreshold | Threshold at or above which colors are to be inverted. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_DlgSolarize , L_WindowLevel, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Example

/* This example loads a bitmap and solarizes it. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Solarize with threshold of 90 */
L_SolarizeBitmap(&LeadBitmap, 90 );


L_SpatialFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SpatialFilterBitmap(pBitmap, pFilter)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPSPATIALFLT pFilter; | /* pointer to the spatial filter to use */

Imposes a spatial filter on a bitmap. You can supply your own filter or use one of the predefined filters.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to be affected.
pFilter | Pointer to the spatial filter to use. For predefined filters, refer to List of Spatial Filters. To define your own filter, refer to SPATIALFLT.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

A spatial filter recomputes the brightness of each pixel in a bitmap by using a weighted averaging technique that considers the surrounding pixels. Spatial filters are used for operations such as sharpening an image or detecting edges within the image.

The L_SpatialFilterBitmap function works best with 24-bit, 16-bit, or grayscale bitmaps. If a bitmap uses a color palette, this function matches the new brightness value of each pixel to the nearest color in the existing palette.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgShiftDifferenceFilter , L_DlgGradientFilter , L_DlgLaplacianFilter , L_DlgSobelFilter , L_DlgPrewittFilter , L_DlgLineSegmentFilter , L_WindowLevel, L_SkeletonBitmap, L_CorrelationBitmap, L_HolesRemovalBitmapRgn, L_DiffuseGlowBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap
Topics: | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and applies a Prewitt edge detection filter. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply a Prewitt edge detection filter */
L_SpatialFilterBitmap(&LeadBitmap, FLT_PREWITT_HORZ );


L_SpherizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SpherizeBitmap(pBitmap, nValue, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nValue; | /* stretch amount */
POINT CenterPt; | /* sphere center */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Warps the image around a 3D spherical shape. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nValue | Amount of stretching where:
 | Positive values: stretch the central pixels toward the edges.
 | Negative values: stretch the pixels toward the Center.
 | Valid values are range in between –500 and 500.
CenterPt | POINT structure that contains the center of the sphere.
crFill | The COLORREF value that specifies the fill color for any exposed areas.
uFlags | 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 exposed sphere pattern center as selected from exposed area process type flag.
 | This flag is ignored if the nValue is negative.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will warp the image as a 3D spherical shape around the specified CenterPt. 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgSpherize , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Warp the image around 3D spherical shape around the center of the bitmap */
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_SpherizeBitmap(&LeadBitmap, 100, CenterPt, 0, FILL_RPT | FILL_WOUTROT);


L_StartCompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartCompressBuffer(pBitmap, pfnCallback, uInputBytes, uOutputBytes, pOutputBuffer, nOutputType, nQFactor, pUserData, pSaveOptions)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
COMPBUFFCALLBACK pfnCallback; | /* pointer to the callback function */
L_UINT32 uInputBytes; | /* size of user allocated input buffer */
L_UINT uOutputBytes; | /* size of user allocated output buffer */
L_UCHAR L_FAR * pOutputBuffer; | /* pointer to the output buffer */
L_INT nOutputType; | /* type of compression to use */
L_INT nQFactor; | /* compression quality factor */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Initializes the buffered compression engine. The compression is then carried out using the L_CompressBuffer function. It is ended by the L_EndCompressBuffer function.

Parameter | Description
pBitmap | Pointer to the bitmap handle that describes the image to compress. The following fields must be set correctly in the bitmap handle: Width, Height, and BitsPerPixel. This allows the compression process to know what type of image it is trying to compress.
pfnCallback | Pointer to the callback function. This function is responsible for writing or handling the compressed data. The callback function must adhere to the function prototype described in COMPBUFFCALLBACK.
 | This callback function must return SUCCESS or an error code (negative number). If it returns an error code, the compression process will stop, and the code will be passed back as the return code for L_CompressBuffer.
uInputBytes | The size of user allocated buffer that will hold the raw data. This has to be a multiple of 8 lines or 16 lines depending on the output compression method specified. For LEAD1JTIF, LEAD1JFIF, or any LEAD Qfactor that is greater than 100, or a predefined setting of MC, SQT, or MCQ, you must allocate 16-line multiples. For all other compression factors and methods, manually set or predefined, 8-line multiples are required.
 | To simplify your coding, you can always allocate 16-line multiples.
uOutputBytes | The size of user allocated compressed buffer.
pOutputBuffer | Pointer to user output buffer that will hold the compressed data.
nOutputType | Type of compression to use. Valid values are:
 | Value | Meaning
 | LEAD | [0] LEAD CMP compression format.
 | JFIF | [1] JPEG File Interchange Format using YUV 4:4:4 color spacing.
 | LEAD2JFIF | [5] JPEG File Interchange Format using YUV 4:2:2 color spacing.
 | LEAD1JFIF | [3] JPEG File Interchange Format using YUV 4:1:1 color spacing.
 | JTIF | [2] JPEG JTIF using YUV 4:4:4 color spacing.
 | LEAD2JTIF | [6] JPEG JTIF using YUV 4:2:2 color spacing.
 | LEAD1JTIF | [4] JPEG JTIF using YUV 4:1:1 color spacing.
nQFactor | 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.
 | Alternatively, for LEAD CMP compression only, LEADTOOLS provides enhanced Q factors which are defined as follows:
 | Value | Meaning
 | PQ1 | [1] Perfect Quality compression Option 1.
 | PQ2 | [2] Perfect Quality compression Option 2.
 | QFS | [3] Quality Far more important than Size.
 | QMS | [4] Quality More important than Size.
 | QS | [5] Quality and Size are equally important.
 | SQS | [6] Size more important than Quality - Sharp.
 | SQT | [7] Size more important than Quality - less Tilling.
 | MCQ | [8] Maximum Compression, keeping quality as good as possible.
 | MC | [9] Maximum Compression.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must declare and initialize a bitmap handle before calling this function, but you do not have to allocate the bitmap. In the bitmap handle, the Order field must be ORDER_BGR, and the ViewPerspective field must be TOP_LEFT. Then, the data that you put into the input buffer must be BGR and loaded from top left.

The compression process starts after the first call to L_CompressBuffer. Your callback function is called when the output buffer is filled with compressed data or after completing the compression process. The callback function is responsible for emptying the output buffer — storing it, sending it, or doing other processing.

Your program must allocate the output buffer. The following is a flow chart that shows the relationship of these functions:

Do not free any buffers that the compression engine uses until after you call the L_EndCompressBuffer function.

This function 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 function.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CompressBuffer, L_EndCompressBuffer
Topics: | Raster Image Functions: Saving Files

Example

For complete sample code, refer to the COMPCB example5Example.

/****************************************************************************************
This example demonstrates low-level image compression using L_StartCompressBuffer,
L_CompressBufferL_CompressBuffer, and L_EndCompressBufferL_EndCompressBuffer. The callback function for writing the
output is included at the end of the example.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
COMPBUFFCALLBACK lpfnCallBack;

/* Prototype for the COMPBUFFCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK FileWrite (pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR * pBuffer, L_UINT nBytes,
L_VOID L_FAR * pParams);
/****************************************************************************************/
void TestFunction(void)
{
L_INT i, j; /* Loop counters */
L_INT hFD; /* File handle */
L_UINT32 uLineBytes; /* Bytes per line in the input buffer */
HGLOBAL hInBuffer; /* Input buffer handle */
HGLOBAL hOutBuffer; /* Output buffer handle */
L_UCHAR L_FAR *lpInBuffer; /* Pointer to the input buffer */
L_UCHAR L_FAR *lpOutBuffer; /* Pointer to the output buffer */
L_UCHAR L_FAR *lpDataBuffer; /* Copy of the pointer to the input buffer */
/* Load the image to the bitmap at 24-bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
if(LeadBitmap.ViewPerspective != TOP_LEFT)
L_ChangeBitmapViewPerspective ( NULL, &LeadBitmap, sizeof(BITMAPHANDLE), TOP_LEFT );
/* Create the output file */
#ifdef UNICODE

hFD = _wcreat(TEXT("COMPCB.CMP"), 0);

#else

hFD = _lcreat("COMPCB.CMP", 0);

#endif

/* Calculate the bytes per line in the input buffer, without padding */
uLineBytes = LeadBitmap.Width * 3;
/* Allocate memory for the incoming uncompressed data. Note that we
are compressing 16 lines at a time. You should always use multiples of 16 */
hInBuffer = GlobalAlloc( GMEM_MOVEABLE, 16 * uLineBytes);
lpInBuffer = (L_UCHAR L_FAR *)GlobalLock( hInBuffer );
/* Allocate an output buffer. This is where the compressed data will
go. Note that this allocates 1024-byte packets. */
hOutBuffer = GlobalAlloc( GMEM_MOVEABLE, 1024 );
lpOutBuffer = (L_UCHAR L_FAR *)GlobalLock( hOutBuffer );
/* Set the callback function*/
lpfnCallBack = (COMPBUFFCALLBACK) MakeProcInstance(
(FARPROC) FileWrite, hInst );
/* Lock down the bitmap */
L_AccessBitmap( &LeadBitmap );
/* Initialize the compression engine */
L_StartCompressBuffer( &LeadBitmap,
lpfnCallBack,
16 * uLineBytes,
1024,
(L_CHAR L_FAR *)lpOutBuffer,
LEAD,
QFS,
(L_VOID L_FAR*) &hFD, NULL );
/* Compress the data */
for( i = 0; i < LeadBitmap.Height; ) /* i is incremented at the end */
{
lpDataBuffer = lpInBuffer;
/* Compression of the 16-line chunk starts here */
for( j = 0; (i+j) < LeadBitmap.Height && j < 16; j++ )
{
/* Get one line at time */
L_GetBitmapRow(&LeadBitmap, lpDataBuffer, i+j, uLineBytes);
/* Move the pointer to next line */
lpDataBuffer = lpDataBuffer + uLineBytes;
}
/* This is the main function that will do the actual Compression. */
L_CompressBuffer(lpInBuffer);
i += 16;
}

/* Reset the compression engine */
L_EndCompressBuffer();
/* Free the callback function*/
FreeProcInstance((FARPROC) lpfnCallBack);
/* Free all allocated memory. Release the bitmap. Close the file. */
GlobalUnlock( hInBuffer );
GlobalFree( hInBuffer );
GlobalUnlock( hOutBuffer );
GlobalFree( hOutBuffer );
L_ReleaseBitmap( &LeadBitmap );
_lclose( hFD );

MessageBox (NULL, TEXT("Function complete - Look at COMPCB.CMP"), TEXT("Notice"), MB_OK);
return;
}

/* Callback function for L_StartCompressBuffer */

L_INT L_EXPORT EXT_CALLBACK FileWrite (pBITMAPHANDLE pBitmap, L_UCHAR L_FAR * pBuffer,
L_UINT uBytes, L_VOID L_FAR * pParams)
{
UNREFERENCED_PARAMETER (pBitmap);
/* Write data to the file. Note that the file handle is passed in as an L_VOID
L_FAR pointer as per the LEAD definition and must be cast appropriately
to use it as a file handle. */
_lwrite (*(L_INT L_FAR *) pParams, (L_CHAR *)pBuffer, uBytes);
return (SUCCESS);
}


L_StartDecompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartDecompressBuffer(phDecompress, pStartDecompressData)

HGLOBAL phDecompress; | /* pointer to the decompression handle */
pSTARTDECOMPRESSDATA pStartDecompressData; | /* pointer to a structure */

Initializes the buffered decompression engine. The decompression is then carried out using the L_DecompressBuffer function. It is ended by the L_StopDecompressBuffer function.

Parameter | Description
phDecompress | Pointer to the handle that identifies the decompression process.
pStartDecompressData | Pointer to a structure that contains information about the decompression process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must declare a handle of type HGLOBAL before calling this function. Pass the address of this handle to this function and the function will initialize the handle.

If this function is called for an unsupported format, it will return ERROR_INV_PARAMETER.

Currently, raw JPEG must contain all the Huffman tables encoded. That is, it must be a readable JPEG file.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_DecompressBuffer, L_StopDecompressBuffer, L_StartCompressBuffer, L_CompressBuffer, L_EndCompressBuffer
Topics: | Compressing and Decompressing Buffers
 | Raster Image Functions: Low-Level Decompression

Example

#include <fcntl.h>
#include <io.h>

#define TAG_STRIPOFFSETS 0x111
#define TAG_STRIPBYTECOUNTS 0x117
#define TAG_ROWSPERSTRIP 0x116
#define MAX_STRIPS 1000

// Returns maximum index
L_INT ReadTag(L_TCHAR *pszFileName, L_UINT16 uTag, int StripArray[])
{
L_UINT16 uType;
L_UINT32 uCount;

L_ReadFileTag(pszFileName, uTag, &uType, &uCount, StripArray, NULL);
return uCount;
}

// Example 1
// This sample loads raw data from packbits.tif
// packbits.tif is a 24-bit tif packbits compressed file
// packbits.tif has 46 strips of packbits data
// The strip information is obtained by reading the TIF tags TAG_STRIPOFFSETS and TAG_STRIPBYTECOUNTS
// The strips are directly read and fed to the L_Compress APIs
static L_VOID LoadRawPackbitsStrips()
{
L_TCHAR *szFileName = TEXT("e:\\images\\packbits.tif");
L_INT fd;
L_CHAR *pBuf = NULL;
BITMAPHANDLE Bitmap;
L_INT nRet = SUCCESS;
FILEINFO TempFileInfo;
long nRowsPerStrip=0;
STARTDECOMPRESSDATA StartDecompressData;
DECOMPRESSDATA DecompressData;
L_INT nIndex = 0;
HGLOBAL hDecompress;
int StripOffsets[MAX_STRIPS];
int StripSizes[MAX_STRIPS];
int nMaxIndex;

TempFileInfo.uStructSize = sizeof(TempFileInfo);
L_FileInfo (szFileName, &TempFileInfo, sizeof(FILEINFO), 0, NULL);

//******************************
//*** L_StartDecompressBuffer
//******************************
memset(&StartDecompressData, 0, sizeof(STARTDECOMPRESSDATA) );
memset(&DecompressData, 0, sizeof(DECOMPRESSDATA) );

StartDecompressData.uStructSize = sizeof(STARTDECOMPRESSDATA);
StartDecompressData.pBitmap = &Bitmap;
StartDecompressData.uBitmapStructSize = sizeof(BITMAPHANDLE);
StartDecompressData.uStripsOrTiles = DECOMPRESS_STRIPS;
StartDecompressData.uFormat = FILE_RAW_PACKBITS;
StartDecompressData.nWidth = TempFileInfo.Width;
StartDecompressData.nHeight = TempFileInfo.Height;
StartDecompressData.nBitsPerPixel = TempFileInfo.BitsPerPixel;
StartDecompressData.nViewPerspective = TempFileInfo.ViewPerspective;
StartDecompressData.nRawOrder = TempFileInfo.Order;
StartDecompressData.nLoadOrder = ORDER_BGRORGRAY;
StartDecompressData.nXResolution = TempFileInfo.XResolution;
StartDecompressData.nYResolution = TempFileInfo.YResolution;
StartDecompressData.pfnReadCallback = NULL;
StartDecompressData.uFlags = 0;
StartDecompressData.pUserData = NULL;

StartDecompressData.nPhotoInt = 2; // TIFF tag 0-6 WhiteIsZero(0) BlackIsZero(1) RGB(2)

L_StartDecompressBuffer(&hDecompress, &StartDecompressData);

//******************************
//*** L_DecompressBuffer
//******************************

nMaxIndex = ReadTag(szFileName, TAG_STRIPOFFSETS, StripOffsets);
ReadTag(szFileName, TAG_STRIPBYTECOUNTS, StripSizes);
ReadTag(szFileName, TAG_ROWSPERSTRIP, &nRowsPerStrip);

#ifdef UNICODE

fd = _wopen(szFileName, _O_RDONLY);

#else

fd = _open(szFileName, _O_RDONLY);

#endif

DecompressData.nRow = 0;//Note--this field is ignored for strips
for (nIndex = 0; nIndex < nMaxIndex; nIndex++)
{
//seek to the first strip
_lseek(fd, StripOffsets[nIndex], 0);
pBuf = (char *)malloc(StripSizes[nIndex]);
_read(fd, pBuf, StripSizes[nIndex]);

DecompressData.uStructSize = sizeof(DECOMPRESSDATA);
DecompressData.pBuffer = pBuf; //pointer to raw data
DecompressData.nWidth = TempFileInfo.Width; //Width of uncompressed strip/tile
DecompressData.nHeight = nRowsPerStrip; //Height of uncompressed strip/tile
if (nIndex == (nMaxIndex - 1 ))
{
//fewer rows per strip
DecompressData.nHeight = TempFileInfo.Height - (nMaxIndex - 1) * nRowsPerStrip;
}

DecompressData.uOffset = 0; //Offset of strip relative to buffer
DecompressData.nBufferSize = StripSizes[nIndex];//Size of strip after compression
DecompressData.nCol = 0; //Col offset of tile
DecompressData.uFlags = DECOMPRESS_CHUNK_COMPLETE,
DecompressData.nReserved1 = 0; //Reserved for future use

L_DecompressBuffer ( hDecompress, &DecompressData);

free(pBuf);
}

_close(fd);

//******************************
//*** L_StopDecompressBuffer
//******************************
L_StopDecompressBuffer (hDecompress);

// Bitmap contains the uncompressed bitmap
L_SaveBitmap (TEXT("e:\\erase\\Uncompressed.bmp"), &Bitmap, FILE_BMP, 24, 0, NULL);
}

// Example 2
// This sample is similar to LoadRawPackbitsStrips(), except the data
// is fed to L_Decompress APIs as tiles instead of strips and the image
// created is 4x the size of the original image, consisting of four of the original images
// This sample loads raw data from packbits.tif
// packbits.tif is a 24-bit tif packbits compressed file
// packbits.tif has 46 strips of packbits data
// The strip information is obtained by reading the TIF tags TAG_STRIPOFFSETS and TAG_STRIPBYTECOUNTS
// The strips are directly read and fed to the L_Compress APIs
static L_VOID LoadRawPackbitsTiles()
{
L_TCHAR *szFileName = TEXT("e:\\images\\packbits.tif");
L_INT fd;
L_CHAR *pBuf = NULL;
BITMAPHANDLE Bitmap;
L_INT nRet = SUCCESS;
FILEINFO TempFileInfo;
long nRowsPerStrip=0;
STARTDECOMPRESSDATA StartDecompressData;
DECOMPRESSDATA DecompressData;
L_INT nIndex = 0;
HGLOBAL hDecompress;
L_INT nCurrentRow = 0;
int StripOffsets[MAX_STRIPS];
int StripSizes[MAX_STRIPS];
int nMaxIndex;

TempFileInfo.uStructSize = sizeof(TempFileInfo);
L_FileInfo (szFileName, &TempFileInfo, sizeof(FILEINFO), 0, NULL);

//******************************
//*** L_StartDecompressBuffer
//******************************
memset(&StartDecompressData, 0, sizeof(STARTDECOMPRESSDATA) );
memset(&DecompressData, 0, sizeof(DECOMPRESSDATA) );

StartDecompressData.uStructSize = sizeof(STARTDECOMPRESSDATA); // For versioning
StartDecompressData.pBitmap = &Bitmap;
StartDecompressData.uBitmapStructSize = sizeof(BITMAPHANDLE);
StartDecompressData.uStripsOrTiles = DECOMPRESS_TILES;
StartDecompressData.uFormat = FILE_RAW_PACKBITS;
StartDecompressData.nWidth = TempFileInfo.Width * 2; //
StartDecompressData.nHeight = TempFileInfo.Height * 2; //
StartDecompressData.nBitsPerPixel = TempFileInfo.BitsPerPixel; //
StartDecompressData.nViewPerspective = TempFileInfo.ViewPerspective; //
StartDecompressData.nRawOrder = TempFileInfo.Order; // ORDER_RGB, ORDER_BGR
StartDecompressData.nLoadOrder = ORDER_BGRORGRAY; // ORDER_RGB, ORDER_BGR
StartDecompressData.nXResolution = TempFileInfo.XResolution;
StartDecompressData.nYResolution = TempFileInfo.YResolution;
StartDecompressData.pfnReadCallback = NULL; // optional callback function
StartDecompressData.uFlags = 0; // DECOMPRESS_LSB, DECOMPRESS_PAD4, DECOMPRESS_WHITEONBLACK, DECOMPRESS_PALETTE
StartDecompressData.pUserData = NULL; //

StartDecompressData.nPhotoInt = 2; // TIFF tag 0-6 WhiteIsZero(0) BlackIsZero(1) RGB(2)
//StartDecompressData.nPlanarConfig; // TIFF tag 1 = Chunky, 2 = Planar format

L_StartDecompressBuffer(&hDecompress, &StartDecompressData);

//******************************
//*** L_DecompressBuffer
//******************************

nMaxIndex = ReadTag(szFileName, TAG_STRIPOFFSETS, StripOffsets);
ReadTag(szFileName, TAG_STRIPBYTECOUNTS, StripSizes);
ReadTag(szFileName, TAG_ROWSPERSTRIP, &nRowsPerStrip);

#ifdef UNICODE

fd = _wopen(szFileName, _O_RDONLY);

#else

fd = _open(szFileName, _O_RDONLY);

#endif

nCurrentRow = 0;
for (nIndex = 0; nIndex < nMaxIndex; nIndex++)
{
//seek to the first strip
_lseek(fd, StripOffsets[nIndex], 0);
pBuf = (char *)malloc(StripSizes[nIndex]);
_read(fd, pBuf, StripSizes[nIndex]);

DecompressData.uStructSize = sizeof(DECOMPRESSDATA);
DecompressData.pBuffer = pBuf; //pointer to raw data
DecompressData.nWidth = TempFileInfo.Width; //Width of uncompressed strip/tile
DecompressData.nHeight = nRowsPerStrip; //Height of uncompressed strip/tile
if (nIndex == (nMaxIndex - 1 ))
{
//fewer rows per strip
DecompressData.nHeight = TempFileInfo.Height - (nMaxIndex - 1) * nRowsPerStrip;
}

DecompressData.uOffset = 0; //Offset of strip relative to buffer
DecompressData.nBufferSize = StripSizes[nIndex]; //Size of strip after compression
DecompressData.nRow = nCurrentRow; //Row offset of tile
DecompressData.nCol = 0; //Col offset of tile
DecompressData.uFlags = DECOMPRESS_CHUNK_COMPLETE,
DecompressData.nReserved1 = 0; //Reserved for future use

//Strips in upper left corner
L_DecompressBuffer ( hDecompress, &DecompressData);

//Strips in upper right corner
DecompressData.nRow = nCurrentRow;
DecompressData.nCol = TempFileInfo.Width;
L_DecompressBuffer( hDecompress, &DecompressData);

//Strips in lower left corner
DecompressData.nRow = TempFileInfo.Height + nCurrentRow;
DecompressData.nCol = 0;
L_DecompressBuffer( hDecompress, &DecompressData);

//Strips in lower right corner
DecompressData.nRow = TempFileInfo.Height + nCurrentRow;
DecompressData.nCol = TempFileInfo.Width;
L_DecompressBuffer( hDecompress, &DecompressData);

free(pBuf);

nCurrentRow += DecompressData.nHeight;
}

_close(fd);

//******************************
//*** L_StopDecompressBuffer
//******************************
L_StopDecompressBuffer(hDecompress);

// Bitmap contains the uncompressed bitmap
L_SaveBitmap(TEXT("e:\\erase\\Uncompressed.bmp"), &Bitmap, FILE_BMP, 24, 0, NULL);
}

// Example 3
// This sample loads raw data from eagleccittg3.tif
// This file is a tif ccitt group3 compressed with a single strip
// The strip information is obtained by reading the TIF tags TAG_STRIPOFFSETS and TAG_STRIPBYTECOUNTS
// The strip is directly read and fed to the L_Decompress APIs
static L_VOID LoadRawCCITT31DStrips()
{
L_TCHAR *szFileName = TEXT("e:\\images\\eagleccittg3.tif");

L_INT fd;
L_CHAR *pBuf = NULL;
BITMAPHANDLE Bitmap;
L_INT nRet = SUCCESS;
FILEINFO TempFileInfo;
long nRowsPerStrip=0;
STARTDECOMPRESSDATA StartDecompressData;
DECOMPRESSDATA DecompressData;
L_INT nIndex = 0;
HGLOBAL hDecompress;
int StripOffsets[MAX_STRIPS];
int StripSizes[MAX_STRIPS];
int nMaxIndex;

TempFileInfo.uStructSize = sizeof(TempFileInfo);
L_FileInfo(szFileName, &TempFileInfo, sizeof(FILEINFO), 0, NULL);

//******************************
//*** L_StartDecompressBuffer
//******************************
memset(&StartDecompressData, 0, sizeof(STARTDECOMPRESSDATA) );
memset(&DecompressData, 0, sizeof(DECOMPRESSDATA) );

StartDecompressData.uStructSize = sizeof(STARTDECOMPRESSDATA);
StartDecompressData.pBitmap = &Bitmap;
StartDecompressData.uBitmapStructSize = sizeof(BITMAPHANDLE);
StartDecompressData.uStripsOrTiles = DECOMPRESS_TILES;
StartDecompressData.uFormat = FILE_FAX_G3_1D;
StartDecompressData.nWidth = TempFileInfo.Width;
StartDecompressData.nHeight = TempFileInfo.Height;
StartDecompressData.nBitsPerPixel = TempFileInfo.BitsPerPixel;
StartDecompressData.nViewPerspective = TempFileInfo.ViewPerspective;
StartDecompressData.nRawOrder = TempFileInfo.Order; // ORDER_RGB, ORDER_BGR
StartDecompressData.nLoadOrder = ORDER_BGRORGRAY;
StartDecompressData.nXResolution = TempFileInfo.XResolution;
StartDecompressData.nYResolution = TempFileInfo.YResolution;
StartDecompressData.pfnReadCallback = NULL;

StartDecompressData.uFlags = 0;
StartDecompressData.pUserData = NULL; //
StartDecompressData.nPhotoInt = 0; // TIFF tag 0-6 TIFF tag 0=WhiteIsZero, 1=BlackIsZero

L_StartDecompressBuffer(&hDecompress, &StartDecompressData);

//******************************
//*** L_DecompressBuffer
//******************************

nMaxIndex = ReadTag(szFileName, TAG_STRIPOFFSETS, StripOffsets);
nMaxIndex = ReadTag(szFileName, TAG_STRIPBYTECOUNTS, StripSizes);
ReadTag(szFileName, TAG_ROWSPERSTRIP, &nRowsPerStrip);

#ifdef UNICODE

fd = _wopen(szFileName, _O_RDONLY);

#else

fd = _open(szFileName, _O_RDONLY);

#endif

DecompressData.nRow = 0; //This field is ignored with strips
for (nIndex = 0; nIndex < nMaxIndex; nIndex++)
{
//seek to the first strip
_lseek(fd, StripOffsets[nIndex], 0);
pBuf = (char *)malloc(StripSizes[nIndex]);
_read(fd, pBuf, StripSizes[nIndex]);

DecompressData.uStructSize = sizeof(DECOMPRESSDATA);
DecompressData.pBuffer = pBuf; //pointer to raw data
DecompressData.nWidth = TempFileInfo.Width; //Width of uncompressed strip/tile
DecompressData.nHeight = nRowsPerStrip; //Height of uncompressed strip/tile
if (nIndex == (nMaxIndex - 1 ))
{
//fewer rows per strip
DecompressData.nHeight = TempFileInfo.Height - (nMaxIndex - 1) * nRowsPerStrip;
}

DecompressData.uOffset = 0; //Offset of strip relative to buffer
DecompressData.nBufferSize = StripSizes[nIndex];//Size of strip after compression
DecompressData.nCol = 0; //Col offset of tile
DecompressData.uFlags = DECOMPRESS_CHUNK_COMPLETE;
DecompressData.nReserved1 = 0; //Reserved for future use

L_DecompressBuffer( hDecompress, &DecompressData);

free(pBuf);
}

_close(fd);

//******************************
//*** L_StopDecompressBuffer
//******************************
L_StopDecompressBuffer(hDecompress);

// Bitmap contains the uncompressed bitmap
L_SaveBitmap(TEXT("e:\\erase\\Uncompressed.bmp"), &Bitmap, FILE_BMP, 24, 0, NULL);
}


L_StartDithering

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartDithering(pBitmap, pPalette, uColors)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRGBQUAD pPalette; | /* pointer to the palette */
L_UINT uColors; | /* number of colors used in the palette */

Initializes the buffered dithering of a bitmap. The dithering is then carried out by the L_DitherLine function and a function that you supply. It is ended by the L_StopDithering function. (Dithering is the process of using error diffusion to reduce the number of colors in an image.)

Parameter | Description
pBitmap | Pointer to the bitmap handle that has all the information about the input image. The bitmap does not have to exist, but the information must be complete. The DitheringMethod field in the bitmap handle specifies the dithering method to be used for color reduction.
pPalette | Pointer to the palette that the L_DitherLine function will use for dithering. You can specify your own palette, or use NULL for LEAD's fixed palette.
uColors | Number of colors used in the palette. If the palette contains more colors, only the first uColors colors are used. Valid values are 2 to 256.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The following flow chart shows how the functions relate to each other:

Before calling this function, the following fields must be specified in the bitmap handle:

Bitmap.Width

Bitmap.Height

Bitmap.BitsPerPixel

Bitmap.ColorOrder — if BitsPerPixel is greater than 8

Bitmap.DitheringMethod — if BitsPerPixel is less than 16

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertBuffer, L_DitherLine, L_StopDithering
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

/* This example dithers each line in one bitmap and writes it to another bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
void TestFunction(void)
{
L_UCHAR L_FAR *pInBuf; /* Buffer to hold the input row */
HGLOBAL hInBuf; /* Handle to the input buffer */
L_UCHAR L_FAR *pOutBuf; /* Buffer to hold the output row */
HGLOBAL hOutBuf; /* Handle to the output buffer */
BITMAPHANDLE TmpBitmap; /* Bitmap containing input data */
RGBQUAD FixedPalette[256]; /* Fixed palette */
int i; /* Loop counter */
/* Load the input bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Allocate the input buffer for 24-bit data */
hInBuf = GlobalAlloc(GMEM_MOVEABLE, TmpBitmap.Width * 3);
pInBuf = (L_UCHAR L_FAR *)GlobalLock( hInBuf );
/* Allocate the output buffer for 8-bit data */
hOutBuf = GlobalAlloc(GMEM_MOVEABLE, TmpBitmap.Width);
pOutBuf = (L_UCHAR L_FAR *)GlobalLock( hOutBuf );
/* Get the LEAD fixed palette for an 8-bit image */
L_GetFixedPalette(FixedPalette, 8);
/* Create the new bitmap */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE), TYPE_CONV,
TmpBitmap.Width,
TmpBitmap.Height,
8, /* 8 bits per pixel */
0, /* Color order is not used */
NULL, /* Use the fixed palette */
TmpBitmap.ViewPerspective, NULL, 0);
/* Set the dithering method */
TmpBitmap.DitheringMethod = STEVENSON_ARCE_DITHERING;
/* Initialize the dithering process */
L_StartDithering(&TmpBitmap, FixedPalette, 256);
/* Use L_DitherLine to process each row in the bitmap */
L_AccessBitmap(&LeadBitmap);
L_AccessBitmap(&TmpBitmap);
for(i=0; i < TmpBitmap.Height; i++)
{
L_GetBitmapRow(&TmpBitmap, pInBuf, i, TmpBitmap.BytesPerLine);
L_DitherLine(&TmpBitmap, pInBuf, pOutBuf);
L_PutBitmapRow(&LeadBitmap, pOutBuf, i, LeadBitmap.BytesPerLine);
}
L_ReleaseBitmap(&TmpBitmap);
L_ReleaseBitmap(&LeadBitmap);
/* End the dithering process */
L_StopDithering(&TmpBitmap);
/* Free memory that we no longer need */
GlobalFree(hInBuf);
GlobalFree(hOutBuf);
return;
}


L_StartFeedLoad

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartFeedLoad(pBitmap, uStructSize, nBitsPerPixel, nOrder, uFlags, pfnCallback, pUserData, phLoad, pLoadOptions, pFileInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine the behavior of L_FeedLoad */
FILEREADCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
HGLOBAL L_FAR * phLoad; | /* handle that identifies the loading process */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Initializes a file-load process in which you control the input stream. You must call the L_FeedLoad function to supply buffered data, and you must call L_StopFeedLoad when the loading is complete.

Parameter | Description
pBitmap | Pointer to the bitmap handle to load the image to.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images.
 | 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

nOrder | The desired color order. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] Red-green-blue order.
 | ORDER_BGR | [1] Blue-green-red order.
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | 0 | The data is 8 bits per pixel or less.
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
uFlags | Binary flags that determine the behavior of L_FeedLoad. You can specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap.
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_FIXEDPALETTE | [0x0004] This flag will force a palletized image to be dithered to a fixed palette.
 | LOADFILE_NOINTERLACE | [0x0008] The function passes image data in the order that is displayed, regardless of how it is stored in the file. (Set this flag if your program does not handle interlaced file formats.)
 | LOADFILE_ALLPAGES | [0x0010] The function loads all pages of a multi-page file. Use this flag only if you are creating a bitmap list using the L_AppendPlayback function.
 | LOADFILE_COMPRESSED | [0x0040] (Document/Medical only) If possible, load the file as a 1-bit RLE-compressed image. For more information, refer to Speeding Up 1-Bit Documents.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in FILEREADCALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
phLoad | Handle that identifies the loading process. Use this handle with the L_FeedLoad and L_StopFeedLoad functions.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options.
pFileInfo | Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.
 | If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.
 | If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.
 | If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.
 | Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This file-load process is useful when receiving transmitted images, such as those on the Internet. It works the same way as the L_LoadFile function, except that your code supplies the image data. The file-load process works as follows:

1. | You call the L_StartFeedLoad function to initialize the file-load process and identify the process with a handle (phLoad).
2. | You create a buffer, and each time you fill it with information, you call the L_FeedLoad function, 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 L_LoadFile function. It allocates and begins loading the bitmap, according to the flags that you specify in the L_StartFeedLoad function. It calls your callback function, if one is specified, whenever it has enough data in its input buffer.
 | The file-load process does not update information in the bitmap handle until it has received enough information to do so. (Usually, the information, such as the bitmap height and width, is in the file header.) The file-load process will make the first call to your callback function whenever this information is available.
4. | To end the file-load process, you call the L_StopFeedLoad function, which cleans up the process. If you call this function 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.

ORDER_GRAY is only valid for 12 and 16-bit grayscale images. Support for 12 and 16-bit grayscale images is only available in the Document/Medical Imaging editions .

This function cannot be used in combination with L_RedirectIO.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FeedLoad, L_StopFeedLoad, L_ChangeBitmapHeight
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For complete sample code, refer to the FEEDLOAD example.

/****************************************************************************************
This example demonstrates the feed-load feature by using the Windows
GetTickCount function to simulate receiving a transmitted image.
This example also uses a callback function to implement a
paint-while-load feature. Refer to the FILEREADCALLBACK
function to see how the callback function paints the image data.

The sample code uses the following global declarations: */

HINSTANCE hInst; /* Current instance of the application, set by the InitInstance function */
RECT rClientSize; /* RECT for the client area */
RECT rLeadDest; /* Destination rectangle for painting */
RECT rLeadSource; /* Source rectangle for painting */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
FILEINFO FileInfo; /* LEAD File Information structure. */

/* Structure used for the callback function's user data */
typedef struct tagIMAGECBPARM
{
HWND hwnd; /* Current window */
HDC hdc; /* Device context for the current window */
} IMAGECBPARM;

/* Prototype for the FILEREADCALLBACK function */
L_INT L_EXPORT EXT_CALLBACK LoadImageCB(pFILEINFO pFileInfo, pBITMAPHANDLE pBitmap,
L_UCHAR L_FAR *pBuffer,
L_UINT uFlags, L_INT nRow, L_INT nLines, IMAGECBPARM L_FAR* pUserData ); /****************************************************************************************/
void TestFunction(HWND hWnd)
{
HFILE hf; /* File handle */
HGLOBAL hLoad; /* Handle that identifies the loading process */
L_UCHAR cBuf[1024]; /* Buffer for receiving data */
L_INT nRead; /* Amount of data read in one pass of the reading loop */
L_UINT32 dwBaseTime; /* Value of the first call to GetTickCount */
L_UINT32 dwReceiveTotal; /* Data received so far from the simulated transmission */
L_UINT32 dwReceiveRead; /* Data actually processed so far */
static IMAGECBPARM UserData; /* Structure used for the callback function's user data */
FILEREADCALLBACK lpfnCallBack;
/* Initialize variables used for simulating an incoming transmission */
dwBaseTime = GetTickCount();
dwReceiveTotal = 0;
dwReceiveRead = 0;
/* Open the file to be read */

#ifdef UNICODE

hf = _wopen (TEXT("IMAGE3.CMP"), OF_READ);
#else

hf = _lopen ("IMAGE3.CMP", OF_READ);
#endif

/* Get the client area of the window. We assume that elsewhere in the program, the
L_FileInfo function has been used to update the FileInfo structure and that the
window dimensions have been adjusted to the bitmap's aspect ratio. */
GetClientRect(hWnd,&rClientSize);
/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;
/* Set the user data used for the callback in the L_StartFeedLoad function */
UserData.hwnd = hWnd; /* Current window */
UserData.hdc = GetDC( hWnd ); /* Device context for the current window */
/* Set the callback function for the L_StartFeedLoad function.*/
lpfnCallBack = (FILEREADCALLBACK) MakeProcInstance(
(FARPROC) LoadImageCB, hInst );
/* Initialize the file-load process */
L_StartFeedLoad (&LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE,
lpfnCallBack, &UserData, &hLoad, NULL, NULL);
/* Use the Windows GetTickCount function to simulate receiving a transmitted image */
for( ; ; )
{
/* Calculate the data received so far, using a simulated baud rate of 28800 */
dwReceiveTotal = ((GetTickCount() - dwBaseTime) * (28800 / 100) / 100);
/* Initialize the amount of data to read in this pass */
nRead = (L_INT) min(dwReceiveTotal - dwReceiveRead, (L_UINT32) sizeof(cBuf));
/* Do nothing if no data was received in this pass */
if(nRead == 0)
continue;
/* Try to read the expected amount of data from the file into cBuf */
nRead = (L_INT) _lread (hf, cBuf, nRead);
/* We are finished if nothing was read */
if(!nRead)
break;
/* Supply image data from cBuf to the file-load process */
L_FeedLoad (hLoad, cBuf, nRead);
/* Update the amount of data actually processed so far */
dwReceiveRead += (L_UINT32) nRead;
}
/* Close the file and clean up the file-load process */
_lclose (hf);
L_StopFeedLoad (hLoad);
/* Free the callback function*/
FreeProcInstance((FARPROC) lpfnCallBack);
/* Avoid an unnecessary repaint */
ValidateRect(hWnd, &rLeadDest);
return;
}


L_StartMagGlass

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartMagGlass(hWnd, pBitmap, prcDst, pMagGlassOptions, pfnCallback, pUserData)

HWND hWnd; | /* handle to a window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
RECT L_FAR* prcDst; | /* pointer to the display destination rectangle */
MAGGLASSOPTIONS L_FAR * pMagGlassOptions; | /* pointer to MagGlass options structure */
MAGGLASSCALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Starts the Magnify Glass procedure by attaching a magnifying glass to the specified window.

Parameter | Description
hWnd | Handle of the window to which to attach the Magnifying Glass.
pBitmap | Pointer to the bitmap handle that references the bitmap displayed in hWnd.
pMagGlassOptions | Pointer to a MAGGLASSOPTIONS structure which contains the options for controlling the behaviour of the Magnifying Glass.
pfnCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in MAGGLASSCALLBACK function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After calling this function, LEADTOOLS will monitor the window's messages, looking for mouse messages, and processing them by displaying a "Magnifying Glass" if and only if the MAGGLASS_MANUAL_UPDATE flag was not set.

If a callback function is passed to this function, information about the non-updated parts of the bitmap can be obtained from the callback function. This callback function 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 determine when to call L_UpdateMagGlass.

If a callback function is passed to this function, L_UpdateMagGlass must be called in order to paint the zoomed image in the Magnifying Glass display area.

If the MAGGLASS_MANUAL_UPDATE flag was set, LEADTOOLS will not handle the mouse events to manipulate the magnifying glass, so it’s the user’s responsibility to add the needed code to manipulate the magnifying glass. L_ShowMagGlass, L_SetMagGlassPos and L_UpdateMagGlassBitmap functions can be used in this case. For example: L_ShowMagGlass can be used with bShow set to TRUE to display the Magnifying glass when the mouse is pressed in the window to which the magnifying glass is attached. In addition, the L_SetMagGlassPos function can be called with the current cursor position when the mouse moves over the magnifying glass window.

Note: | Anytime the window's size changes or the bitmap changes, you should stop the Magnifying Glass procedure and re-start it, in order to update the settings.
Note: | Do not stop the Magnifying Glass procedure in response to scroll messages (WM_VSCROLL and WM_HSCROLL). Instead, call L_UpdateMagGlassRect to update the destination rectangle.

The appearance of the magnifying glass depends on the values of bEllipse, clrPen, b3D and nBorderSize. This can be seen in the table below:

Bellipse | b3D | nBorderSize | clrPen | Result
TRUE | Ignored | valid | valid | An elliptical magnifying glass of border size nBorderSize and border color clrPen.
FALSE | FALSE | valid | valid | A rectangular magnifying glass with a flat border of width nBorderSize and border color clrPen.
FALSE | TRUE | ignored | ignored | A rectangular magnifying glass with a 3D border having a set width and color.

Note:

To make use of other shapes of the Magnifying Glass use L_UpdateMagGlassShape function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_UpdateMagGlassShape, L_UpdateMagGlass, MAGGLASSCALLBACK, L_SetMagGlassPaintOptions, L_ShowMagGlass, L_SetMagGlassPos, L_UpdateMagGlassBitmap, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using Color Values in LEADTOOLS
 | Using the Zoom View

Example

/*
This sample checks to see if the Magnifying Glass was already started
using the global bConnected, and if it has, restarts the process.
This would be used in WM_SIZE or WM_xSCROLL to update the
Magnifying Glass after a change to the destination rect, rcView.
*/

L_BOOL bConnected;
/* mask out pure RED */
COLORREF gMask[]={RGB(255,0,0)};
L_INT gMaskCount = 1;
MAGGLASSOPTIONS MagGlassOpt;

L_VOID ResetMagGlass(HWND hWnd, pBITMAPHANDLE pBitmap, RECT L_FAR *prcView)
{
if(bConnected)
L_StopMagGlass(hWnd);

memset(&MagGlassOpt, 0, sizeof(MAGGLASSOPTIONS));
MagGlassOpt.uStructSize = sizeof (MAGGLASSOPTIONS);

MagGlassOpt.nWidth = 100;
MagGlassOpt.nHeight = 100;
MagGlassOpt.nZoom = 400;
MagGlassOpt.clrPen = RGB(0,0,0);
MagGlassOpt.hMagCursor = NULL;
MagGlassOpt.clrBack = RGB(128,128,128);
MagGlassOpt.bEllipse = FALSE;
MagGlassOpt.nBorderSize = 1;
MagGlassOpt.b3D = FALSE;
MagGlassOpt.uPaintFlags = 0;
MagGlassOpt.pMask = (COLORREF*)&gMask;
MagGlassOpt.uMaskCount = gMaskCount;
MagGlassOpt.uMagGlassFlags = MAGGLASS_MASK_NORMAL;
MagGlassOpt.nCrosshair = CROSSHAIR_FINE;
MagGlassOpt.bIgnoreRgn = TRUE;
MagGlassOpt.bCenter = TRUE;

L_StartMagGlass (hWnd,
pBitmap,
prcView,
&MagGlassOpt,
NULL,
NULL);
bConnected = L_WindowHasMagGlass(hWnd);
}

/*
This sample shows how you can start and stop the Magnifying Glass. It also
shows the ability to provide a callback function and how this can help you
provide the Magnifying Glass with a color buffer to update parts of the bitmap
as soon as the left button is
pressed and the mouse moves on the window.
*/

pBITMAPHANDLE pBitmap;
L_BOOL bMagGlass;
COLORREF L_FAR *pColor;
MAGGLASSOPTIONS MagGlassOpt;

/* assume that pColor is filled with the pixel colors of the non-updated parts of the bitmap when you use the LEADTOOLS Internet functions */

L_INT EXT_CALLBACK MagGlassCallback (HWND hWnd, L_INT nMaskPlaneStart, L_INT nMaskPlaneEnd, L_UCHAR L_FAR *pMaskPlane, L_INT nMaskPlaneSize, L_VOID L_FAR *pUserData)
{
L_INT nRet;
//...
//... send LEADTOOLS Internet command to fill the pColor array.
//...
nRet = L_UpdateMagGlass (hWnd, pColor, pMaskPlane, nMaskPlaneStart, nMaskPlaneEnd, TRUE);
return nRet;
}

L_VOID StartMagGlass(HWND hWnd, RECT L_FAR *prcView)
{
L_INT nRet;
COLORREF Mask[] = {RGB(255,255,255), RGB(255, 0, 0), RGB(255,64,255), RGB(0,0,255), RGB(255,255,0), RGB(0,255,0)};

if(!bMagGlass)
{
memset(&MagGlassOpt, 0, sizeof(MAGGLASSOPTIONS));
MagGlassOpt.uStructSize = sizeof (MAGGLASSOPTIONS);

MagGlassOpt.nWidth = 100;
MagGlassOpt.nHeight = 100;
MagGlassOpt.nZoom = 400;
MagGlassOpt.clrPen = RGB(0,0,0);
MagGlassOpt.hMagCursor = NULL;
MagGlassOpt.clrBack = RGB(128,128,128);
MagGlassOpt.bEllipse = FALSE;
MagGlassOpt.nBorderSize = 1;
MagGlassOpt.b3D = FALSE;
MagGlassOpt.uPaintFlags = 0;
MagGlassOpt.pMask = (COLORREF*)&Mask;
MagGlassOpt.uMaskCount = 6;
MagGlassOpt.uMagGlassFlags = MAGGLASS_MASK_NORMAL;
MagGlassOpt.nCrosshair = CROSSHAIR_FINE;
MagGlassOpt.bIgnoreRgn = TRUE;
MagGlassOpt.bCenter = TRUE;

nRet = L_StartMagGlass(hWnd,
pBitmap,
prcView,
&MagGlassOpt,
(MAGGLASSCALLBACK) (MagGlassCallback),
NULL);

if(nRet!=SUCCESS)
MessageBox(hWnd, TEXT("Error Starting MagGlass!"), TEXT("Error"), MB_OK);
else
bMagGlass = TRUE;
}
}

L_VOID StopMagGlass(HWND hWnd)
{
if(bMagGlass)
{
L_StopMagGlass(hWnd);

bMagGlass = FALSE;
}
}


L_StartResize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartResize(nOldWidth, nOldHeight, nNewWidth, nNewHeight, ppResizeData)

L_INT nOldWidth; | /* original width of the image */
L_INT nOldHeight; | /* original height of the image */
L_INT nNewWidth; | /* new width for the image */
L_INT nNewHeight; | /* new height for the image */
L_VOID L_FAR * L_FAR * ppResizeData; | /* address of a pointer for resize data */

Sets up information for the L_Resize function.

Parameter | Description
nOldWidth | Specifies the original width of the image.
nOldHeight | Specifies the original height of the image.
nNewWidth | Specifies the new width for the image.
nNewHeight | Specifies the new height for the image.
ppResizeData | Address of a pointer for a resize data packet. This specifies the area to be filled in with data for the L_Resize function. L_StartResize allocates the memory, and L_StopResize frees it. Note that you will pass the address of a pointer variable.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ResampleBitmap, L_ResizeBitmap, L_SizeBitmap, L_Resize, L_StopResize, L_DlgResize
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For complete sample code, refer to the RESIZE example.

/* This example resizes each line in one bitmap and writes it to another bitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
void TestFunction(void)
{
L_VOID L_FAR *pResizeData;
L_INT CopyWidth, CopyHeight;
L_UCHAR L_FAR *pBuf; /* Buffer to hold the input row */
HGLOBAL hBuf; /* Handle to the input buffer */
BITMAPHANDLE TmpBitmap; /* Bitmap containing input data */
int DestRow; /* Row counter for the output */
int i, n; /* Loop counters */
/* Load the input bitmap, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Allocate the buffer the size of one line of 24-bit input data */
hBuf = GlobalAlloc(GMEM_MOVEABLE, TmpBitmap.Width * 3);
pBuf = (L_UCHAR L_FAR *)GlobalLock( hBuf );
/* Create the new bitmap */
L_CreateBitmap(&LeadBitmap, sizeof(BITMAPHANDLE), TYPE_CONV,
TmpBitmap.Width / 2,
TmpBitmap.Height / 2,
24,
TmpBitmap.Order,
NULL,
TmpBitmap.ViewPerspective, NULL, 0);
/* Initialize the resize process */
L_StartResize (TmpBitmap.Width, TmpBitmap.Height,
TmpBitmap.Width / 2, TmpBitmap.Height / 2,
&pResizeData);
/* Initialize the destination row number */
DestRow = 0;
/* Use L_Resize to process each row in the bitmap */
L_AccessBitmap(&LeadBitmap);
L_AccessBitmap(&TmpBitmap);
for(i=0; i < TmpBitmap.Height; i++)
{
L_GetBitmapRow(&TmpBitmap, pBuf, i, TmpBitmap.BytesPerLine);
L_Resize (pBuf, i, TmpBitmap.BitsPerPixel,
&CopyWidth, &CopyHeight, pResizeData);
/* Output as many or as few rows as L_Resize supplies */
for(n=0; n < CopyHeight; n++)
{
L_PutBitmapRow(&LeadBitmap, pBuf, DestRow, CopyWidth * 3);
DestRow++;
}
}
L_ReleaseBitmap(&TmpBitmap);
L_ReleaseBitmap(&LeadBitmap);
/* End the resize process */
L_StopResize (pResizeData);
/* Free memory that we no longer need */
GlobalFree(hBuf);
return;
}


L_StartResizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StartResizeBitmap(pBitmap, nDestWidth, nDestHeight, nDestBits, pPalette, nColors, uFlags, pfnCallback, pCallbackData, ppResizeData)

pBITMAPHANDLE pBitmap; | /* handle to a bitmap */
L_INT nDestWidth; | /* new width of the image */
L_INT nDestHeight; | /* new height of the image */
L_INT nDestBits; | /* new bits per pixel for the image */
LPRGBQUAD pPalette; | /* palette */
L_INT nColors; | /* number of entries in pPalette */
L_UINT32 uFlags; | /* resizing flags */
RESIZECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR *pCallbackData; | /* optional parameter */
L_VOID L_FAR * L_FAR * ppResizeData; | /* address of a pointer for resize data */

Starts the resizing process.

Parameter

Description

PBitmap

Pointer to a bitmap handle.

NDestWidth

New width of the image.

NDestHeight

New height of the image.

NDestBits

Output bits per pixel. Use 0 for 8-bit grayscale. Possible values are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32, 48 and 64.,

PPalette

Pointer to the palette to dither to if nDestBits <= 8. Pass NULL to dither to the fixed palette or if no palette is required

NColors

The number of entries in pPalette. This value is only valid if pPalette is not NULL

UFlags

Flags that indicate the color order of the image, the type of resizing and the type of dithering. Flags from the different categories can be combined, but two flags from the same category can not be combined. Possible values are:

Value

Meaning

ColorRes flags

RES_ORDERRGB

[0x00000000] RGB color.

RES_ORDERBGR

[0x00000004] BGR color order.

RES_ORDERGRAY

[0x00000080] 12 or 16-bit grayscale. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions.

RES_ORDERROMM

[0x00000800] ROMM color order. ROMM only supports 24 and 48-bit images.

Resize flags

RES_NORMAL

[0x00000000] Normal resizing.

RES_RESAMPLE

[0x00000010] Linear interpolation resizing – slower than RES_NORMAL.

RES_BICUBIC

[0x00000020] Bicubic interpolation resizing – slower than RES_RESAMPLE.

Dithering flags

RES_NODITHERING

[0x00000000] No Dithering

RES_FLOYDSTEINDITHERING

[0x00010000] Floyd Stein Dithering

RES_STUCKIDITHERING

[0x00020000] Stucki Dithering

RES_BURKESDITHERING

[0x00030000] Burkes Dithering

RES_SIERRADITHERING

[0x00040000] Sierra Dithering

RES_STEVENSONARCEDITHERING

[0x00050000] Stevenson Arce Dithering

RES_JARVISDITHERING

[0x00060000] Jarvis Dithering

RES_ORDEREDDITHERING

[0x00070000] Ordered Dithering

RES_CLUSTEREDDITHERING

[0x00080000] Clustered Dithering

RES_DITHERINGOPTIONS

[0x00FF0000] Mask to find dither option

pfnCallback

Pointer to an optional callback that is used to get the rows from pBitmap. Pass NULL tohave LEADTOOLS call L_GetBitmapRow directly.

pCallbackData

Optional parameter to be passed to pfnCallback.

ppResizeData

Pointer to a variable that will be updated with information needed to perform the resize. You need to pass this information to subsequent calls to L_GetResizedRowCol and L_StopResizeBitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The dithering flags are used when dithering is needed to produce the output bits per pixel. The interpolation usually requires that the input data be converted to 24-bit or 48-bit and then back to the desired bits per pixel. So some dithering might be required if the output bits/pixel are <= 8.

L_StartResizeBitmap starts the resizing process. This will be followed by calls to L_GetResizedRowCol to retrieve the resized data and by a call to L_StopResizeBitmap, to free the memory allocated in ppResizeData.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetResizedRowCol, L_StopResizeBitmap, L_SizeBitmap, L_Resize, L_StopResize, L_DlgResize
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

// for GlobalAllocPtr
#include <windowsx.h>

L_INT MySizeBitmap(pBITMAPHANDLE pBitmap, L_INT nWidth, L_INT nHeight)
{
L_VOID L_FAR*pResizeData;
L_INT nRet;
L_UCHAR L_FAR*pBuffer;
BITMAPHANDLE Bitmap;
L_INT nRow=0;
L_INT nCol=0;
L_UINT uBytes;

nRet = L_StartResizeBitmap (pBitmap, nWidth, nHeight, 24,
NULL, // no palette
0,
RES_BICUBIC|RES_ORDERBGR, // bicubic interpolation, BGR order
NULL, // no callback
NULL, // no user data
&pResizeData);
if(nRet != SUCCESS)
return nRet;

nRet = L_CreateBitmap(&Bitmap, sizeof(BITMAPHANDLE), TYPE_CONV, nWidth, nHeight, 24, ORDER_BGR, NULL,
pBitmap->ViewPerspective, NULL, 0);
if(nRet != SUCCESS)
{
L_StopResizeBitmap(pResizeData);
return nRet;
}

pBuffer = (L_UCHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE, Bitmap.BytesPerLine);
if(!pBuffer)
{
L_FreeBitmap(&Bitmap);
L_StopResizeBitmap(pResizeData);
return nRet;
}

uBytes = BITMAPWIDTH(&Bitmap);
// get the rows for the resized image, one by one
for(nRow = 0; nRow < Bitmap.Height; nRow++)
{
nRet = L_GetResizedRowCol(pResizeData, pBuffer, nRow, 0, Bitmap.BytesPerLine);
if(nRet != SUCCESS)
break;

L_PutBitmapRowCol(&Bitmap, pBuffer, nRow, nCol, uBytes);
}

L_StopResize(pResizeData);

if(nRet == SUCCESS)
{
// free the old bitmap
L_FreeBitmap(pBitmap);

// put the new bitmap in pBitmap
*pBitmap = Bitmap;
}

return nRet;
}


L_StopDecompressBuffer

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopDecompressBuffer(hDecompress)

HGLOBAL hDecompress;

/* decompression handle */

Ends the decompression process and cleans up all the variables and buffers allocated by the L_StartDecompressBuffer and L_DecompressBuffer functions.

Parameter | Description
hDecompress | Handle that identifies the decompression process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Calling this function will reset all internal variables to their default settings. Call this function after the decompression of the entire image using L_DecompressBuffer.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartDecompressBuffer, L_DecompressBuffer, L_StartCompressBuffer, L_CompressBuffer, L_EndCompressBuffer
Topics: | Compressing and Decompressing Buffers
 | Raster Image Functions: Low-Level Decompression

Example

For an example, refer to L_StartDecompressBuffer.


L_StopDithering

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopDithering(pBitmap)

pBITMAPHANDLE pBitmap;

/* address of the bitmap handle */

Cleans up all data variables and buffers allocated by the L_StartDithering and L_DitherLine functions. This function resets all internal variables to their default settings.

Parameter | Description
pBitmap | Address of the bitmap handle that describes the bitmap that was dithered. It is the same bitmap handle that was specified in the L_StartDithering function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

For a description of how the functions relate to each other, refer to L_StartDithering.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ConvertBuffer, L_StartDithering, L_DitherLine
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

For an example, refer to L_StartDithering.


L_StopFeedLoad

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopFeedLoad(hLoad)

HGLOBAL hLoad;

/* handle that identifies the loading process */

Ends a file-load process in which you control the input stream. This cleans up all the variables and buffers allocated by the L_StartFeedLoad and L_FeedLoad functions and resets all internal variables to their default settings.

Parameter | Description
hLoad | Handle that identifies the loading process. It is the same handle that you specify in the L_StartFeedLoad function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call this function to complete a file load that was started with L_StartFeedLoad. If you call this function 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 functions relate to each other, refer to L_StartFeedLoad.

This function cannot be used in combination with L_RedirectIO.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartFeedLoad, L_FeedLoad, L_ChangeBitmapHeight
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For a short example, refer to L_StartFeedLoad. For complete sample code, refer to the FEEDLOAD example


L_StopMagGlass

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopMagGlass(hWnd)

HWND hWnd;

/* handle to a window */

Stops the Magnify Glass procedure and detaches the magnifying glass from the window.

Parameter | Description
hWnd | Handle of the window to which to attach the Magnifying Glass.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You should call this function before destroying the window to which you have previously attached the Magnifying Glass.

Note:

Do not stop the Magnifying Glass procedure in response to scroll messages (WM_VSCROLL and WM_HSCROLL). Instead, call L_UpdateMagGlassRect to update the destination rectangle.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StartMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_StartMagGlass or L_StartMagGlass.


L_StopResize

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopResize(pResizeData)

L_VOID L_FAR * pResizeData;

/* current resize data packet */

Cleans up all data variables and buffers allocated by L_StartResize and resets all internal variables to their default settings.

Parameter | Description
pResizeData | Current resize data packet.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ResampleBitmap, L_ResizeBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_DlgResize
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For a short example, refer to L_StartResize. For complete sample code, refer to the RESIZE example.


L_StopResizeBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StopResizeBitmap(pResizeData)

L_VOID L_FAR * pResizeData;

/* current resize data packet */

Stops the resizing process and frees any memory allocated by L_StartResizeBitmap.

Parameter | Description
pResizeData | Current resize data packet.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartResize, L_GetResizedRowCol, RESIZECALLBACK
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

For an example, refer to L_StartResizeBitmap.


L_StretchBitmapIntensity

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_StretchBitmapIntensity(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the target bitmap handle */

Increases the contrast in an image by centering, maximizing, and proportioning the range of intensity values.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the target bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Unlike the L_ChangeBitmapContrast function, this function always retains the original number of different intensity values. (Ordinary contrast adjustments can lose values at the high and low ends of the scale.)

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Changing Brightness and Contrast

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

/* This example loads a bitmap and maximizes its range of intensity values. */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Stretch the intensity */
L_StretchBitmapIntensity(&LeadBitmap );


L_SubtractBackgroundBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SubtractBackgroundBitmap (pBitmap, uRollingBall, uShrinkSize, uBrightnessFactor, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to bitmap handle */
L_UINT uRollingBall; | /* ball size */
L_UINT uShrinkSize; | /* shrink size ratio */
L_UINT uBrightnessFactor; | /* brightness factor */
L_UINT uFlags; | /* process flags */

Removes the background from the image. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uRollingBall | The radius (in pixels) of the ball that will roll over the entire image to determine the background. Recommended value is 50.
uShrinkSize | 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_DEPEND | [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).
uBrightnessFactor | 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.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uBrightness factor, which functions similar to L_MultiplyBitmap. Passing 100 for uBrightness 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddShadowBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DirectionEdgeStatisticalBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_UserFilterBitmap
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Apply Subtract Background effect on the image*/
L_SubtractBackgroundBitmap(&LeadBitmap, 50, SBK_DEPEND, 0, SBK_BG_DARK | SBK_RES_SHOW);


L_SwapColors

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_SwapColors(pBitmapHndl, nFlags)

pBITMAPHANDLE pBitmapHndl; | /* pointer to the bitmap handle */
L_INT nFlags; | /* flag */

Swaps the specified color channels.

Parameter | Description
pBitmapHndl | Pointer to the bitmap handle that references the bitmap in which to swap the specified color channels.
nFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function changes the bitmap data.

This function can process the whole image or a region of the image.

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 function supports signed data images.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ConvertToColoredGray, L_BalanceColors, L_GrayScaleBitmap, L_GrayScalebitmapExt, L_IsGrayScaleBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

/* This example assumes there is a bitmap loaded into Bitmap, which is of type BITMAPHANDLE. */
L_SwapColors(&Bitmap, SWAP_RG);


L_SwirlBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SwirlBitmap (pBitmap, nAngle , CenterPt)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAngle; | /* degree of rotation */
POINT CenterPt; | /* effect center */

Spins the image according to the rotation angle to produce a swirl pattern. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
nAngle | The degree of rotation. This value is in degrees (0…360…720, etc.).
CenterPt | POINT structure that contains the center of the swirl.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function swirls the image around the specified CenterPt. 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgSwirl , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Swirl bitmap*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_SwirlBitmap (&LeadBitmap, 180, CenterPt);


L_TextureAlphaBlendBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_TextureAlphaBlendBitmap(pBitmapDst, nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, pBitmapMask, nOpacity, pBitmapUnderlay, pOffset)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
L_INT nXDst; | /* x coordinate */
L_INT nYDst; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
L_INT nXSrc; | /* x coordinate */
L_INT nYSrc; | /* y coordinate */
pBITMAPHANDLE pBitmapMask; | /* pointer to a mask bitmap handle */
L_INT nOpacity; | /* opacity value */
pBITMAPHANDLE pBitmapUnderlay; | /* pointer to the underlay bitmap handle */
LPPOINT pOffset; | /* pointer to an underlay bitmap offset */

Combines image data from two bitmaps with feathering and constant opacity; by combining the two bitmaps with a variable opacity that depends on a fade mask then combine the result with the destination bitmap with a constant opacity. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle that references the destination bitmap. The function will update this bitmap.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
nWidth | Width of the area to be combined, in pixels. This width applies to both the source and the destination areas.
nHeight | Height of the area to be combined, in pixels. This height applies to both the source and the destination areas.
pBitmapSrc | Pointer to the bitmap handle that references the source bitmap.
nXSrc | The X coordinate of the origin of the source rectangle.
nYSrc | The Y coordinate of the origin of the source rectangle.
pBitmapMask | Pointer to the bitmap handle that references the fade mask, if you want to combine the two bitmaps just with opacity set this parameter to NULL.
nOpacity | Opacity value used when combining the areas from the result of feathering and destination bitmaps. Valid values range from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.
pBitmapUnderlay | Pointer to the bitmap handle that references the bitmap to be used as the underlying image. The function will use this bitmap to underlay the mask bitmap. You could ignore this parameter effect by passing NULL.
pOffset | Pointer to an underlay bitmap offset with respect to the destination bitmap. The function will use this point to calculate the parts of the underlay bitmap that will be applied to the mask bitmap. Using this point will give the user the ability to give the feel of continuous texture when applying this function to neighboring parts inside the destination bitmap using the same or different mask, if the pBitmapUnderlay parameter is set to NULL also set this parameter to NULL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To combine two bitmaps with a fixed opacity, use the L_AlphaBlendBitmap function.

To combine two bitmaps with a feather, use the L_FeatherAlphaBlendBitmap function.

The L_TextureAlphaBlendBitmap function does the two operations; at first combine the two images with feather using the fade mask bitmap then combine the result with the destination bitmap with a fixed opacity.

To create a bitmap that contains a fade mask, use L_CreateFadedMask.

This function can also underlay the fade mask bitmap with the underlay bitmap before using it in the feather combine operation.

This function also combines the fade mask bitmap with the underlay bitmap so that it appears to be an underlying texture for the fade mask bitmap.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function also supports 12 and 16-bit grayscale bitmaps. Support for 12 and 16-bit grayscale images is available only in the Document/Medical toolkits.

The following is an example for the resulted image using this functions with the following characteristics:

The source bitmap is a red image.

The destination bitmap is a white image.

The opacity is set to 255.

The right image is the result of applying the function without texture bitmap.

The left image is the result of applying the function with texture bitmap.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_AlphaBlendBitmap, L_FeatherAlphaBlendBitmap, L_CreateFadedMask, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

BITMAPHANDLE BitmapDst; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE BitmapSrc; /* source bitmap */
BITMAPHANDLE BitmapMask; /* Bitmap handle to the fade mask bitmap */
L_INT XDst, YDst, XSize, YSize, XSrc, YSrc;

/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &BitmapDst, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("IMAGE2.BMP"), &BitmapSrc, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

/* Load the fade mask bitmaps */
L_LoadBitmap (TEXT("FADEMASK.CMP"), &BitmapMask, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);

/* Combine BitmapSrc with BitmapDst, with fade mask bitmap and a 100 opacity*/
L_TextureAlphaBlendBitmap (&BitmapDst, XDst, YDst, XSize, YSize, &BitmapSrc, XSrc, YSrc, &BitmapMask, 100, NULL, NULL);

/* Free the temporary bitmaps */
L_FreeBitmap (&BitmapSrc);
L_FreeBitmap(&BitmapSrc);


L_ToggleBitmapCompression

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ToggleBitmapCompression(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Toggles the compression of the specified bitmap.

Parameter | Description
pBitmap | Pointer to the bitmap handle.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

NOTE: This function is now obsolete. New applications should use the L_ChangeBitmapCompression function.

(Document/Medical only) If the specified bitmap is compressed, calling this function will make the bitmap uncompressed. If the bitmap is uncompressed, calling this function will make the bitmap compressed.

This function only works for 1 bit per pixel images.

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Topics:

Speeding Up 1-Bit Documents

Example

/* This function toggles bitmap compression */
void ToggleCompression(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_TCHAR s[100];
if(pBitmap->BitsPerPixel == 1)
{
wsprintf(s, TEXT("BEFORE - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.Compressed ? TEXT("COMP") : TEXT("UNCOMP")));
MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK);
if(L_ToggleBitmapCompression(pBitmap) == SUCCESS)
wsprintf(s, TEXT("AFTER - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.Compressed ? TEXT("COMP") : TEXT("UNCOMP")));
else
wsprintf(s, TEXT("L_ToggleBitmapCompression Failed"));
MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK);
}
}


L_TransformFile

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_TransformFile(pszFileSrc, pszFileDst, uTransform, pfnCallback, pUserData, pLoadOptions)

L_TCHAR L_FAR * pszFileSrc; | /* name of the source file */
L_TCHAR L_FAR * pszFileDst; | /* name of the destination file */
L_UINT uTransform; | /* the transformation to perform */
TRANSFORMFILECALLBACK pfnCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Performs a lossless transformation for certain formats. Currently, only JPEG, CMP and JPEG TIFF formats are supported.

Parameter | Description
pszFileSrc | Character string containing the name of the source file.
pszFileDst | Character string containing the name of the destination file.
uTransform | Binary 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.
 | 0 | Do nothing.
pfnCallback | Optional callback function for processing custom markers. (This is useful for rotating JPEG files only). When transforming JPEG files, the function will enumerate all the markers contained in the file and it will pass them to this callback. The user has the ability to control the transformation for all the markers. For additional information on JPEG markers, please consult the JPEG specification.
 | If you do not provide a callback function, use NULL as the value of this parameter and no JPEG markers will be transformed.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in TRANSFORMFILECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options. This is useful only for transforming JPEG TIFF files. The load options will specify the page to transform.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Only one of the rotate flags can be specified.

The files transformed by this function will be read transformed by other applications capable of reading these file formats.

JPEG and Exif JPEG stamps are transformed according to the flags specified in uTransform. Please note that some JPEG stamps will not be transformed by this function. Specifically, stamps stored in markers other than APP0 and APP1 will not be transformed. Use the TRANSFORMFILECALLBACK function to handle these cases. For example, if a stamp is in the APP14 marker, check for this in the TRANSFORMFILECALLBACK function and write your own stamp using L_WriteFileStamp.

For JPEG files, the size of the image might be changed. This can happen when the image width or height is not a multiple of 8.

The transformation is lossless. It is better than loading the image, transforming it using L_RotateBitmap, L_FlipBitmap or L_ReverseBitmap and resaving it. Repeated load and save process will cause image degradation, but calling this function will not cause any image degradation.

The rotation transformations are performed before the flip/reverse operations.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadFile, L_RotateBitmap, L_FlipBitmap, L_ReverseBitmap, L_LoadMarkers
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Processing an Image

Example

/* This example rotates the file by 90 degrees */
L_TransformFile (TEXT("IMAGE1.JPG"), TEXT("C:\\IMAGE1.JPG"), FILE_TRANSFORM_ROTATE90, NULL, NULL, NULL);


L_TranslateBitmapColor

#include "l_bitmap.h"

COLORREF EXT_FUNCTION L_TranslateBitmapColor(pBitmapDst, pBitmapSrc, crColor)

pBITMAPHANDLE pBitmapDst; | /* pointer to the destination bitmap handle */
pBITMAPHANDLE pBitmapSrc; | /* pointer to the source bitmap handle */
COLORREF crColor; | /* color in the source bitmap */

Translates the specified color in the source bitmap, and returns the nearest matching color in the destination bitmap.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle referencing the destination bitmap.
pBitmapSrc | Pointer to the bitmap handle referencing the source bitmap.
crColor | The COLORREF value that specifies the color in the source bitmap to be translated. You can get the value from a palette entry or by using L_GetPixelColor.

Returns

The COLORREF value or the palette index of the nearest matching color in the destination bitmap. If the destination bitmap is 8 bits per pixel or less, this is always the palette index. Otherwise, it is the COLORREF value.

Comments

When creating a target bitmap for animation, you can use this function to ensure that the correct color is specified as the background color.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetBitmapColors, L_PutBitmapColors, L_DupPalette
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Raster Image Functions: Palettes
 | Color Resolution and Dithering
 | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

For a short example, refer to L_GetBitmapListItem. For complete sample code, refer to the CHILD.C module of the DEMO example.


L_TrimBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_TrimBitmap(pBitmap, nCol, nRow, uWidth, uHeight)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nCol; | /* x coordinate origin of the rectangle to keep */
L_INT nRow; | /* y coordinate origin of the rectangle to copy */
L_UINT uWidth; | /* width of the rectangle to keep (in pixels) */
L_UINT uHeight; | /* height of the rectangle to keep (in pixels) */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to trim.
nCol | The X coordinate of the pixel within the bitmap that is the origin of the rectangle to keep.
nRow | The Y coordinate of the pixel within the bitmap that is the origin of the rectangle to keep.
uWidth | Width of the rectangle to keep (in pixels).
uHeight | Height of the rectangle to keep (in pixels).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function instead of L_CopyBitmapRect when the original bitmap is not needed after the trim.

This function uses bitmap coordinates to specify the area to be copied. Therefore, you must account for the view perspective of the bitmap. For information about bitmap coordinates, refer to Accounting for View Perspective.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_AutoTrimBitmap, L_GetAutoTrimRect, L_CopyBitmapRect
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

/* This example trims 10 pixels off of each side of the image */
BITMAPHANDLE LeadBitmap; /* Bitmap handle that holds the bitmap */
L_INT nCol, nRow;
L_UINT uWidth, uHeight;

L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

nCol = 10;
nRow = 10;
uWidth = LeadBitmap.Width - nCol - 10;
uHeight = LeadBitmap.Height - nRow - 10;
L_TrimBitmap ( &LeadBitmap, nCol, nRow, uWidth, uHeight );


L_TunnelBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_TunnelBitmap(pBitmap, ptCenterPoint, uZValue, nDistance, uRad, nRepeat, nRotationOffset, uStretch, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
POINT ptCenterPoint; | /* point at which the viewer is looking */
L_UINT uZValue; | /* viewing screen offset on the Z-axis */
L_INT nDistance; | /* camera distance from the viewing screen */
L_UINT uRad; | /* tunnel radius */
L_INT nRepeat; | /* number of times the bitmaps are repeated */
L_INT nRotationOffset; | /* rotation offset */
L_UINT uStretch; | /* compression factor */
L_UINT uStartBright; | /* brightness of an external light source on the first bitmap displayed */
L_UINT uEndBright; | /* brightness of an external light source on the last bitmap displayed */
L_UINT uBrightLength; | /* changes in brightness along the Z axis */
COLORREF crBright; | /* color of an external light source that is shined on the bitmaps */
COLORREF crFill; | /* background color */
L_UINT uFlags; | /* flags */

Places the bitmap inside a tunnel along the Z-axis. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be changed.
ptCenterPoint | POINT structure that contains the point at which the camera or viewer is looking. It may be outside the bitmap borders.
uZValue | Viewing screen offset on the Z-axis, in pixels.
nDistance | Camera distance from the viewing screen, in pixels.
uRad | Tunnel radius.
nRepeat | Number of times the bitmap repeats along the Z-axis. If nRepeat equals –1 the bitmap will be infinitely repeated. Its range starts from –1.
nRotationOffset | Rotates 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 nRotationOffset set to the bitmap height is equivalent to a complete cycle. If TUN_AXIS_HEIGHT option is set, then the bitmap height is along the Z-axis and nRotationOffset set to the bitmap width is equivalent to a complete cycle.
uStretch | Value that indicates whether to expand or compress the bitmap, and by how much. If uStretch < 100 bitmap will be expanded. If uStretch > 100 the bitmap will be compressed. Use 100 to maintain the bitmap's dimensions. The value of this parameter is internally divided by 100.
uStartBright | 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.
uEndBright | 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.
uBrightLength | Value that indicates how much the brightness changes as you move along the Z axis. This parameter is internally multiplied by 50.
crBright | The COLORREF value that specifies the color of an external light source that shines in the tunnel.
crFill | The COLORREF value that specifies the background color.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 uBrightLength 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.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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:

CenterPoint(x,y) = (200,200)
uZValue= 0
nDistance= 200
uRad= 200
nRepeat= -1
nRotationOffset= 75
uStretch= 25
uStartBright= 0
uEndBright= 100
uBrightLength= 45
crBright= RGB(255,255,255)
crFill= RGB(255,255,255)
uFlags= PLANE_FILL_CLR | TUN_AXIS_WIDTH

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_GlowFilterBitmap, L_FreePlaneBendBitmap, L_DryBitmap, L_OceanBitmap, L_GlassEffectBitmap, L_LensFlareBitmap, L_LightBitmap, L_FreeRadBendBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap, L_AdjustBitmapTint, L_ColorHalfToneBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Raster Image Functions: Artisitic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* put the image inside tunnel with its width along the Z-axis*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;

L_TunnelBitmap(&LeadBitmap, CenterPt, 0, LeadBitmap.Height, LeadBitmap.Width/2, -1,0, 25,0,100, 20000, RGB(255,0,0), RGB(0,0,0),TUN_AXIS_WIDTH | PLANE_FILL_CLR);


L_UnderlayBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UnderlayBitmap(pBitmapDst, pUnderlay, uFlags)

pBITMAPHANDLE pBitmapDst; | /* pointer to the target bitmap handle */
pBITMAPHANDLE pUnderlay; | /* pointer to the underlay bitmap handle */
L_UINT uFlags; | /* positioning indicators */

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.

Parameter | Description
pBitmapDst | Pointer to the bitmap handle that references the bitmap to be used as the target image. This is the image that appears to be on top and retains its colors.
pUnderlay | Pointer to the bitmap handle that references the bitmap to be used 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.
uFlags | Indicators of how the underlying image is to be positioned. Valid values are:
 | Value | Meaning
 | UB_TILE | Tile the underlay. This repeats the underlying image, so that it fills the target image. This function does not do any resizing; you are responsible for the size of the tiles.
 | UB_STRETCH | [0x01] Stretch the underlay to fit the dimensions of the target image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function changes the colors of the underlay to grayscale as it combines the images. It updates the target bitmap (pBitmapDst), leaving the second bitmap (pUnderlay) unchanged. The underlying image can either be stretched or tiled to fill the target image, as shown in the following illustration:

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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.)

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_CombineBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_ImpressionistBitmap, L_PixelateBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_AddShadowBitmap, L_RevEffectBitmap, L_AgingBitmap, L_DiceEffectBitmap, L_FunctionalLightBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_TextureAlphaBlendBitmap, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Copying Images

Processing an Image

Applying Artistic Effects

Raster Image Functions: Processing an Image

Example

For complete sample code, refer to the CLRSPACE example.

/* This example uses TmpBitmap as a tiled underlay for LeadBitmap */
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image */
BITMAPHANDLE TmpBitmap; /* Temporary bitmap */
/* Load both bitmaps, at 24 bits per pixel */
L_LoadBitmap (TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
L_LoadBitmap (TEXT("ULAY4.BMP"), &TmpBitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
/* Use TmpBitmap as a tiled underlay for LeadBitmap */
L_UnderlayBitmap(&LeadBitmap, &TmpBitmap, UB_TILE);
/* Free the temporary bitmap */
L_FreeBitmap(&TmpBitmap);


L_UnlockSupport

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_UnlockSupport(uType, pKey)

L_UINT uType; | /* optional feature to unlock */
L_TCHAR, L_FAR * pKey; | /* key to unlock the feature */

Unlocks support for an optional feature, such as LEADTOOLS Medical Imaging capabilities, or PDF support.

Parameter | Description
uType | The optional feature to check.
 | Value | Meaning
 | 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_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 | Unlocks support for JPEG2000 images. The support needs to be unlocked to read and write both types of JPEG 2000 images (JPEG 2000 stream and JP2 files).
 | L_SUPPORT_JBIG2 | Support for the JBIG2 file format.
 | 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 or saved.
 | L_SUPPORT_PDF_SAVE | Support for saving raster images as a PDF file. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selections.
 | L_SUPPORT_VECTOR | Support for the Vector Features and Vector file formats. Available only in selected LEADTOOLS products. For a list of products, refer to Topic Selection.
pKey | The key to unlock the feature.

Returns

None

Comments

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

For information on unlocking Document/Medical, refer to Document/Medical Support and Licensing Agreements.

The code examples in this toolkit use the UNLOCKSUPPORT macro, which is defined in the LTLCK.H header file. You can specify keys in the header file to unlock capabilities in the example programs.

To unlock support for image processing features that are only available in LEADTOOLS Raster Imaging Pro (and above), use the following:

L_UnlockSupport(L_SUPPORT_LTPRO, TEXT("LtProKey"));

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_IsSupportLocked, L_VersionInfo

Example

/* Unlock PDF support.
Note that this is a sample key, which will not work in your toolkit. */
L_UnlockSupport(L_SUPPORT_PDF, TEXT("TestKey"));

/* Unlock DOCUMENT support. Document toolkit required.
Note that "Document_key" must be obtained from LEAD. */
L_UnlockSupport(L_SUPPORT_DOCUMENT, TEXT("Document_key"));


L_UnsharpMaskBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UnsharpMaskBitmap(pBitmap, nAmount, nRadius, nThreshold, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nAmount; | /* adjustment factor */
L_INT nRadius; | /* radius of the mask */
L_INT nThreshold; | /* threshold value */
L_UINT uFlags; | /* flag */

Sharpens the specified image by applying the unsharp mask.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the mask.
nAmount | Value that represents an adjustment factor. This is a percentage.
nRadius | Value that indicates the size of the neighborhood used for blurring each pixel of the bitmap.
nThreshold | 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. The valid range is from 0 - 65535 for 64-bit, 48-bit and 16-bit grayscale images and from 0 - 4095 for 12-bit grayscale images. Otherwise, it is from 0 to 255.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is actually considered a sharpening function. It is used to sharpen the image with a minimum of noise. To reduce the noise, it starts by blurring a copy of the original image. The amount of blur depends on nRadius. The function 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 nThreshold value, then the difference between the pixel values is multiplied by the value in the nAmount parameter and added to the original pixel value.

To increase the thickness of the sharpened edges, increase the value of nRadius.

To increase the amount of sharpness, increase the value of nAmount.

To reduce the noise and eliminate the small edges or individual pixels that will produce noise in image, increase the value of nThreshold.

Using the YUV color space decreases the processing time.

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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_MedianFilterBitmap, L_AddBitmapNoise, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_MaxFilterBitmap, L_MinFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_DlgUnsharpMask , L_WindowLevel, L_GaussianFilterBitmap, L_BricksTextureBitmap, L_DeskewBitmap, L_DeskewBitmapExt, L_DiffuseGlowBitmap, L_GlowFilterBitmap, L_HalfTonePatternBitmap, L_HighPassFilterBitmap, L_MaskConvolutionBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap
Topics: | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and increases its sharpness. */
/* Load the bitmap, keeping the bits per pixel of the file */
BITMAPHANDLE LeadBitmap;
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_UnsharpMaskBitmap (&LeadBitmap, 200, 15, 50, RGB_SPACE);


L_UpdateBitmapOverlayBits

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateBitmapOverlayBits(pBitmap, nIndex, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the main bitmap handle */
L_INT nIndex; | /* the overlay index */
L_UINT uFlags; | /* flags that determine which bits to update */

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. This function is available in the Medical toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the main bitmap.
nIndex | The index of the overlay used in the process. This overlay must have the corresponding bitplane set, otherwise the function will fail and ERROR_OVERLAY_INDEX will be returned. This index is zero-based.
uFlags | Flags that determine whether the main bitmap or the overlay bitmap should be updated. You can ‘or’ SETOVERLAYBITS_FROMOVERLAY and SETOVERLAYBITS_CLEAR. 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)

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function will only work for grayscale 8, 12 or 16-bit bitmaps. Support for 12 and 16-bit grayscale bitmaps is only in the Document/Medical toolkits.

If SETOVERLAYBITS_FROMOVERLAY is set in uFlags, 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:

OverlayWidth = BITMAPWIDTH(pBitmap) - pOverlayBitmap.ptOrigin.x
OverlayHeight = BITMAPHEIGHT(pBitmap) – pOverlayBitmap.ptOrigin.y

BITMAPWIDTH is a macro which determines the display bitmap width, taking the view perspective into account.

BITMAPHEIGHT is a macro which determines the display bitmap height, taking the view perspective into account.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_ResampleBitmap, L_SizeBitmap, L_StartResize, L_Resize, L_StopResize, L_SetOverlayBitmap, L_GetOverlayBitmap, L_SetOverlayAttributes, L_GetOverlayAttributes, L_GetOverlayCount, L_BricksTextureBitmap, L_CanvasBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_VignetteBitmap
Topics: | Raster Image Functions: Combining Images
 | Overlay Overview

Example

/* This example will load an overlay bitmap and sets its color and a few attributes */
/* It assumes pBitmap is grayscale. It uses the LoadAndSetOverlay function from the L_SetOverlayBitmap example */
L_INT BurnOverlay(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_INT nRet;

// load overlay 0
nRet = LoadAndSetOverlay(pBitmap, TEXT("overlay0.cmp"), 0, RGB(0, 0, 255)); // blue
if(nRet != SUCCESS)
{
MessageBox(hWnd, TEXT("Error Loading Overlay 0!"), TEXT("Error"), MB_OK);
return nRet;
}

nRet = L_UpdateBitmapOverlayBits(pBitmap, 0, SETOVERLAYBITS_FROMOVERLAY);
if(nRet != SUCCESS)
MessageBox(hWnd, TEXT("Error setting Overlay 0!"), TEXT("Error"), MB_OK);

return nRet;
}


L_UpdateMagGlass

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateMagGlass(hWnd, pBitmap, bUpdateBitmap)

HWND hWnd; | /* handle to a window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_BOOL bUpdateBitmap; | /* flag that indicates whether to update the bitmap */

Updates the zoomed image displayed in the Magnifying Glass display area.

Parameter | Description
hWnd | Handle of the window to which the Magnifying Glass is attached.
pBitmap | Pointer to the bitmap handle that references the new bitmap to be zoomed and displayed in the Magnifying Glass display area.
bUpdateBitmap | Flag that indicates whether to update the bitmap passed to L_StartMagGlass. Possible values are:
 | Value | Meaning
 | TRUE | Update the bitmap passed to L_StartMagGlass. (The updated areas will be seen while moving the magnifying glass over the image and the bitmap will be updated.)
 | FALSE | Do not update the bitmap passed to L_StartMagGlass. (The updated areas will be seen while moving the magnifying glass over the image but the bitmap will not be updated.)

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can only be called if a callback function was passed to L_StartMagGlass. If a callback function is passed to L_StartMagGlass, information about the non-updated parts of the bitmap can be obtained from the callback function. This information can then be used with LEADTOOLS Internet functions to get fill a pColor buffer with pixel values for the non-updated parts of the bitmap. Once this pColor buffer is filled and received, that information and the pColor buffer can be passed to this function to update the Magnifying Glass image.

For an example, refer to the Ltnetdlln.chm help file in the HELP directory.

The pColor buffer can also be filled without using the LEADTOOLS Internet functions. Match pMaskPlane, received in the callback function, to the original bitmap and fill pColor buffer 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.

Define a MAGGLASSCALLBACK callback function and pass it to L_StartMagGlass to start the Magnifying Glass. When the left mouse button is pressed while moving the mouse over the bitmap, the MAGGLASSCALLBACK function will receive the (hWnd, nMaskPlaneStart, nMaskPlaneEnd, pMaskPlane, nMaskPlaneSize and pUserData) information. Each time the callback receives this information, it indicates that part of the bitmap needs to be updated. The bitmap can be updated by calling the L_UpdateMagGlass function.

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 pMaskPlane 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 pMaskPlane. Each portion is represented by 1 bit within the pMaskPlane. Therefore, 2 bytes are needed in the pMaskPlane to represent the 9 portions of the bitmap. Each portion will be mapped to a byte in the pMaskPlane 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 pMaskPlane received from the MAGGLASSCALLBACK function 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. nMaskPlaneSize will equal 2.

The next step is to check each bit value. If the bit value is 1 the corresponding portion needs to be updated, so pColor buffer 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 pColor buffer should be filled with the corresponding pixels from the original bitmap. You must always start filling the pColor buffer 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 pColor buffer. 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 pMaskPlane for this portion. Suppose it has a bit value of 0. For this portion, do not fill pColor buffer 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 pColor buffer can be filled with the necessary pixel colors and passed, along with other information, to this function (L_UpdateMagGlass) and used to update the zoomed image displayed in the Magnifying Glass display area.

If bUpdateBitmap is TRUE, the original bitmap will be updated when the mouse moves over the bitmap while the left mouse button is pressed.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, MAGGLASSCALLBACK, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_StartMagGlass.


L_UpdateMagGlassBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateMagGlassBitmap(hWnd, pBitmap, bUpdateBitmap)

HWND hWnd; | /* handle to a window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_BOOL bUpdateBitmap; | /* flag that indicates whether to update the magnifying glass source bitmap */

Updates the magnifying glass bitmap with a new bitmap.

Parameter | Description
hWnd | Handle of the window to which the magnifying glass is attached.
pBitmap | Pointer to the bitmap handle that references the new bitmap that the magnifying glass will display the zoomed area.
bUpdateBitmap | Flag that indicates whether to update the magnifying glass source bitmap. Possible values are:
 | Value | Meaning
 | TRUE | Update the magnifying glass displayed bitmap with the parts of pBitmap while moving the magnifying glass over the displayed bitmap.
 | FALSE | Don’t update the magnifying glass displayed bitmap with the parts of pBitmap while moving the magnifying glass over the displayed bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The idea is to provide a new bitmap that the magnifying glass can use when displaying the zoomed area. The dimensions of this passed bitmap should be equal to the dimensions of the magnifying glass bitmap.

Note:

This function can be used only if the MAGGLASS_MANUAL_UPDATE flag was set when calling L_StartMagGlass function.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StopMagGlass, L_ShowMagGlass, L_SetMagGlassPos, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_ShowMagGlass.


L_UpdateMagGlassRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateMagGlassRect(hWnd, prcDst)

HWND hWnd; | /* handle to a window */
RECT L_FAR* prcDst; | /* pointer to the display destination rectangle */

Updates the Magnify Glass procedure with a new destination rectangle.

Parameter | Description
hWnd | Handle of the window to which the Magnifying Glass is attached.
prcDst | Pointer to the Windows RECT structure that determines how pBitmap is positioned in the device context. The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called anytime the image's destination rectangle has been updated in an application. For example, if the image is scrolled or zoomed, call this function with the new destination rectangle.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StopMagGlass, L_StartMagGlass, L_StartMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

/*
This sample comes from the Main API Demo "CHILD.C".
This is not a complete sample.
Refer to CHILD.C for the complete code.
*/
static VOID BmpWnd_OnHScroll (HWND hWnd, HWND hWndCtl, UINT nCode, int nPos)
{
LPCHILDDATA pData;
L_INT nScrollInc;
L_BOOL fInScroll;

UNREFERENCED_PARAMETER(hWndCtl);
pData = LOCKCHILDDATA(GetParent(hWnd));
fInScroll = TRUE;
switch (nCode)
{
case SB_LEFT:
nScrollInc = -pData->nHScrollPos;
break;
case SB_RIGHT:
nScrollInc = pData->nHScrollMax - pData->nHScrollPos;
break;
case SB_LINELEFT:
nScrollInc = -pData->nHScrollStep;
break;
case SB_LINERIGHT:
nScrollInc = pData->nHScrollStep;
break;
case SB_PAGELEFT:
nScrollInc = -max (pData->nHScrollStep, (pData->cxClient -
pData->nHScrollStep));
break;
case SB_PAGERIGHT:
nScrollInc = max (pData->nHScrollStep, (pData->cxClient -
pData->nHScrollStep));
break;
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
nScrollInc = (nPos << pData->nHScrollFactor) - pData->nHScrollPos;
break;
default:
nScrollInc = 0;
break;
}

nScrollInc = max (-pData->nHScrollPos,
min (nScrollInc, (pData->nHScrollMax -
pData->nHScrollPos)));
if(nScrollInc)
{
pData->nHScrollPos += nScrollInc;
OffsetRect (&pData->rcView, -nScrollInc, 0);
ScrollWindow (hWnd, -nScrollInc, 0, NULL, NULL);
SetScrollPos (hWnd, SB_HORZ, pData->nHScrollPos >>
pData->nHScrollFactor, TRUE);
UpdateWindow (hWnd);
}
if( pData->bMagGlass )
L_UpdateMagGlassRect (pData->hBitmapWnd, &pData->rcView);
UNLOCKCHILDDATA (GetParent(hWnd));
fInScroll = FALSE;
}


L_UpdateMagGlassShape

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateMagGlassShape(hWnd, uMagGlassShape, hMagGlassRgn)

HWND hWnd; | /* handle to a window */
L_UINT32 uMagGlassShape; | /* flags that indicate the magnifying glass shape */
HRGN hMagGlassRgn; | /* handle to the Windows region */

Updates the Magnifying Glass shape.

Parameter | Description
hWnd | Handle of the window to which the Magnifying Glass is attached.
uMagGlassShape | Flags that indicate the magnifying glass shape. Possible values are:
 | Value | Meaning
 | MAGGLASS_SHAPE_RECT | [0] Rectangle shape of Magnifying Glass.
 | MAGGLASS_SHAPE_ELLIPSE | [1] Ellipse shape of Magnifying Glass.
 | MAGGLASS_SHAPE_HRGN | [2] User-defined shape of Magnifying Glass.
hMagGlassRgn | Handle to a Windows region that defines the Magnifying Glass shape. This parameter is used only if the uMagGlassShape parameter is MAGGLASS_SHAPE_HRGN.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The width and height of the Magnifying Glass will be changed according to the width and height of the passed hMagGlassRgn parameter if the uMagGlassShape parameter was set to MAGGLASS_SHAPE_HRGN.

The Magnifying Glass will stop and this function will return an error value in two cases:

1. | If the value passed in the uMagGlassShape parameter was outside the defined values.
2. | If the value passed in the uMagGlassShape parameter was MAGGLASS_SHAPE_HRGN and the value passed to the hMagGlassRgn parameter was NULL.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StartMagGlass, L_StopMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

/*
This example sets the shape of the Magnifying Glass to a round rect
shape for an already started Magnifying Glass.
*/

L_INT SetMagGlassRoundRectShape(HWND hWnd)
{
L_INT nRet;
HRGN hRoundRectRgn;

hRoundRectRgn = CreateRoundRectRgn(0, 0, 100, 100, 25, 25);

nRet = L_UpdateMagGlassShape(hWnd, MAGGLASS_SHAPE_HRGN, hRoundRectRgn);

DeleteRgn(hRoundRectRgn);

return nRet;
}


L_UpdatePanWindow

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdatePanWindow(hPanWindow, pBitmap, ulDisplayFlags, crPen, pszTitle, prcDst)

HWND hPanWindow; | /* handle to the Pan Window */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT32 ulDisplayFlags; | /* display flags */
COLORREF crPen; | /* color for the Pan Rect */
L_TCHAR L_FAR* pszTitle; | /* title string for the Pan Window */
LPRECT prcDst; | /* main window's paint dest rect */

Updates the Pan Window with the specified settings.

Parameter | Description
hPanWindow | Handle to the Pan Window.
pBitmap | Pointer to the bitmap handle referencing the bitmap to be displayed in the PanWindow.
ulDisplayFlags | Flags which determine how the image is painted in the Pan Window. For values, refer to Flags for the L_SetDisplayMode Function.
crPen | COLORREF value that specifies the color of the pen to use for drawing the Pan Rect.
pszTitle | Character string containing the title bar string for the Pan Window. Pass NULL for no title bar string.
prcDst | Pointer to a rect containing the main window's paint destination rect. This is used to determine the location of the Pan Rect in the Pan Window and the current zoom factor.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Call this function immediately after creating the Pan Window to make it visible, and to set the location of the Pan Rect. Then, anytime the main window's paint destination rect changes, or any time the main window scrolls, call this function to update the Pan Window.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CreatePanWindow, L_DestroyPanWindow, PANWNDCALLBACK
Topics: | Using Color Values in LEADTOOLS

Example

For an example, refer to L_CreatePanWindow.


L_UpdateZoomView

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UpdateZoomView(hWnd, pZoomViewProps)

HWND hWnd; | /* handle to a window */
pZOOMVIEWPROPS pZoomViewProps; | /* pointer to a structure */

Updates the specified Zoom View with new settings. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.
pZoomViewProps | Pointer to a ZOOMVIEWPROPS structure to be updated with options for controlling the behavior of the zoomed view. You must fill pZoomViewProps->uIndex before calling this function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called any time the image's destination rectangle has been updated in an application. For example, if the image is scrolled or zoomed, call this function with the new destination rectangle.

You should also call this function if you process or change the image in any way (for example, L_FlipBitmap).

To change the current options for a Zoom View, change the values in the structure pointed to by pZoomViewProps and pass a pointer to the updated structure to the L_UpdateZoomView function.

To attach a zoomed view to a window, call the L_CreateZoomView function. To display a zoomed view, call the L_RenderZoomView function.

When a Zoom View is no longer needed, call the L_DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowHasZoomView, L_CreateZoomView, L_GetZoomViewProps, L_DestroyZoomView, L_GetZoomViewsCount
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

void UpdateZoomView(HWND hWnd)
{
L_UINT uCount,i;
ZOOMVIEWPROPS ZoomViewProps;
memset(&ZoomViewProps,0,sizeof(ZOOMVIEWPROPS));

if(L_WindowHasZoomView (hWnd))
{
L_GetZoomViewsCount (hWnd, &uCount);

for(i=0; i < uCount;++i)
{
ZoomViewProps.uIndex = i;
L_GetZoomViewProps (hWnd, &ZoomViewProps, sizeof(ZoomViewProps));
ZoomViewProps.bCallouts = FALSE;
L_UpdateZoomView(hWnd, &ZoomViewProps);
}
}
}


L_UseBitmapClass

#include "l_bitmap.h"

L_VOID EXT_FUNCTION L_UseBitmapClass(L_VOID)

Dynamically loads the appropriate DLL to let your program use the L_BITMAPCLASS registered class.

Returns

None.

Comments

Because the L_BITMAPCLASS registered class uses messages rather than function calls, the required dynamic link library (LTWND14n.dll or LTWND12w.dll) is not loaded automatically. Therefore, the toolkit provides this dummy function in the DLL, which you can call before using the registered class messages.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Topics:

Window Messages and Styles

Example

/* This example demonstrates programming basics for the LEAD registered class. */
int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg; /* Message structure, See Windows SDK for more information. */
HWND hwnd; /* Handle to the application window */
LEADBITMAPLOAD LoadStruct; /* Structure for the name of the DLL */
UNREFERENCED_PARAMETER (hPrevInstance);
L_UseBitmapClass ();
/* Create a normal overlapped window with scroll bars and automatic window
sizing when a bitmap is loaded. */
hwnd = CreateWindow (L_BITMAPCLASS,
TEXT("L_BITMAPCLASS Registered Class Example"),
WS_OVERLAPPEDWINDOW |
WS_CLIPCHILDREN |
WS_VSCROLL |
WS_HSCROLL |
L_BS_THUMBTRACK |
L_BS_SIZEWINDOW,
0,
0,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow (hwnd, nCmdShow);
/* Load the bitmap and force screen update */
#ifdef WIN32
memset (&LoadStruct, 0, sizeof (LoadStruct));
#else
_fmemset (&LoadStruct, 0, sizeof (LoadStruct));
#endif
LoadStruct.uStructSize = sizeof (LoadStruct);
lstrcpy (LoadStruct.Name, TEXT("IMAGE3.CMP")); /* Get the name of the image file */
SendMessage (hwnd,
L_BM_LOAD, /* Send the message to load the image */
TRUE,
(LONG) (LPSTR) & LoadStruct);
/* Normal message loop. The L_BITMAPCLASS window procedure will post
a WM_QUIT message if there is not a parent. Such as in this case... */
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return (0);
}


L_UseImageListControl

#include "ltlst.h"

L_VOID EXT_FUNCTION L_UseImageListControl(L_VOID)

Dynamically loads the appropriate DLL to let your program use the LTIMGLISTCLASS registered class.

Returns

None.

Comments

Because the LTIMGLISTCLASS registered class uses messages rather than function calls, the required dynamic link library (LTLST14n.dll) is not loaded automatically. Therefore, the toolkit provides this dummy function in the DLL, which you can call before using the registered class messages.

Required DLLs and Libraries

LTLST

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreateImageListControl
Topics: | ImageList Control Messages, ImageList Control Command Notifications, Using the ImageList Control

Example

HWND hCtl;
HINSTANCE hInst;

L_VOID CreateCtl(HWND hWnd)
{
/* create the image list control */
L_UseImageListControl(); /* make sure dll is loaded */
hCtl = CreateWindow(LTIMGLISTCLASS,
TEXT(""),
WS_CHILD | WS_BORDER,
10,
10,
250,
250,
hWnd,
NULL,
hInst,
NULL);
ShowWindow (hCtl, SW_SHOW);
}


L_UserFilterBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_UserFilterBitmap (pBitmap, pFilter);

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPUSERFLT pFilter; | /* pointer to a structure */

Filters the bitmap based on a user-defined filter / mask. This function is similar to the spatial and binary filter functions. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
pFilter | Pointer to an USERFLT structure that contains information about the mask to be applied.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

With this function you can create a user-defined filter and apply it to the image. The selected filter is passed as a parameter to this function. 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 function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_MaxFilterBitmap, L_MinFilterBitmap, L_AddBitmapNoise, L_SharpenBitmap, L_PosterizeBitmap, L_MosaicBitmap, L_EmbossBitmap, L_AverageFilterBitmap, L_MedianFilterBitmap, L_IntensityDetectBitmap, L_SpatialFilterBitmap, L_BinaryFilterBitmap, L_OilifyBitmap, L_SolarizeBitmap, L_WindowLevel, L_AddShadowBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_RevEffectBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_HighPassFilterBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Removing Noise

Example

/*In this example the high pass filter will be applied using user defined matrix*/
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
LPUSERFLT pFilter;
L_INT i, j;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Allocate the user filter structure. And also we need a (3x3) matrix with 9 elements. */
pFilter = malloc(sizeof(USERFLT) + 9 * sizeof(L_INT));
/* Initialize the array with factor used to apply the high pass filter */
for(i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
if(j == 1 || i == 1)
{
if(j == 1 && i == 1)
pFilter->ufltMatrix[i * 3 + j] = 5;
else
pFilter->ufltMatrix[i * 3 + j] = -1;
}
else
pFilter->ufltMatrix[i * 3 + j] = 0;
}
}
pFilter->uStructSize = sizeof(USERFLT);
pFilter->ufltWidth = 3;
pFilter->ufltHeight = 3;
pFilter->ufltCenter.x = 1;
pFilter->ufltCenter.y = 1;
pFilter->ufltDivisor = 1;
pFilter->nfltOffset = 0;
pFilter->ufltFlag = UD_SUM;

/* Apply the high pass custom filter */
L_UserFilterBitmap (&LeadBitmap, pFilter);

/* Free the filter */
free(pFilter);


L_ValidatePlaybackLines

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ValidatePlaybackLines(hPlayback, nRow, nLines)

HPLAYBACK hPlayback; | /* playback handle */
L_INT nRow; | /* row number of the first line to validate */
L_INT nLines; | /* number of lines to validate */

Validates lines of a bitmap that was added during a FILEREADCALLBACK function using the L_AppendPlayback function.

Parameter | Description
hPlayback | Handle that references the animation playback.
nRow | Row number of the first line in the bitmap to validate. In the FILEREADCALLBACK function, this corresponds to the first line in the buffer.
nLines | Number of lines to validate. In the FILEREADCALLBACK function, this corresponds to the number of lines in the buffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The L_AppendPlayback function enables you to update a bitmap list in a FILEREADCALLBACK function, so that you can play an animation file as it is being loaded. The L_ValidatePlaybackLines function lets you validate the lines that the animation playback engine will render to the target bitmap.

Required DLLs and Libraries

LTDIS
LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_CreatePlayback, L_DestroyPlayback, L_GetPlaybackDelay, L_CancelPlaybackWait, L_ProcessPlayback, L_ClearPlaybackUpdateRect, L_GetPlaybackIndex, L_GetPlaybackState, L_GetPlaybackUpdateRect, L_SetPlaybackIndex, L_AppendPlayback
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For a short example, refer to L_AppendPlayback. For complete sample code, refer to the FRAME.C module of the DEMO example.


L_VersionInfo

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_VersionInfo(pVersionInfo, uStructSize)

pVERSIONINFO pVersionInfo; | /* pointer to the VERSIONINFO structure */
L_UINT uStructSize | /* Size of the structure pointed to by pVersionInfo. */

Loads LEADTOOLS product information into a structure.

Parameter | Description
pVersionInfo | Pointer to the VERSIONINFO structure.
uStructSize | Size of the VERSIONINFO structure pointed to by pLoadOptions. The size of this structure must be specified.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

To use this function, declare a VERSIONINFO variable and pass its address as the parameter of this function. The function updates the fields in the structure. For field descriptions, refer to the VERSIONINFO structure.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_IsSupportLocked, L_UnlockSupport

Example

For complete sample code, refer to the INFO example.

/* This example gets product information and displays it in a message box */
VERSIONINFO VersionInfo; /* LEAD Version Information structure. */
L_TCHAR szMessage[ 1024 ]; /* Buffer to hold information for display. */
/* Get the version information */
VersionInfo.uStructSize = sizeof(VERSIONINFO);
L_VersionInfo(&VersionInfo, sizeof(VERSIONINFO));
/* Format the message string with data from the VERSIONINFO structure */
wsprintf(szMessage, TEXT("LEAD Product: %hs, %hs\n\n")
TEXT("Version %d.%d\n\n")
TEXT("Date: %hs\n\n")
TEXT("Time: %hs"),
(L_CHAR L_FAR *)VersionInfo.Product,
(L_CHAR L_FAR *)(VersionInfo.Level == TOOLKIT_LEVEL_DOCUMENT ?
TEXT("Document/Medical ") :
TEXT("Professional Edition")),
VersionInfo.MajorNumber,
VersionInfo.MinorNumber,
(L_CHAR L_FAR *)VersionInfo.Date,
(L_CHAR L_FAR *)VersionInfo.Time);
/* Display the message string */
MessageBox( NULL, szMessage, TEXT("API Version Information"), MB_OK );


L_VignetteBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_VignetteBitmap(pBitmap, pVignetteInfo)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPVIGNETTEINFO pVignetteInfo; | /* pointer to a structure */

Draws a specified shape and feathers it to the bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap to which to apply the effect.
pVignetteInfo | Pointer to the VIGNETTEINFO structure that contains information about the vignette effect.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function 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 L_RomanMosaicBitmap using the following values:

Parameter | Value
ptCenter | (144, 181)
nFading | 50
uFadingRate | 33
uWidth | 145
uHeight | 181
crVigColor | White
uFlags | VIG_ELLIPSE | VIG_FILLIN

The following figure results:

This function 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.

To update a status bar or detect a user interrupt during execution of this function, Refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_UnderlayBitmap, L_CombineBitmap, L_FeatherAlphaBlendBitmap, L_CreateFadedMask, L_TextureAlphaBlendBitmap
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects

Example

BITMAPHANDLE LeadBitmap;/* Bitmap handle for the image */
VIGNETTEINFO VignetteInfo; /* Structure which store the required parameters*/
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("Image1.cmp"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL);
/*Fill the structures with the required parameters, Vignette shape is ellipse, Feathering inside the vignette object, the ellipse is centered, fading color is blue*/
VignetteInfo.uStructSize = sizeof(VIGNETTEINFO);
VignetteInfo.crVigColor = RGB(0,0,255);
VignetteInfo.nFading = 50;
VignetteInfo.uFlags = VIG_ELLIPSE | VIG_FILLIN;
VignetteInfo.uFadingRate = 100;
VignetteInfo.uHeight = LeadBitmap.Height / 2;
VignetteInfo.uWidth = LeadBitmap.Width / 2;
VignetteInfo.ptCenter.x = LeadBitmap.Width / 2;
VignetteInfo.ptCenter.y = LeadBitmap.Height / 2;
L_VignetteBitmap(&LeadBitmap, &VignetteInfo);


L_WaveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WaveBitmap(pBitmap, uAmplitude, uWaveLen, nAngle, uHorzFact, uVertFact, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* wave’s size */
L_UINT uWaveLen; | /* wave’s length */
L_INT nAngle; | /* wave’s rotation angle */
L_UINT uHorzFact; | /* size of horizontal wave */
L_UINT uVertFact; | /* size of vertical wave */
COLORREF crFill; | /* fill color */
L_UINT uFlags; | /* flags */

Distorts the bitmap with two perpendicular waves at the specified angle and with the specified wave type. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmplitude | Wave’s magnitude. The values range from 1 to the length of the image's diagonal.
uWaveLen | Value that represents the wave length, if DIS_PER is set in the uFlags parameter. Possible values range from 1 – 100 and give the wavelength as a percentage of the bitmap dimensions. If DIS_FRQ is set in uFlags, this value is the number of repeated waves.
nAngle | Wave’s rotation angle in hundredths of degrees. The valid range is from –18000 to 18000 (The value in degrees is nAngle divided by 100).
uHorzFact | Size of the horizontal wave, given as a percentage. The valid range is from 0 to 100.
uVertFact | Size of the vertical wave, given as a percentage. The valid range is from 0 to 100.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | Flags that indicate how to handle exposed areas, the type of information in the uWaveLength 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 uWaveLen parameter:
 | Value | Meaning
 | DIS_PER | [0x0000] The value in uWaveLen is a wavelength given as a percent of the bitmap dimensions. If this value is used, the valid range of uWaveLen is from 0 to 100.
 | DIS_FRQ | [0x0010] The value in uWaveLen 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function applies two perpendicular waves. The uHorzFact and uVertFact 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgWave , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* apply sinusoidal waves on the image*/
L_WaveBitmap(&LeadBitmap, 20, 25, 0, 100 , 100, 0, FILL_RPT | DIS_PER | WV_SIN);


L_WindBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WindBitmap (pBitmap, uDim, nAngle, uOpacity)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* effect size */
L_INT nAngle; | /* rotation angle */
L_UINT uOpacity; | /* opacity */

Creates thin lines, directed along the specified angle, on the specified bitmap. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uDim | Size, in pixels, of the thin lines used to create the wind effect. Possible values range from 1 - 100.
nAngle | 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 nAngle divided by 100).
uOpacity | Density, in pixels, of the thin lines used to create the wind effect. The valid range is from 0 to 100.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_ZoomBlurBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgWind , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* apply wind effect on the image*/
L_WindBitmap (&LeadBitmap, 40, 4500, 0);


L_WindowHasMagGlass

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_WindowHasMagGlass(hWnd)

HWND hWnd;

/* handle to a window */

Determines whether the specified window has a magnifying glass attached to it.

Parameter | Description
hWnd | Handle to a window. This function will determine whether there is a magnifying glass attached to this window.

Returns

TRUE | The specified window has a magnifying glass attached to it.
FALSE | The specified window does not have a magnifying glass attached to it.

Comments

To attach the magnifying glass to a window, call L_StartMagGlass or L_StartMagGlass.

When the magnifying glass is no longer needed, call L_StopMagGlass to stop the magnifying glass procedure and to detach it from the window handle.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_StartMagGlass, L_StartMagGlass, L_StopMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to L_StartMagGlass.


L_WindowHasZoomView

#include "l_bitmap.h"

L_BOOL EXT_FUNCTION L_WindowHasZoomView(hWnd)

HWND hWnd;

/* handle to a window */

Determines whether the specified window has a zoomed view attached to it. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to a window.

Returns

TRUE | The specified window has a zoomed view attached to it.
FALSE | The specified window does not have a zoomed view attached to it.

Comments

To attach a zoomed view to a window, call the L_CreateZoomView function. To display a zoomed view, call the L_RenderZoomView function.

When the zoomed view is no longer needed, call the L_DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

Required DLLs and Libraries

LTZMV

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images
 | Using the Magnifying Glass

Example

For an example, refer to L_CreateZoomView.


L_WindowLevel

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WindowLevel (pBitmap, nLowBit, nHighBit, pLUT, uLUTLength, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nLowBit; | /* low bit to use */
L_INT nHighBit; | /* high bit to use */
RGBQUAD L_HUGE *pLUT; | /* lookup table */
L_UINT uLUTLength; | /* number of entries */
L_UINT uFlags; | /* flags */

Sets up the paint or paint and image processing functions' window leveling options for a specific bitmap. This function is available in Document/Medical toolkits only.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be leveled.
nLowBit | Value indicating the low bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
nHighBit | Value indicating the high bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
pLUT | Optional lookup table that can be used to implement a user defined conversion. For every intensity value between 0 and 2 raised to the power of (nHighBit - nLowBit + 1)-1 there should be a corresponding entry in the lookup table that contains an RGB quad. If pLUT is NULL, the conversion is a normal shift (right or left) and the painted bitmap is 8-bit grayscale. If pLUT is not NULL, the painted bitmap is a 24-bit bitmap.
uLUTLength | Value indicating the number of entries pointed to by pLUT. If pLUT is NULL, then set this to NULL too.
uFlags | Value indicating whether pLUT is used by the paint and image processing functions or only by the paint functions. Possible values are:
 | WINDOWLEVEL_PAINT | [0x00] pLUT is used only by the paint functions.
 | WINDOWLEVEL_PAINT_AND_PROCESS | [0x01] pLUT is used for both paint and image processing routines.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Provides "on demand" window leveling for the paint functions and does not alter the image data. To convert the image data to a window leveled bitmap, use L_WindowLevelBitmap.

If WINDOW_LEVEL_PAINT_PROCESS is specified, then all image processing functions will take the pLUT into account.

For information on saving bitmaps that have been window leveled, refer to Saving Window-Leveled Bitmaps.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_WindowLevelBitmap, L_PaintDC, L_PaintDCBuffer, L_PaintDCEffect, L_PaintRgnDC, L_PaintRgnDCBuffer, L_PaintRgnDCEffect, L_WindowLevelFillLUT, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData
Topics: | Raster Image Functions: Palettes
 | Raster Image Functions: Displaying and Printing
 | Color Halftone and Halftone Images
 | Grayscale Images
 | Saving Window-Leveled Bitmaps
 | Raster Image Functions: Processing an Image

Example

This example sets the window level values for painting and processing the bitmap with a custom palette.

void TestFunction(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_UINT32 x;
RGBQUAD L_HUGE* ptmp;
RGBQUAD L_HUGE* pLUT;
L_INT nLowBit;
L_INT nHighBit;
L_INT nLow;
L_INT nHigh;
L_UINT32 nSize;

/* Change the bitmap to 16-bit grayscale */
L_GrayScaleBitmap(pBitmap, 16 );

L_GetMinMaxBits(pBitmap, &nLowBit, &nHighBit);
L_GetMinMaxVal(pBitmap, &nLow, &nHigh);

nSize = (L_UINT32)(1L<<(pBitmap->HighBit - pBitmap->LowBit + 1));
pLUT = (RGBQUAD L_HUGE*)GlobalAllocPtr(GHND, nSize * sizeof(RGBQUAD));

ptmp = pLUT;
/* fill the first half of the LUT with RED */
for(x=0;x<nSize/2;x++)
{
ptmp->rgbRed = 255;
ptmp->rgbGreen = 0;
ptmp->rgbBlue = 0;
ptmp->rgbReserved = 0;
ptmp++;
}
/* fill the rest with gray values */
for(x=nSize/2;x<nSize;x++)
{
ptmp->rgbRed = ((L_UCHAR) ((L_UINT32) (x - nLow) * 255 / (nHigh - nLow)));
ptmp->rgbGreen = ptmp->rgbRed;
ptmp->rgbBlue = ptmp->rgbGreen;
ptmp->rgbReserved = 0;
ptmp++;
}

L_WindowLevel ( pBitmap, nLowBit, nHighBit,
(RGBQUAD L_HUGE*)pLUT, nSize, WINDOWLEVEL_PAINT_AND_PROCESSING );

GlobalFreePtr(pLUT);
}


L_WindowLevelBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WindowLevelBitmap (pBitmap, nLowBit, nHighBit, pLUT, uLUTLength, nOrderDst)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nLowBit; | /* low bit to use */
L_INT nHighBit; | /* high bit to use */
RGBQUAD L_HUGE *pLUT; | /* lookup table */
L_UINT uLUTLength; | /* number of entries */
L_INT nOrderDst; | /* Destination color order */

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.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to be leveled.
nLowBit | Value indicating the low bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
nHighBit | Value indicating the high bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
pLUT | Optional lookup table that can be used to implement a user defined conversion. For every intensity value between 0 and 2 raised to the power of (nHighBit - nLowBit + 1) - 1 there should be a corresponding entry in the lookup table that contains an RGB quad. If pLUT is NULL, the conversion is a normal shift (right or left) and the output bitmap is 8-bit grayscale. If pLUT is not NULL, the output bitmap is a 24-bit bitmap.
uLUTLength | Value indicating the number of entries pointed to by pLUT.
nOrderDst | Value indicating the color order if the output bitmap will be 24-bit. If pLUT is NULL, this parameter is ignored. Possible values are:
 | Value | Meaning
 | ORDER_RGB | [0] The input colors are in red-green-blue order.
 | ORDER_BGR | [1] The input colors are in blue-green-red order.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will convert the bitmap to a window leveled bitmap. To implement window leveling without affecting the image, use L_WindowLevel.

The bitmap data is changed by this function.

This function supports 12 and 16-bit grayscale. 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.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_WindowLevel, L_WindowLevelFillLUT, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData
Topics: | Raster Image Functions: Palettes
 | Color Halftone and Halftone Images
 | Grayscale Images
 | Saving Window-Leveled Bitmaps
 | Raster Image Functions: Processing an Image

Example

This example window levels the bitmap with a custom palette. The image data is changed in this example.

void TestFunction(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_UINT32 x;
RGBQUAD L_HUGE* ptmp;
RGBQUAD L_HUGE* pLUT;
L_INT nLowBit;
L_INT nHighBit;
L_INT nLow;
L_INT nHigh;
L_UINT32 nSize;

/* Change the bitmap to 16-bit grayscale */
L_GrayScaleBitmap(pBitmap, 16 );

L_GetMinMaxBits(pBitmap, &nLowBit, &nHighBit);
L_GetMinMaxVal(pBitmap, &nLow, &nHigh);

nSize = (L_UINT32)(1L<<(pBitmap->HighBit - pBitmap->LowBit + 1));
pLUT = (RGBQUAD L_HUGE*)GlobalAllocPtr(GHND, nSize * sizeof(RGBQUAD));

ptmp = pLUT;
/* fill the first half of the LUT with RED */
for(x=0;x<nSize/2;x++)
{
ptmp->rgbRed = 255;
ptmp->rgbGreen = 0;
ptmp->rgbBlue = 0;
ptmp->rgbReserved = 0;
ptmp++;
}
/* fill the rest with gray values */
for(x=nSize/2;x<nSize;x++)
{
ptmp->rgbRed = ((L_UCHAR) ((L_UINT32) (x - nLow) * 255 / (nHigh - nLow)));
ptmp->rgbGreen = ptmp->rgbRed;
ptmp->rgbBlue = ptmp->rgbGreen;
ptmp->rgbReserved = 0;
ptmp++;
}

L_WindowLevelBitmap ( pBitmap, nLowBit, nHighBit,
(RGBQUAD L_HUGE*)pLUT, nSize, ORDER_BGR);

GlobalFreePtr(pLUT);
}


L_WindowLevelFillLUT

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WindowLevelFillLUT (pLUT, ulLUTLen,crStart, crEnd, nLow, nHigh, uLowBit, uHighBit, nMinValue, nMaxValue, nFactor, uFlags)

RGBQUAD L_HUGE * pLUT; | /* lookup table */
L_UINT32 ulLLUTLen; | /* number of entries */
COLORREF crStart; | /* start color */
COLORREF crEnd; | /* end color */
L_INT nLow; | /*low value for leveling */
L_INT nHigh; | /*high value for leveling */
L_UINT uLowBit; | /* low bit */
L_UINT uHighBit; | /* high bit */
L_INT nMinValue; | /* bitmap’s minimum value */
L_INT nMaxValue; | /* bitmap’s maximum value */
L_INT nFactor; | /* factor */
L_UINT uFlags; | /* flags */

Fills the user-allocated LUT with the selected LUT type based on the specified values. This function is available in the Document/Medical Toolkits only.

Parameter | Description
pLUT | Pointer to the lookup table to be filled by this function. For every intensity value between 0 and 2 raised to the power of (nHighBit - nLowBit + 1)-1 there should be a corresponding entry in the lookup table that contains an RGB quad.
ulLUTLen | Value indicating the number of entries pointed to by pLUT.
crStart | Starting color value for the gradient.
crEnd | Ending color value for the gradient.
nLow | The low value for the range to be filled.
nHigh | The high value for the range to be filled.
nLowBit | Value indicating the low bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
nHighBit | Value indicating the high bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
nMinValue | The bitmap's minimum value. This value can be obtained by L_GetMinMaxVal.
nMaxValue | The bitmap's maximum value. This value can be obtained by L_GetMinMaxVal.
nFactor | Value that indicates the factor to be applied in the function operation specified in the uFlag parameter. This parameter is used only if uFlags 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.
uFlags | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to fill in the LUT, used in L_WindowLevel or L_WindowLevelBitmap, according to LUT type flag.

The LUT 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 function performs a linear interpolation between the two points nLow and nHigh and stores the results in the lookup table, regardless of the value in uFlags.

If uFlag 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 function

uEnd = the nHigh parameter of this function

If uFlag 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 function

uEnd = the nHigh parameter of this function

If uFlag 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 function

uEnd = the nHigh parameter of this function

If uFlag is FILLLUT_LINEAR, nFactor is ignored. The function fills the lookup table linearly.

Note:

This function only works for 12 or 16 bit grayscale images. Trying to use this function with other images will result in an error.

You must allocate the memory for the LUT before calling this function. 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 for unsigned data would be mapped to colors between (0, 0, 0) and (255, 255, 255). With this function, 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 unsigned 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.

Required DLLs and Libraries

LTDIS

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_WindowLevel, L_WindowLevelBitmap
Topics: | Raster Image Functions: Palettes
 | Raster Image Functions: Displaying and Printing
 | Using Color Values in LEADTOOLS
 | Color Halftone and Halftone Images
 | Grayscale Images
 | Saving Window-Leveled Bitmaps
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunc(pBITMAPHANDLE pBitmap)
{
RGBQUAD L_HUGE* pLUT;
L_INT nRet;
L_INT nMin, nMax;
L_INT nLowBit, nHighBit;

L_UINT nSigned;

/* allocate the lookup table */
pLUT = (RGBQUAD *)malloc(sizeof(RGBQUAD) * (1<<(pBitmap->HighBit - pBitmap->LowBit + 1)));

/* get the bitmap's min/max values */
L_GetMinMaxBits(pBitmap, &nLowBit, &nHighBit);
L_GetMinMaxVal(pBitmap, &nMin, &nMax);

nLowBit  = pBitmap->LowBit;
nHighBit = pBitmap->HighBit;

if(pBitmap->Flags.Signed)
nSigned = FILLLUT_SIGNED;
else
nSigned = FILLLUT_UNSIGNED;

/* fill the LUT with a color gradient */
nRet = L_WindowLevelFillLUT((RGBQUAD L_HUGE*)pLUT,
1<<(pBitmap->HighBit - pBitmap->LowBit + 1),
RGB(255,0,0),    /* RED              */
RGB(0,0,255),    /* BLUE             */
23000,           /* Starting value   */
45000,           /* Ending value     */
nLowBit,         /* Bitmap's LowBit  */
nHighBit,        /* Bitmap's HighBit */
nMin,            /* Bitmap's MinVal  */
nMax,            /* Bitmap's MaxVal  */
10,   /*nFactor*/
FILLLUT_INSIDE | FILLLUT_LINEAR |
 nSigned); /* Fill Inside

/* window level the bitmap using the new LUT */
nRet = L_WindowLevelBitmap ( pBitmap,
nLowBit,
nHighBit,
(RGBQUAD L_HUGE*)pLUT,
1<<(pBitmap->HighBit - pBitmap->LowBit + 1),
ORDER_BGR);

/* free the table */
free(pLUT);
return;
}


L_WriteFileComment

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileComment(pszFile, pSaveOptions)

L_TCHAR L_FAR * pszFile; | /* filename */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes comments to an existing file.

Parameter | Description
PszFile | Character string that contains the filename.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options. pSaveOptions.PageNumber indicates the page on which to write the comments.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function only applies to TIF, uncompressed EXIF, or FPX files.

This function can be used to write TIFF comments without saving an image. It will also write all the comments set using the L_SetComment function. These are the same comments that will be written the next time a TIFF page is saved. For more information on saving files, refer to L_SaveFile. For more information on setting comments, refer to L_SetComment.

Comments to be written to a file may be passed directly to L_WriteFileCommentExt.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetComment, L_GetComment, L_WriteFileCommentExt, SAVEFILEOPTION, L_WriteFileMetaData
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

void TestSaveComment()
{
SAVEFILEOPTION SaveFileOption;

/* Set the tag data to be saved */
L_SetComment(CMNT_SZARTIST, "Me", 3);

L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
SaveFileOption.PageNumber = 1;

/* Save the new comment to the file . */
L_WriteFileComment(TEXT("TEST.TIF"), &SaveFileOption);

/* Now select the file in the main demo and click on FileInfo.
"Me" should appear in the artist field */

}


L_WriteFileCommentExt

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileCommentExt (pszFile, uType, pComments, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* file name */
L_UINT uType; | /* type of comment */
LPFILECOMMENTS pComments; | /*pointer to a FILECOMMENTS structure containing information about the comments */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes a comment into a FlashPix file. Only used to change a comment in an existing file.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
uType | The type of comment. Refer to Types of File Comments. For more information concerning FlashPix file comments, see FlashPix File Comments.
pComments | Pointer to a structure which contains one data value and two pointers. The data value indicates the number of comments stored. One pointer points to an array of pointers which in turn point to individual Comments. The other pointer points to an array of integers which indicate the size of each Comment stored.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Presently this function only works with FlashPix format files.

To write comments to a file, all the comments to be added to the file must be set using L_SetComment. L_SetComment, by itself, does not write a comment to a file, it prepares the values for the next save. Once all comments are set, the comments are saved using any function which saves files, such as L_SaveFile or L_SaveBitmap when creating a new file.

To save TIFF comments without overwriting a saved image, use L_WriteFileComment.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_ReadFileComment, L_WriteFileComment, L_ReadFileCommentExt, L_SetComment, L_GetFileCommentSize, L_WriteFileMetaData
Topics: | Raster Image Functions: Maintaining File Comments,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

FILECOMMENTS FileComments;
L_UCHAR L_FAR *pPointer[CMNT_LAST + 1];
L_UINT uSize[CMNT_LAST + 1];
FPXCOMMENT_HEADER_ELEMENT L_FAR *pElement;
L_UINT16 L_FAR *pShort;
L_FLOAT L_FAR *pFloat;
L_UINT I;
L_UCHAR Buffer[1024];
FileComments.count = CMNT_LAST + 1;
FileComments.pointer = pPointer;
FileComments.size = uSize;
for ( I = 0; I < CMNT_LAST; I++)
{
uSize[I] = 0;
pPointer[I] = NULL;
}
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *) Buffer;
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) + sizeof(L_FLOAT);
pElement->type = FPXENUM_FLOAT;
pFloat = (L_FLOAT L_FAR*)(L_UINT16 L_FAR *)(pElement + 1);
*pFloat = 12.34f;
uSize[CMNT_FPXFILMSIZEX] = pElement->size;
pPointer[CMNT_FPXFILMSIZEX] = (L_UCHAR L_FAR *)pElement;
pElement = (FPXCOMMENT_HEADER_ELEMENT L_FAR *)(pFloat + 1);
pElement->size = sizeof(FPXCOMMENT_HEADER_ELEMENT) + sizeof(L_UINT16);
pElement->type = FPXENUM_SHORT;
pShort = (L_UINT16 L_FAR *)(pElement + 1);
*pShort = 1234;
uSize[CMNT_FPXFILMFRAMENUMBER] = pElement->size;
pPointer[CMNT_FPXFILMFRAMENUMBER] = (L_UCHAR L_FAR *)pElement;
L_WriteFileCommentExt(TEXT("TEST.FPX"), CMNT_FPXFILMDESCRIPTIONGROUP, &FileComments, NULL);


L_WriteFileGeoKey

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileGeoKey(pszFile, pSaveOptions)

L_TCHAR L_FAR * pszFile; | /* file name */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes GeoKeys to a file or changes the existing GeoKeys in a file.

Parameter | Description
pszFile | Character string that contains the filename in which to write the GeoKeys.
pSaveOptions | Pointer to a structure that contains optional extended save options. Pass NULL to use the default save options. pSaveOptions.PageNumber indicates the page on which to write the tags. Note that an error code will be returned if the page does not exist.

Returns

SUCCESS | The function was successful.
ERROR_NOTHING_TO_DO | No GeoKeys have been set before calling this function.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function writes to or changes the GeoKeys in an existing file.

This function will write all the GeoKeys that have been set using L_SetGeoKey. There must be at least one GeoKey set for this function to work. If no GeoKeys have been set, an error will be returned by this function.

This function works only with TIFF files.

If you also want to write the other TIFF tags and comments, use L_WriteFileMetaData instead of this function.

Note:

Use this function 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.

Required DLLs and Libraries

LTFIL

LFTIF

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_SetGeoKey, L_GetGeoKey, L_ReadFileGeoKey, L_EnumFileGeoKeys, L_SaveFile, L_SaveBitmap, L_WriteFileMetaData
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

#define FILENAME "e:\\i\\GeoTIFF\\GeoTIFF.tif"
/* Displays a GeoKey */
static L_VOID DisplayKey(L_UINT16 uTag, L_UINT16 uType, L_UINT32 uCount, L_VOID L_FAR*pData)
{
L_TCHAR s[500];

wsprintf(s, "Key = %d, Type = %s, Count = %d", uTag, uType == TAG_ASCII ? "ASCII" : (uType == TAG_SHORT ? "SHORT" : "DOUBLE"), uCount);
MessageBox(NULL, s, "Key Info", MB_OK);

if(uType == TAG_ASCII)
{
/* LEADTOOLS makes the string null-terminated, so it is OK to pass it to MessageBox.
Note that for Unicode builds you will need to convert this array of bytes to array of WCHAR
*/
MessageBox(NULL, (LPSTR)pData, "Key Value", MB_OK);
}
else
{
if(uType == TAG_SHORT)
if(uCount == 1)
wsprintf(s, "%d", *(L_UINT16 L_FAR*)pData);
else
wsprintf(s, "{%d, ...}", *(L_UINT16 L_FAR*)pData);
else
if(uCount == 1)
sprintf(s, "%g", *(L_DOUBLE L_FAR*)pData);
else
sprintf(s, "{%g, ...}", *(L_DOUBLE L_FAR*)pData);
MessageBox(NULL, s, "Key Value", MB_OK);
}
}

/* This example sets the GTModelTypeGeoKey key (1024), writes it to an existing file and reads the key back */
L_INT TestReadFileGeoKey(HWND hWnd)
{
L_INT nRet;
L_UINT16 uProjectCoordinationSystem = 1;

L_UINT uType;
L_UINT uCount;
L_INT nSize;
L_VOID L_FAR*pData;

// set the GTModelTypeGeoKey key
L_SetGeoKey(1024, TAG_SHORT, 1, &uProjectCoordinationSystem);

// write the GeoKey to an existing file
nRet = L_WriteFileGeoKey(FILENAME, NULL);
if(nRet == SUCCESS)
{
nSize = L_ReadFileGeoKey(FILENAME, 1024, &uType, &uCount, NULL, NULL);
if(nSize > 0)
{
pData = malloc(nSize);
if(pData != NULL)
{
/* read the GeoKey */
nRet = L_ReadFileGeoKey(FILENAME, 1024, &uType, &uCount, pData, NULL);
DisplayKey(1024, uType, uCount, pData);
free(pData);
}
}
}

return nRet;
}


L_WriteFileMetaData

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileMetaData(pFile, uFlags, pSaveFileOption)

L_TCHAR L_FAR * pFile; | /* file name */
L_UINT uFlags; | /* type of metadate */
pSAVEFILEOPTION pSaveOption; | /* pointer to optional extended save options */

Writes metadata of the specified type to the specified file.

Parameter | Description
pFile | Character string that contains the name of the file in which to write the metadata.
uFlags | Flags that indicate the type of metadata to write. Possible values are:
 | Value | Meaning
 | METADATA_COMMENTS | [0x0001] Write comments.
 | METADATA_TAGS | [0x0002] Write tags.
 | METADATA_MARKERS | [0x0004] Write markers.
 | METADATA_ALL | [0xFFFF] Write all metadata (tags, comments and markers).
 | These values can be combined using OR (|) or +.
pSaveFileOption | Reserved for future use. Pass NULL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

L_WriteFileMetaData can be used to update an existing file (pFile) with comments, tags and/or markers.

Before calling this function, the user should set:

Comments using the L_SetComment function.

Tags using the L_SetTag function.

Markers using the L_SetMarkers function.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadMarkers, L_CreateMarkers, L_InsertMarker, L_EnumMarkers, L_GetMarkerCount, L_GetMarker, L_WriteFileComment, L_WriteFileTag
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

/* This example writes a proprietary tag and a comment at the same time.
The output file should exist and should be a valid Exif file. */
L_INT nVal = 1234;
L_SetTag (0x8001, TAG_LONG, 1, &nVal);

L_SetComment (CMNT_SZDESC, "Comment written with L_WriteFileMetaData", 37);

L_WriteFileMetaData(TEXT("e:\\i\\1.tif"), METADATA_ALL, NULL);


L_WriteFileStamp

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileStamp(pszFile, pBitmap, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* file name*/
pBITMAPHANDLE pBitmap; | /* pointer to the target bitmap handle */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes a stamp in an existing FlashPix file.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
pBitmap | Pointer to the bitmap handle referencing the bitmap that will contain the thumbnail image.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The stamp will be written to the page designated in the SAVEFILEOPTION structure. If that page already has a stamp, it will be overwritten; if the page does not exist, the stamp will be written to the last page present in the file. If the file to which the stamp is being written does not exist, an error will be returned.

This function works for regular JPEG files and Exif JPEG files. For regular JPEG files, the stamp saved is always uncompressed and can be 8 or 24 bits per pixel. The stamp can be any width and height, but the stamp data and stamp header must completely fit in an APP0 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

For Exif JPEG files, the stamps can be uncompressed or JPEG compressed and must be 24 bits per pixel. Exif JPEG stamps are supposed to be 160 x 120. However, LEADTOOLS can save and read Exif JPEG stamps of other dimensions. The stamp, along with other information such as the TIFF_HEADER, 0th IFD, 1st IFD, etc. must completely fit in an APP1 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_GetExtFileOption,
 | L_SetExtFileOption,
 | L_ReadFileStamp,
 | L_GetCompressFileStamp
 | L_CompressBitmapWithStamp
Topics: | Raster Image Functions: Saving Files,
 | Raster Image Functions: Loading and Saving Stamp Images,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

Puts a stamp, in an existing FlashPix file "TEST2.FPX".

BITMAPHANDLE StampBitmap;
L_WriteFileStamp(TEXT("TEST2.FPX"),
 &StampBitmap, NULL);


L_WriteFileTag

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileTag(pszFile, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* filename */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes tags to a file or changes existing tags in a file.

Parameter | Description
pszFile | Character string that contains the filename.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options. pSaveOptions.PageNumber indicates the page on which to write the tags. Note that an error code will be returned if the page does not exist.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function writes tags into an existing file or changes tags in an existing file.

This function will write all the tags that have been set using L_SetTag. There must be at least one tag set for this function to work. If no tags have been set, an error will be returned by this function.

This function works only with TIFF files.

Note: | Use this function carefully. LEADTOOLS will not restrict the tags that you write. If you write bad tags, the file might become corrupted. Consult the TIFF documentation for a list of predefined tags. It is recommended that you write only the user-defined tags (the tags between 0x8000 and 0xFFFF).
 | See the TIFF documentation for a complete list of the TIFF tags and types.

Required DLLs and Libraries

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SetTag, L_GetTag, SAVEFILEOPTION, L_SaveFile, L_SaveBitmap, L_ReadFileTag, L_WriteFileMetaData, L_DeleteTag
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

void TestSaveTag()
{
L_UINT16 LogoPosition = 0x8001; /* my private tag */
L_UINT16 TagType = TAG_SHORT; /*
tagged data type */
L_UINT32 TagCount = 4; /* count of data items */
L_INT16 TagData[] = {5, 5, 24, 37};
L_VOID L_FAR * pTagData = &TagData; /* pointer to the buffer containing the data */
SAVEFILEOPTION SaveFileOption;

/* Set the tag data to be saved */
L_SetTag(LogoPosition, TagType, TagCount, pTagData);

L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
SaveFileOption.PageNumber = 1;

/* Save the file with the tag. Note that TEST.TIF must exist and contain at least one page! */
L_WriteFileTag(TEXT("TEST.TIF"), &SaveFileOption);

/* Clear the tag from memory */
L_SetTag(0, 0, 0, NULL);
}


L_WriteFileTransforms

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_WriteFileTransforms(pszFile, pTransforms, nFlags, pSaveOptions)

L_TCHAR, L_FAR * pszFile; | /* file name */
L_FAR * pFILETRANSFORMS pTransforms; | /* pointer to a transform structure */
L_INT nFlags | /* flag */
PSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Writes transforms to a FlashPix file.

Parameter | Description
pszFile | Character string containing the FlashPix file name.
pTransforms | Pointer to a transform structure.
nFlags | Flag used to determine how the image will be viewed. If nFlags is set, L_WriteFileTransforms will translate and/or scale the image so that the image will fall entirely within the view frame. These transformations will be incorporated into the affine matrix stored with the image. For example, if an image is rotated, as seen below, part of the image now falls outside the view frame. In this case, if nFlag is set, the image will be translated and scaled by L_WriteFileTransforms so that the entire image falls within the view frame.The translation and scaling are incorporated into the matrix stored with the image.
 | If nFlags is not set, the image would be appear as it does on the right, with part of the image "missing":
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Note:

Page number is specified in the SAVEFILEOPTION structure.

Also determines whether the image will be viewed "as is" when rotated, sheared or skewed, or whether the image will be translated and scaled such that the entire image may be viewed in its sheared, skewed or rotated state.

To load a FlashPix file with or without the transforms, see FlashPix Transforms Options.

For more information on transforms in general, refer to FILETRANSFORMS.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_GetExtFileOption,
 | L_SetExtFileOption,
 | L_ReadFileTransforms, L_HighPassFilterBitmap
Topics: | Raster Image Functions: Saving Files,
 | Raster Image Functions: Getting and Setting File Information,
 | Raster Image Functions: Doing Geometric Transformations,
 | Raster Image Functions: Modifying Intensity Values,
 | Loading and Saving Images

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

FILETRANSFORMS FileTransforms;

L_ReadFileTransforms (TEXT("TEST.FPX"), &FileTransforms, NULL);
//Increase the contrast by 20%
FileTransforms.fContrastAdjustment = FileTransforms.fContrastAdjustment * 1.2f;
L_WriteFileTransforms(TEXT("TEST.FPX"), &FileTransforms, FALSE, NULL);


L_ZigZagBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ZigZagBitmap(pBitmap, uAmplitude, uAttenuation, uFrequency, nPhase, CenterPt, crFill, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* wave's magnitude */
L_UINT uAttenuation; | /* amplitude decay rate */
L_UINT uFrequency; | /* number of repeated waves */
L_INT nPhase; | /* wave phase shift */
POINT CenterPt; | /* effect center */
COLORREF crFill; | /* color value */
L_UINT uFlags; | /* flags */

Radially distorts the bitmap by creating waves that twist the image around a specified center. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmplitude | Non-zero value that represents the magnitude of the wave (amount of displacement), if ZG_RAD is set in the uFlags parameter. The valid range is from 1 – 100.
uAttenuation | Attenuation value. The attenuation value indicates how rapidly the wave amplitude decays as the wave travels along the radial line. The valid range is from 0 - 1000.
uFrequency | Number of times the waves repeat along the radial line.
nPhase | Wave phase shift, in hundredths of degrees. The valid range is from –36000 to 36000 (The value in degrees is nPhase divided by 100).
CenterPt | POINT structure that contains the center of the zigzag wave.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlags | 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 CenterPt.
 | ZG_POND | [0x0010] Create distortion waves that resemble the ripples in a pond.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

As an example, if you use the following image:

And you call the L_ZigZagBitmap function using the following settings:

Parameter | Value
uAmplitude | 47
uAttenuation | 92
uFrequency | 13
nPhase | -162
CenterPt | (192, 82)
crFill | Black
uFlags | 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 L_RippleBitmap, L_ZoomWaveBitmap and L_RadWaveBitmap.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_RippleBitmap, L_ZoomWaveBitmap, L_RadWaveBitmap, L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply ZigZag waves from the center of the image*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap. Height/2;
L_ZigZagBitmap(&LeadBitmap, 50, 1000, 10, 0, CenterPt, 0, FILL_RPT | ZG_POND);


L_ZoomBlurBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ZoomBlurBitmap (pBitmap, uDim, uStress, CenterPt)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uDim; | /* amount of blur */
L_UINT uStress; | /* blur intensity */
POINT CenterPt; | /* center point */

Blurs the image along radial lines starting from the specified center point. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uDim | A value that represents the amount of the blur.
uStress | A value that represents the amount of the blur intensity.
CenterPt | POINT structure that contains the center point from which to blur the image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function will blur and zoom the image around the specified CenterPt. 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomWaveBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgZoomBlur , L_BricksTextureBitmap, L_CanvasBitmap, L_CloudsBitmap, L_ColoredBallsBitmap, L_DiffuseGlowBitmap, L_DisplaceMapBitmap, L_FragmentBitmap, L_HalfTonePatternBitmap, L_MaskConvolutionBitmap, L_MosaicTilesBitmap, L_OffsetBitmap, L_PerspectiveBitmap, L_PlasmaFilterBitmap, L_PointillistBitmap, L_RomanMosaicBitmap, L_VignetteBitmap, L_ZigZagBitmap

Topics:

Raster Image Functions: Doing Geometric Transformations

Processing an Image

Applying Artistic Effects

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* Zoom blur*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap.Height/2;
L_ZoomBlurBitmap (&LeadBitmap, 50, 5, CenterPt);


L_ZoomWaveBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ZoomWaveBitmap(pBitmap, uAmplitude, uFrequency, nPhase, uZomFact, CenterPt, crFill, uFlag)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uAmplitude; | /* zoom wave size */
L_UINT uFrequency; | /* number of repeated wave */
L_INT nPhase; | /* wave phase shift */
L_UINT uZoomFact; | /* wave growing factor */
POINT CenterPt; | /* zoom wave center */
COLORREF crFill; | /* color value */
L_UINT uFlag; | /* flag */

Distorts the bitmap with a wave zoomed from the specified center. This function is available in the Raster Pro and above toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle that references the bitmap on which to apply the effect.
uAmplitude | Zoom wave magnitude.
uFrequency | The number of repeated waves along the radial line.
nPhase | Wave phase shift. The valid range is from –36000 to 36000. The real value is nPhase divided by 100.
uZoomFact | The percentage the wave grows as it moves from the image center. The valid range is from 0 to 100.
CenterPt | POINT structure that contains the center point from which the wave is zoomed.
crFill | The COLORREF value that specifies the fill color for any exposed areas. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
uFlag | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function 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 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.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function 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 function.

Required DLLs and Libraries

LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_AddBitmapNoise, L_EmbossBitmap, L_MosaicBitmap, L_MotionBlurBitmap, L_OilifyBitmap, L_PosterizeBitmap, L_RemoveRedeyeBitmap, L_SolarizeBitmap, L_UnderlayBitmap, L_BendingBitmap, L_CylindricalBitmap, L_FreeHandShearBitmap, L_FreeHandWaveBitmap, L_PixelateBitmap, L_ImpressionistBitmap, L_PolarBitmap, L_PunchBitmap, L_RadialBlurBitmap, L_RadWaveBitmap, L_RippleBitmap, L_SpherizeBitmap, L_SwirlBitmap, L_WaveBitmap, L_WindBitmap, L_ZoomBlurBitmap, L_BumpMapBitmap, L_CubismBitmap, L_DrawStarBitmap, L_DryBitmap, L_FreePlaneBendBitmap, L_FreeRadBendBitmap, L_GlassEffectBitmap, L_GlowFilterBitmap, L_LensFlareBitmap, L_LightBitmap, L_OceanBitmap, L_PlaneBendBitmap, L_PlaneBitmap, L_SampleTargetBitmap, L_TunnelBitmap, L_DlgZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT CenterPt;

/* Load a bitmap at its own bits per pixel */
L_LoadBitmap(TEXT("IMAGE3.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

/* apply zoom wave from center of the image*/
CenterPt.x = LeadBitmap.Width/2;
CenterPt.y = LeadBitmap.Height/2;
L_ZoomWaveBitmap (&LeadBitmap, 20, 10 , 0 , 0, CenterPt, 0 , FILL_RPT);


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling L_UnlockSupport(L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling L_UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the .

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements.


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 LTKRN DLL, found in the REDIST\NONAG directory. This is also the version you must redistribute.

Duplication and Distribution Agreements

Click this button to start the LEADTOOLS Licensing help file.


JBIG Module

The JBIG Module is an add-on to any of the Document/Medical products in the LEADTOOLS product line. JBIG 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, and the various compression options. 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. LEAD’s JBIG support is available in 32-bit versions and must be used in conjunction with one of the LEADTOOLS Document/Medical products.

For more information, refer to Implementing JBIG Features

To enable this support, refer to JBIG Module Support Instructions.


JBIG Module Support Instructions

To implement JBIG Module support, you must do the following:

1. | Find the JBIG Module key on the JBIG Module Certificate e-mailed to you.
2. | Use the JBIG Module keyword with the L_UnlockSupport function to implement JBIG Module support in your application.


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 L_UnlockSupport function 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 LTKRN DLL from the REDIST\NoNagLTKRN directory.

If you obtained a royalty LEADTOOLS product (Document/Medical), then you will see a nag Message when you run your application. The LTKRN DLL that was installed into your system directory produces this message. This LTKRN 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" LTKRN DLL, which is located in the REDIST\NoNagLTKRN directory. When you distribute your application, you must distribute the LTKRN DLL from the REDIST\NoNagLTKRN directory, and must unlock the specialized features in your application.


LEAD Image optimizer supported formats

The following formats are currently supported by the Image Optimizer DLL functions:

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).


LEAD Supported BMP Formats

The following BMP file formats are the currently supported by the Image Optimizer DLL functions:

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 Supported JPEG Formats

The following JPEG image file formats are currently supported by the Image Optimizer DLL functions:

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).


Multimedia Features

Multimedia Feature Support

[WIN32 and ActiveX32 only] LEAD offers the Multimedia features in the LEADTOOLS Multimedia, LEADTOOLS Multimedia Pro, LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, and LEADTOOLS Medical Imaging. The Multimedia features provide support for integrating extended multimedia capabilities into your application including motion video editing, video and audio recording and video creation. The Multimedia features include functions for creating video frames with synchronized sound, editing playing, and saving AVI files, recording, playing and saving WAV files, and playing MIDI, SND, AIF, AIFC, MPEG-1 files. You will be able to capture multimedia data from any Windows Video Capture Device, using input such as a VCR, camcorder or digital camera. Support for progressive playing and downloading (streaming) of multimedia files such as Microsoft's ActiveMovie and Apple QuickTime is included. LEADTOOLS has support for enabling video conferencing over the Internet and creating client server applications to run over the Internet.


PDF Plug in Support Instructions

To implement PDF Plug in support, you must do the following:

1. | Find the PDF Plug in key on the PDF Plug in Certificate e-mailed to you.
2. | Use the PDF Plug in keyword with the L_UnlockSupport function to implement PDF Plug in support in your application.


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the LEADTOOLS Licensing help file.

Click this button to start the LEADTOOLS Products help file.

Click this button to start the LEADTOOLS Image Categories help file.


*Definitions of Binary Filters

The following are the #define statements for the constants used with the L_BinaryFilterBitmap function:

#define SPATIALFLTSIZE(dim) (sizeof(SPATIALFLT) + (sizeof(L_INT) * (((L_INT) (dim) * (L_INT) (dim)) - 1)))

#define MAKEINTFLT(i) ((LPSPATIALFLT)((L_UINT32)((L_UINT16) (i))))

#define BFLT_EROSION_OMNI MAKEINTBFLT(0)
#define BFLT_EROSION_HORZ MAKEINTBFLT(1)
#define BFLT_EROSION_VERT MAKEINTBFLT(2)
#define BFLT_EROSION_DIAG MAKEINTBFLT(3)
#define BFLT_DILATION_OMNI MAKEINTBFLT(4)
#define BFLT_DILATION_HORZ MAKEINTBFLT(5)
#define BFLT_DILATION_VERT MAKEINTBFLT(6)
#define BFLT_DILATION_DIAG MAKEINTBFLT(7)


*Definitions of Spatial Filters

The following are the #define statements for the constants used with the L_SpatialFilterBitmap function:

#define SPATIALFLTSIZE(dim) (sizeof(SPATIALFLT) + (sizeof(L_INT) * (((L_INT) (dim) * (L_INT) (dim)) - 1)))

#define MAKEINTFLT(i) ((LPSPATIALFLT)((L_UINT32)((L_UINT16) (i))))

#define FLT_EMBOSS_N MAKEINTFLT(0)
#define FLT_EMBOSS_NE MAKEINTFLT(1)
#define FLT_EMBOSS_E MAKEINTFLT(2)
#define FLT_EMBOSS_SE MAKEINTFLT(3)
#define FLT_EMBOSS_S MAKEINTFLT(4)
#define FLT_EMBOSS_SW MAKEINTFLT(5)
#define FLT_EMBOSS_W MAKEINTFLT(6)
#define FLT_EMBOSS_NW MAKEINTFLT(7)

#define FLT_GRADIENT_N MAKEINTFLT(8)
#define FLT_GRADIENT_NE MAKEINTFLT(9)
#define FLT_GRADIENT_E MAKEINTFLT(10)
#define FLT_GRADIENT_SE MAKEINTFLT(11)
#define FLT_GRADIENT_S MAKEINTFLT(12)
#define FLT_GRADIENT_SW MAKEINTFLT(13)
#define FLT_GRADIENT_W MAKEINTFLT(14)
#define FLT_GRADIENT_NW MAKEINTFLT(15)

#define FLT_LAPLACE_1 MAKEINTFLT(16)
#define FLT_LAPLACE_2 MAKEINTFLT(17)
#define FLT_LAPLACE_3 MAKEINTFLT(18)
#define FLT_LAPLACE_DIAG MAKEINTFLT(19)
#define FLT_LAPLACE_HORZ MAKEINTFLT(20)
#define FLT_LAPLACE_VERT MAKEINTFLT(21)

#define FLT_SOBEL_HORZ MAKEINTFLT(22)
#define FLT_SOBEL_VERT MAKEINTFLT(23)

#define FLT_PREWITT_HORZ MAKEINTFLT(24)
#define FLT_PREWITT_VERT MAKEINTFLT(25)

#define FLT_SHIFTDIFF_DIAG MAKEINTFLT(26)
#define FLT_SHIFTDIFF_HORZ MAKEINTFLT(27)
#define FLT_SHIFTDIFF_VERT MAKEINTFLT(28)

#define FLT_LINESEG_HORZ MAKEINTFLT(29)
#define FLT_LINESEG_VERT MAKEINTFLT(30)
#define FLT_LINESEG_LTOR MAKEINTFLT(31)
#define FLT_LINESEG_RTOL MAKEINTFLT(32)


*Implementing Scrollbars: Step 1

Modify the window style specified in the InitInstance function so that the window can have scrollbars. You do this by adding the WS_VSCROLL and WS_HSCROLL styles, as shown in the following code:

/* Create a main window for this application instance. */
hWnd = CreateWindow (
TEXT("LEADWClass"),
TEXT("LEADTOOLS Sample Application"), /* Window title */
WS_OVERLAPPEDWINDOW | WS_VSCROLL| WS_HSCROLL , /* Window style */
CW_USEDEFAULT, /* Default X position */
CW_USEDEFAULT, /* Default Y positioned */
CW_USEDEFAULT, /* Default window width */
CW_USEDEFAULT, /* Default window height */
NULL, /* Overlapped windows have no parent */
NULL, /* Use the window class menu */
hInstance, /* This instance owns this window */
NULL); /* Pointer not needed */


*Implementing Scrollbars: Step 2

Modify the EZFUNC.H file to add global variables and the prototype for a function that aids in calculating scroll ranges and positions.

The function prototype should appear as follows:

/* Use this function to interpret the WM_SIZE message's client area parameters */
void CalcClientMetrics (HWND hWnd,
int *nClientWidth,
int *nClientHeight,
int *nRightBarThickness,
int *nBottomBarThickness);

The global variables should appear as follows:

int XScrollRange, YScrollRange; /* Scrollbar ranges */
int XScrollPosition, YScrollPosition; /* Scrollbar positions */


*Implementing Scrollbars: Step 3

At the end of the EZFUNC.C file, add the new local function, CalcClientMetrics, which interprets the WM_SIZE message's client area parameters.

/*---[CalcClientMetrics]-------------------------------------------------------
Parameters: HWND hWnd Window handle
int *nClientWidth Width in and width out
int *nClientHeight Height in and height out
int *nRightBarThickness Resulting thickness of the Y scrollbar
int *nBottomBarThickness Resulting thickness of the X scrollbar
ProtoType: EZFunc.h
Notes: Use this function to interpret the client area width and
height parameters from the WM_SIZE message. The incoming
parameters attempt to give us the correct client area, excluding
scrollbars. But, because while processing this message we
show or hide the scrollbars, the incoming parameters often are
not correct. Therefore, we must get the true client area
dimensions, including scrollbars, and get the thickness of
scrollbars. The caller can then make its own decisions about
the size of the client area.
--------------------------------------------------------------------------*/

void CalcClientMetrics (HWND hWnd,
int *nClientWidth,
int *nClientHeight,
int *nRightBarThickness,
int *nBottomBarThickness)
{
DWORD dwStyle, dwVersion;
int cxClient, cyClient, cxScroll, cyScroll;

/* Initialize local variables */
cxClient = *nClientWidth;
cyClient = *nClientHeight;
cxScroll = GetSystemMetrics(SM_CXVSCROLL);
cyScroll = GetSystemMetrics(SM_CYHSCROLL);
dwStyle = GetWindowLong(hWnd, GWL_STYLE);

/* Adjust for the difference in how newer WIN32 versions report
scrollbar thickness when there is a window border */
#ifdef WIN32
{
dwVersion = GetVersion();
if (LOBYTE(LOWORD(dwVersion)) >= 4)
{
cxScroll += GetSystemMetrics(SM_CXBORDER);
cyScroll += GetSystemMetrics(SM_CYBORDER);
}
}
#endif

/* If there is a window border, subtract it from the scrollbar thickness */
if (dwStyle & WS_BORDER)
{
cxScroll -= GetSystemMetrics(SM_CXBORDER);
cyScroll -= GetSystemMetrics(SM_CYBORDER);
}

/* Add the scrollbar thickness to the client area */
if (dwStyle & WS_VSCROLL)
cxClient += cxScroll;
if (dwStyle & WS_HSCROLL)
cyClient += cyScroll;

/* Update the caller's variables */
*nClientWidth = cxClient;
*nClientHeight = cyClient;
*nRightBarThickness = cxScroll;
*nBottomBarThickness = cyScroll;
}


*Implementing Scrollbars: Step 4

In the MainWndProc function, add some new local variables to support scrolling. You can add the following code to the existing variable declarations at the beginning of the function:

int nScrollInc; /* Scrolling increment */
static BOOL fSizeInUse = FALSE; /* Flag to avoid processing multiple WM_SIZE messages */
int ClientWidth, ClientHeight, BottomBarThickness, RightBarThickness; /* Client area metrics */
RECT ScrollRect; /* Used in WM_HSCROLL and WM_VSCROLL to make scrolling smoother */


*Implementing Scrollbars: Step 5

In the MainWndProc function, modify the WM_CREATE message processing so that the display rectangle does not fit the client area. To keep it simple, initialize the display rectangle to be the same size as the bitmap. In the WM_PAINT message processing, the L_PaintDC function uses rLeadDest as the display rectangle.

case WM_CREATE:
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = L_LoadBitmap (szFilename, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL);
if (nRet != SUCCESS)
{
wsprintf (achBuff, TEXT("Error %d loading %s"), nRet, szFilename);
MessageBox (NULL, achBuff, TEXT("Error"), MB_OK);
/* We have an error, so post WM_DESTROY */
PostMessage (hWnd, WM_DESTROY, 0, 0);
return (FALSE);
}
/* Set the destination rectangle to use the whole bitmap */
SetRect(&rLeadDest, 0, 0, LeadBitmap.Width, LeadBitmap.Height);
/* Set the source rectangle to use the whole bitmap */
SetRect(&rLeadSource, 0, 0, LeadBitmap.Width, LeadBitmap.Height);
/* Set the display width and height variables to be the same as the bitmap, with proper orientation */
DisplayWidth = BITMAPWIDTH(&LeadBitmap);
DisplayHeight = BITMAPHEIGHT(&LeadBitmap);
/* Force paint palette creation */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
return (TRUE);


*Implementing Scrollbars: Step 6

In the MainWndProc function, add code to process WM_SIZE messages. This code shows or hides the scrollbars, as needed, and it adjusts the scrollbar ranges and positions.

case WM_SIZE:
/* Avoid processing other WM_SIZE messages while we are processing this one */
if (fSizeInUse == TRUE)
return (0);
fSizeInUse = TRUE;
/* Turn off scrolling and exit if the window is minimized, or
if there is no bitmap */
if ((wParam == SIZE_MINIMIZED) || (!LeadBitmap.Flags.Allocated))
{
SetScrollRange(hWnd, SB_VERT, 0, 0, FALSE);
SetScrollRange(hWnd, SB_HORZ, 0, 0, FALSE);
fSizeInUse = FALSE;
return (0);
}
/* Initialize the client height and width using message parameters */
ClientHeight = HIWORD(lParam);
ClientWidth = LOWORD(lParam);
/* Update the values, separating client information from scrollbar information */
CalcClientMetrics (hWnd,
&ClientWidth,
&ClientHeight,
&RightBarThickness,
&BottomBarThickness);
/* Use the offsets of the display to initialize scroll positions */
XScrollPosition = -rLeadDest.left;
YScrollPosition = -rLeadDest.top;
/* Calculate the range and scroll position of the vertical scroll bar */
if (ClientHeight >= DisplayHeight)
{ /* We do not need a vertical scroll bar */
/* Use the full display height, and turn off the scroll bar */
rLeadDest.bottom = DisplayHeight;
rLeadDest.top = 0;
SetScrollRange(hWnd, SB_VERT, 0, 0, FALSE);
}
else
{ /* We need a vertical scrollbar */
/* The range and position of the vertical scrollbar depend on
whether there is also a horizontal scrollbar */
if (ClientWidth >= DisplayWidth)
{ /* There will not be a horizontal scroll bar */
/* Calculate the range without the horizontal scrollbar */
YScrollRange = DisplayHeight - ClientHeight;
/* If the expected scroll position would leave blank space,
adjust the scroll position and reposition the display rectangle */
if (YScrollPosition > YScrollRange)
{ /* Reposition the display rectangle */
OffsetRect (&rLeadDest, 0, YScrollPosition - YScrollRange);
/* Adjust the scroll position */
YScrollPosition = YScrollRange;
}
}
else
{ /* There will also be a horizontal scroll bar */
/* Calculate the scroll range, including the scrollbar */
YScrollRange = DisplayHeight - ClientHeight + BottomBarThickness;
}
SetScrollRange(hWnd, SB_VERT, 0, YScrollRange, FALSE);
SetScrollPos(hWnd, SB_VERT, YScrollPosition, TRUE);
}
/* Calculate the range and scroll position of the horizontal scroll bar */
if (ClientWidth >= DisplayWidth)
{ /* We do not need a horizontal scroll bar */
/* Use the full display width, and turn off the scroll bar */
rLeadDest.right = DisplayWidth;
rLeadDest.left = 0;
SetScrollRange(hWnd, SB_HORZ, 0, 0, FALSE);
}
else
{ /* We need a horizontal scrollbar */
/* The range and position of the horizontal scrollbar depend on
whether there is also a vertical scrollbar */
if (ClientHeight >= DisplayHeight)
{ /* There will not be a vertical scroll bar */
/* Calculate the range without the vertical scrollbar */
XScrollRange = DisplayWidth - ClientWidth;
/* If the expected scroll position would leave blank space,
adjust the scroll position and reposition the display rectangle */
if (XScrollPosition > XScrollRange)
{ /* Reposition the display rectangle */
OffsetRect (&rLeadDest, XScrollPosition - XScrollRange, 0);
/* Adjust the scroll position */
XScrollPosition = XScrollRange;
}
}
else
{ /* There will also be a vertical scroll bar */
/* Calculate the scroll range, including the scrollbar */
XScrollRange = DisplayWidth - ClientWidth + RightBarThickness;
}
SetScrollRange(hWnd, SB_HORZ, 0, XScrollRange, FALSE);
SetScrollPos(hWnd, SB_HORZ, XScrollPosition, TRUE);
}
fSizeInUse = FALSE;
return (0);


*Implementing Scrollbars: Step 7

In the MainWndProc function, add code to process WM_HSCROLL and WM_VSCROLL messages.

case WM_HSCROLL:
/* Udpate the global rClientSize rectangle */
GetClientRect(hWnd,&rClientSize);
/* See how much the user wants to scroll */
switch (LOWORD(wParam))
{
/* Decrement by 10 percent */
case SB_LINELEFT:
nScrollInc = - XScrollRange / 10;
break;
/* Increment by 10 percent */
case SB_LINERIGHT:
nScrollInc = XScrollRange / 10;
break;
/* Decrement by client size */
case SB_PAGELEFT:
nScrollInc = - rClientSize.right;
break;
/* Increment by client size */
case SB_PAGERIGHT:
nScrollInc = rClientSize.right;
break;
/* Calculate the change in the THUMB position */
case SB_THUMBPOSITION:
nScrollInc = HIWORD(wParam) - XScrollPosition;
break;
/* No increment; so exit */
default:
return (0);
}
/* Limit the scroll increment to the amount available */
if (nScrollInc > 0)
nScrollInc = min(nScrollInc, (XScrollRange - XScrollPosition));
else
nScrollInc = max(nScrollInc, -XScrollPosition);
/* Update the global display rectangle */
OffsetRect (&rLeadDest,-nScrollInc, 0);
/* Scroll the client area */
ScrollWindow (hWnd,-nScrollInc, 0, NULL, NULL);
/* Calculate the new scroll position */
XScrollPosition += nScrollInc;
/* Prevent a background erase of the area uncovered by scrolling */
if (nScrollInc > 0)
{
SetRect(&ScrollRect, rClientSize.right - nScrollInc, 0,
rClientSize.right, rClientSize.bottom);
}
else
{
SetRect(&ScrollRect, 0, 0, -nScrollInc, rClientSize.bottom);
}
ValidateRect(hWnd, &ScrollRect);
InvalidateRect(hWnd, &ScrollRect, FALSE);
/* Set the new scroll position */
SetScrollPos (hWnd, SB_HORZ, XScrollPosition, TRUE);
/* Update the window */
UpdateWindow (hWnd);
return (0);
case WM_VSCROLL:
/* Udpate the global rClientSize rectangle */
GetClientRect(hWnd,&rClientSize);
/* See how much the user wants to scroll */
switch (LOWORD(wParam))
{
/* Decrement by 10 percent */
case SB_LINEUP:
nScrollInc = - YScrollRange / 10;
break;
/* Increment by 10 percent */
case SB_LINEDOWN:
nScrollInc = YScrollRange / 10;
break;
/* Decrement by client size */
case SB_PAGEUP:
nScrollInc = - rClientSize.bottom;
break;
/* Increment by client size */
case SB_PAGEDOWN:
nScrollInc = rClientSize.bottom;
break;
/* Calculate the change in the THUMB position */
case SB_THUMBPOSITION:
nScrollInc = HIWORD(wParam) - YScrollPosition;
break;
/* No increment; so exit */
default:
return (0);
}
/* Limit the scroll increment to the amount available */
if (nScrollInc > 0)
nScrollInc = min(nScrollInc, (YScrollRange - YScrollPosition));
else
nScrollInc = max(nScrollInc, -YScrollPosition);
/* Update the global display rectangle */
OffsetRect (&rLeadDest, 0, -nScrollInc);
/* Scroll the client area */
ScrollWindow (hWnd, 0, -nScrollInc, NULL, NULL);
/* Prevent a background erase of the area uncovered by scrolling */
if (nScrollInc > 0)
{
SetRect(&ScrollRect, 0, rClientSize.bottom - nScrollInc,
rClientSize.right, rClientSize.bottom );
}
else
{
SetRect(&ScrollRect, 0, 0, rClientSize.right,-nScrollInc);
}
ValidateRect(hWnd, &ScrollRect);
InvalidateRect(hWnd, &ScrollRect, FALSE);
/* Calculate the new scroll position */
YScrollPosition += nScrollInc;
/* Set the new scroll position */
SetScrollPos (hWnd, SB_VERT, YScrollPosition, TRUE);
/* Update the window */
UpdateWindow (hWnd);
return (0);


*Zooming In on a Selection: Step 1

On WIN32 systems, include the GDI library so that we can display an outline of the selection. The code should appear as follows:

#include <wingdi.h> /* For GDI functions */


*Zooming In on a Selection: Step 2

Modify the EZFUNC.H file to add global variables for tracking coordinates. The variable declarations should appear as follows:

L_BOOL FirstDraw; /* The state for the first WM_MOUSEMOVE event when cropping */
int StartGDIX; /* Starting X position in screen pixels */
int StartGDIY; /* Starting Y position in screen pixels */
int EndGDIX; /* Ending X position in screen pixels */
int EndGDIY; /* Ending Y position in screen pixels */
int StartPixelX; /* Starting X position in bitmap pixels */
int StartPixelY; /* Starting Y position in bitmap pixels */
int EndPixelX; /* Ending X position in bitmap pixels */
int EndPixelY; /* Ending Y position in bitmap pixels */
L_INT DisplayLeft, DisplayTop; /* Origin of the displayed image */


*Zooming In on a Selection: Step 3

In the MainWndProc function, add some new local variables to support the GDI functions. You can add the following code to the existing variable declarations at the beginning of the function:

/* Local variables used with GDI functions on WM_MOUSEMOVE */
HGDIOBJ SavedPen, SavedBrush;
int DisplayMode;
HDC ThisWindowDC;


*Zooming In on a Selection: Step 4

In the MainWndProc function, add code to process WM_LBUTTONDOWN messages. This code initializes coordinates for defining two rectangles. One rectangle is relative to the client area and is used with the GDI functions to outline the selection. The other rectangle is relative to the bitmap and is used to zoom in by defining the source rectangle for painting. The code should appear as follows:

case WM_LBUTTONDOWN:
/* Save the starting position in screen pixels (used by GDI functions) */
StartGDIX = LOWORD(lParam);
StartGDIY = HIWORD(lParam);

/* Use the mouse position's percentage offsets in the image rectangle
to determine the pixel offsets in the bitmap.
Using percentages allows for the possibility that the image is zoomed. */
StartPixelX = MulDiv(BITMAPWIDTH(&LeadBitmap), StartGDIX - rLeadDest.left, DisplayWidth);
StartPixelY = MulDiv(BITMAPHEIGHT(&LeadBitmap), StartGDIY - rLeadDest.top, DisplayHeight);

/* Initialize a variable used when the WM_MOUSEMOVE event outlines the area */
FirstDraw = TRUE;
return (0);


*Zooming In on a Selection: Step 5

In the MainWndProc function, add code to process WM_MOUSEMOVE messages. This code outlines the selection using GDI functions . The code should appear as follows:

case WM_MOUSEMOVE:
/* Use GDI functions to outline the area to be cropped. */
if (wParam == MK_LBUTTON)
{
ThisWindowDC = GetDC(hWnd);
SavedPen = SelectObject(ThisWindowDC, GetStockObject(WHITE_PEN));
SavedBrush = SelectObject(ThisWindowDC, GetStockObject(NULL_BRUSH));
DisplayMode = GetROP2(ThisWindowDC);
SetROP2(ThisWindowDC, R2_NOT);
if (FirstDraw == FALSE)
Rectangle(ThisWindowDC, StartGDIX, StartGDIY, EndGDIX, EndGDIY);
EndGDIX = LOWORD(lParam);
EndGDIY = HIWORD(lParam);
Rectangle(ThisWindowDC, StartGDIX, StartGDIY, EndGDIX, EndGDIY);
FirstDraw = FALSE;
SetROP2(ThisWindowDC, DisplayMode);
}
return (0);


*Zooming In on a Selection: Step 6

In the MainWndProc function, add code to process WM_LBUTTONUP messages. This code defines the source and destination rectangles for painting, and forces a repaint. The code should appear as follows:

case WM_LBUTTONUP:
EndGDIX = LOWORD(lParam);
EndGDIY = HIWORD(lParam);
/* Use the mouse position's percentage offsets in the image rectangle
to determine the pixel offsets in the bitmap.
Using percentages allows for the possibility that the image is zoomed. */
EndPixelX = MulDiv(BITMAPWIDTH(&LeadBitmap), EndGDIX - rLeadDest.left, DisplayWidth);
EndPixelY = MulDiv(BITMAPHEIGHT(&LeadBitmap), EndGDIY - rLeadDest.top, DisplayHeight);
/* Do nothing if no area is defined */
if ((EndPixelX == StartPixelX) || (EndPixelY == StartPixelY))
return (0);
/* Get the source rectangle coordinates for painting.
Allow for different mouse drag directions */
if (StartGDIX < EndGDIX)
{
rLeadSource.left = StartPixelX;
rLeadSource.right = EndPixelX;
}
else
{
rLeadSource.left = EndPixelX;
rLeadSource.right = StartPixelX;
}
if (StartGDIY < EndGDIY)
{
rLeadSource.top = StartPixelY;
rLeadSource.bottom = EndPixelY;
}
else
{
rLeadSource.top = EndPixelY;
rLeadSource.bottom = StartPixelY;
}
/* Use this local function (described in Fitting an Image to a Window) to
center the cropped display in the client area. */
CalcDisplay (rClientSize.right, /* Width allowed */
rClientSize.bottom, /* Height allowed */
rLeadSource.right - rLeadSource.left, /* Width factor, for aspect ratio */
rLeadSource.bottom - rLeadSource.top, /* Height factor, for aspect ratio */
&DisplayTop, /* Resulting top value, for centering */ &DisplayLeft, /* Resulting left value, for centering */ &DisplayWidth, /* Resulting width value */
&DisplayHeight); /* Resulting height value */
/* Set the destination rectangle for painting */
SetRect(&rLeadDest, DisplayLeft, DisplayTop,
DisplayLeft + DisplayWidth, DisplayTop + DisplayHeight);
/* If necessary, translate the source rectangle to the bitmap's view perspective */
if (LeadBitmap.ViewPerspective != TOP_LEFT)
L_RectToBitmap(&LeadBitmap, TOP_LEFT, &rLeadSource);
/* Repaint the whole client area */
InvalidateRect(hWnd,NULL,TRUE);
return (0);


*Zooming In on a Selection: Step 7

In the MainWndProc function, add code to process WM_RBUTTONDOWN messages. This code displays the full image when the user clicks the right mouse button. During testing, this lets you try the selection feature more than once. The code should appear as follows:

case WM_RBUTTONDOWN:
/* Set the source rectangle for painting */
SetRect(&rLeadSource, 0, 0, LeadBitmap.Width, LeadBitmap.Height);
/* Make the destination rectangle for painting the same as the client area */
rLeadDest = rClientSize;
/* Update the global variables for keeping track of the display */
DisplayLeft = 0;
DisplayTop = 0;
DisplayWidth = rClientSize.right;
DisplayHeight = rClientSize.bottom;
/* Repaint the whole client area */
InvalidateRect(hWnd,NULL,FALSE);
return (0);


Barcode Modules

The following Barcode Modules are available from LEAD. Please note (*) that each module requires runtime-licensing.

LEADTOOLS 1D Symbols (read and write) $1195*

LEADTOOLS 2D Code One (read) $1595*

LEADTOOLS 2D Code One (write) $1395*

LEADTOOLS 2D PDF417 (read) $1595*

LEADTOOLS 2D PDF417 (write) $1395*